Using Solr Apache. I would like to show first, exact match and then fuzzy match in search reault.
For example, I try to find the world test however in the response I get results with worlds like cast, latest before results which contains the actual word test first.
I tried queries like this: test^100 OR test~^5
but that did not change the order of the result, maybe this change on the query is not correct.
My Solr config:
solrconfig.xml
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="defType">edismax</str>
<int name="rows">10</int>
<str name="df">text</str>
<str name="wt">php</str>
<str name="sort">score desc</str>
<str name="fl">*, score</str>
<!-- Highlighting defaults -->
<str name="hl">on</str>
<str name="hl.fl">*</str>
<str name ="hl.snippets">10</str>
<str name="hl.fragsize">250</str>
<str name="tie">0.1</str>
<str name="hl.simple.pre"><b style="color:black;background-color:#888888"></str>
<str name="hl.simple.post"></b></str>
<str name="hl.usePhraseHighlighter">true</str>
<str name="hl.highlightMultiTerm">true</str>
<str name ="hl.useFastVectorHighligher">true</str>
<str name ="hl.maxAnalyzedChars">200000</str>
<str name="f.title.hl.alternateField">title</str>
<str name="f.description.hl.alternateField">description</str>
<str name="spellcheck">true</str>
</lst>
schema.xml
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="50"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
</analyzer>
</fieldType>
Thanks,