1
votes

There is a field in my schema 'fullText' which is of the 'text_en' type, and multivalued. The term 'tests' is in the fullText field in one document.

In solr, when I try to search using the word 'test', with the standard lucene parser with minimal distance 1, its returning the document. The query I am using is:

http://localhost:8983/solr/simple/select?q=fullText:test~1&wt=xml&indent=true

But I am doing the same using dismax, and its not returning the document. The queries I have tried are:

http://localhost:8983/solr/simple/select?q=test&wt=xml&indent=true&defType=dismax&qf=fullText~1

http://localhost:8983/solr/simple/select?q=test~1&wt=xml&indent=true&defType=dismax&qf=fullText
1

1 Answers

2
votes

DisMax, by design, does not support all lucene query syntax in it's query parameter. From the documentation:

This query parser supports an extremely simplified subset of the Lucene QueryParser syntax. Quotes can be used to group phrases, and +/- can be used to denote mandatory and optional clauses ... but all other Lucene query parser special characters are escaped to simplify the user experience.

Fuzzy queries are one of the things that are not supported. There is a request to add it to the qf parameter, if you'd care to take a look, but it has not been implemented.

One good solution would be to go to the edismax query parser, instead. It's query parameter supports full lucene query parser syntax:

http://localhost:8983/solr/simple/select?q=test~1&defType=edismax&qf=fullText