Hi, I have a field which has data like this: <letters> <letters> <numbers> <letters> <numbers> <letters> <numbers> Where <letters> can have from 1 to 10 letters strings and <number> can have up to 4 digits.
It is defined like this: <field name="myField" type="myFieldType" indexed="true" stored="true" multiValued="true" /> <fieldType name="myFieldType" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.KeywordTokenizerFactory" /> <filter class="solr.LowerCaseFilterFactory" /> </analyzer> </fieldType> When the user enters foo, i search for foo directly or something that starts with "foo ". I don't want to find "fool" or "foop" or anything like this. I also allow users to enter terms that they don't want to find. So a query for "foo NOT foo 123" is converted to this: parsedquery_toString: "+(+(myField:foo myField:foo *) +(-myField:foo 123 -myField:foo 123 * +*:*))", My problem is that this finds more entries then just foo, which converts to this: parsedquery_toString: "+(myField:foo myField:foo *)", I have read a bit about the internal solr logic, using MUST, SHOULD and MUST_NOT, but still don't understand. When I look at parsedquery_toString: "+(+(myField:foo myField:foo *) +(-myField:foo 123 -myField:foo 123 * +*:*))", then I see two criteria A and B and both MUST be satisfied. Criteria A is the same as parsedquery_toString: "+(myField:foo myField:foo *)", so the number of results MUST be identical here. Since the final results must match both A and B, the number must be equal or lower than just A, right? Where do I think wrong? Thanks, Kai