Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My understanding is that range queries on facets (e.g. my_field:[0 TO 10]) are split into two sub-queries: [0 TO *] and [* TO 10]. However, the previous "and" conjuction does not seem fixed, but rather seems to come from the facet settings. So if you set your facet to use the "or" operator, the query sent to the backend becomes:
is_my_field:["0"+TO+*])+OR+(is_my_field:{*+TO+"10"})
Comment | File | Size | Author |
---|---|---|---|
#4 | 1297958--wrong-conjunction-for-range-facets-4.patch | 1.34 KB | drunken monkey |
Comments
Comment #1
drunken monkeyAh, OK, I see where this seems to go wrong.
Hope I get the time to fix this soon.
Comment #2
drunken monkeyOh, forgot to ask: Are you using the old (search_api_facets) or the new (search_api_facetapi, building on the Facet API) facets?
Comment #3
elda32 CreditAttribution: elda32 commentedThe new ones :)
Comment #4
drunken monkeyI wasn't really able to reproduce this with my setup, but I think the attached patch should fix this.
Please try it out and report back!
Comment #5
drunken monkeyComment #6
elda32 CreditAttribution: elda32 commentedThe query is now correct, thanks a lot!
Comment #7
drunken monkeyGreat, committed.