: >> (+category:xyz +price:[100 TO *]) -category:xyz : : this one doesn't seem to work (I'm not using a price field, but a text field : -- using price field here just for example).
it never will, it's saying only things that are in category xyz and above 100 dollars can match, but anything in category xyz can not match. inherient contradiction. : (+category:xyz +price:[100 TO *]) (-category:xyz) -- returns only results : with category xyz and price >=100 you can't have a pure negative clauses in a boolean query -- they match nothing (by definition: a query that only rejects things doesn't select anything) the second set of parens creates a boolean query with one negative clause, so it selects nothing, hence you only get docs matching the first part. : (+category:xyz +price:[100 TO *]) (*:* -category:xyz) -- returns results : with category xyz and price >=100 AND results where category!=xyz exactly. *:* selects all docs, and -category:xyz then rejects the ones in category xyz. these are then combined with the docs from the first part (in cat xyz and above 100) so now you have what you want... : > >> > How do I implement a requirement like "if category is xyz, : > >> > the price should : > >> > be greater than 100 for inclusion in the result set". -Hoss