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"})

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Ah, OK, I see where this seems to go wrong.
Hope I get the time to fix this soon.

drunken monkey’s picture

Oh, forgot to ask: Are you using the old (search_api_facets) or the new (search_api_facetapi, building on the Facet API) facets?

elda32’s picture

The new ones :)

drunken monkey’s picture

I 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!

drunken monkey’s picture

Status: Active » Needs review
elda32’s picture

The query is now correct, thanks a lot!

drunken monkey’s picture

Status: Needs review » Fixed

Great, committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.