Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Views integration
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2022 at 19:39 UTC
Updated:
4 Mar 2023 at 21:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dxvargas commentedI'm uploading a first patch that fixes the problem.
Comment #3
dxvargas commentedThere was a bug, I'm uploading again a first patch that fixes the problem.
Comment #4
dxvargas commentedComment #5
michelrrr commented[ UPDATE
Fixed thanks to : this patch #3 + https://www.drupal.org/project/search_api/issues/3313837
]
Hello, I've applied the patch in order to get the OR working (with 2 fields only) but now it return all records instead of only the ones specified in the contextual filters. By looking at the query in the view, I see the OR correctly set on the fields nevertheless, I get back all contents instead of the ones matching the query. Don't know if it's linked to the "... OR" extension or to "search api"
Comment #6
drunken monkey#3318187: Fix regressions in Views filters solved a similar issue, did that patch maybe fix the problem for you? Please try out the latest dev version and let me know.
Comment #7
carolpettirossi commented@drunken monkey, the patch from https://www.drupal.org/project/search_api/issues/3318187 did not solve the issue for me.
Comment #8
drunken monkeyOK, thanks for the feedback!
Are there any steps to reproduce that don’t require an alter hook?
Comment #9
dxvargas commentedHi @drunken_monkey,
The related issue https://www.drupal.org/project/views_contextual_filters_or/issues/3314825 has the same problem and it is using plugins instead of an alter hook.
Comment #10
carolpettirossi commented@drunken monkey, hopefully the context below helps:
I'm using the
views_contextual_filters_ormodule.My scenario:
Content types and Taxonomies are categorized with "Brands", where Brands are taxonomy terms.
When the user searches for something while in the brand A site, the search should return only Taxononomies or Nodes for that brand hence why I have the configuration below in the
Contextual Filters:And the settings below in the
Query settings:Comment #11
carolpettirossi commentedComment #12
carolpettirossi commentedFor me, with the scenario, I described in #10,
Comment #13
drunken monkeyI was able to reproduce the problem using the Views Contextual Filters OR module and I think I managed to also arrive at a solution covering all scenarios. Please test/review the attached patch.
Comment #14
ben25 commentedI can HAPPILY confirm that #13 is working for me.
Comment #15
frontmobeI can confirm the patch in #13 solves the issue on a search index view with multiple contextual filters enabled, search_api 1.28 and views_contextual_filters_or 1.4 modules enabled (running Drupal 9.5).
Thanks for the patch!
Comment #17
drunken monkeyGood to hear, thanks a lot for testing and reporting back!
Committed.
Thanks again, everyone!
Comment #18
drunken monkey