Numerical and boolean filter combined does not work

I am currently trying to combine two filter statements together to achieve a result, but cannot seem to make it work. Currently, two statements by themselves work without a problem:

The first two open object shows that I’m querying with filter ‘promotion_item=1’ with hits.
The second two open object shows that I’m querying with numeric value with price with hits.
If I combine them (third two open objects) shows no hits.

I’ve tried:

filters: ‘promotion_item=1 AND price:10 to 20)’
filters: ‘promotion_item=1 AND price >= 10 AND price <= 20’
filters: ‘(promotion_item=1) AND (price:10 to 20)’
and other combination on with paraenthesis.

Could anyone shine some light on this and help me? I would greatly appreciate it!

Hi Jae,

Can you confirm that you have added price and promotion_item to Searchable Atributes & Attributes for Faceting? See screenshots below:

The specific search I used with a similar sample dataset was:

  "filters":"promotion_item:1 AND price:10 TO 20"

You can also accomplish it with:

  "facetFilters": ["promotion_item:1"],
  "numericFilters": ["price:10 to 20"]

Let me know how it goes and if you have further questions.
Best regards,

1 Like

Thank you, I have actually figured it out. My price data was stored as a string for promotion items, when it was correctly classed it works perfectly fine! Thanks for your reply and confirmation! Glad to hear you are up and running.