Question

I have 2 types of solr query.One uses EDisMax parser and other one uses standard query parser as default.Following are the 2 query I have used.Purpose of the query is document that doesn't contains following word ELM,PST,June.

EDisMax Query

q= content:(-EML -PST -June) OR contentenstem:(-EML -PST -June)&start=0&rows=25 &defType=edismax&fl=content filename

It produces about 12232 results; In which 4292 results of docs contains any of the given query string that EML or PST or June.So 4292 result docs are wrong.

Standard parser Query

query:q=size:[ 0 TO * ]&fq=content:( -EML -PST -June )&fq=contentenstem:( -EML -PST -June )&start=0&rows=25&fl=content file name

It produces about 7940 result.

Why EDisMax query failed for this query;How to achieve the right result with use of EDisMax parser query

If we know how EDisMax and Standard query parser parses AND & OR Boolean query on the document, we may get the answer for why different doc count occurred for different parser.

Était-ce utile?

La solution

Switch OR to AND in the EDisMax query. OR and AND act differently:

OR will cause results that meet one or both of your restrictions (for content and contentstem).

AND is stricter: results must meet both the restrictions.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top