Wait. If the default op is OR, I thought this query: (+category:xyz +price:[100 TO *]) -category:xyz
meant "with xyz and range, OR without xyz" because without a plus or minus, OR really means SHOULD (which, bizzarely, is not a keyword). (+category:xyz +price:[100 TO *]) (-category:xyz) Is this what I'm thinking of? Does this really need an OR in the middle? On Thu, May 13, 2010 at 9:48 AM, Chris Hostetter <hossman_luc...@fucit.org> wrote: > > : >> (+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 > > -- Lance Norskog goks...@gmail.com