I have a problem with a phrase query.
Query input: "to many results"
I want to have only the text that contain exact matching phrase:
"word word word to many results word word word"
"word word to many results word"
But the problem is:
"word word word to many results word word word"
"word word to many results word"
"word many results word" - I don't wanna have this in my result
Schema:
<fieldType name="text" class="solr.TextField" termVectors="true" termPositions="true" termOffsets="true" autoGeneratePhraseQueries="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory" />
<filter class="solr.TrimFilterFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.ReversedWildcardFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory" />
<filter class="solr.TrimFilterFactory" />
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
Thanks for help
If you need an exact phrase match in same order, you would need to pass the query in phrase e.g "to many results".
This would return results for exact match and all words together.
If the query is not a phrase query and just needs all words present, the search would looks for words in the document within some positions (depends on the definition of slop) and the default search operator which have default is OR.
If you are using dismax, its control by the query slop for the qf and Minimum match (mm), the number of terms needed to be present in the document for it to be returned as a result.
If you are using standard request handler you need to check the Query parser default operator.
http://wiki.apache.org/solr/SchemaXml#Default_query_parser_operator