The threshold frequency does not work when checking spelling in Solr

I get stuck in the middle of Solr . I need only the most popular words wrt query . I used a phonetic filter for index and query , but here is the problem is that it provides too many terms , I only need a few terms that are very specific to the request .

schema.xml

<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <filter class="solr.TrimFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type="query"> <filter class="solr.TrimFilterFactory"/> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true"/> </analyzer> </fieldType> 

solrconfig.xml

  <lst name="spellchecker"> <str name="name">default</str> <str name="field">term</str> <str name="classname">solr.DirectSolrSpellChecker</str> <str name="distanceMeasure">internal</str> <float name="accuracy">0.5</float> <int name="maxEdits">2</int> <int name="minPrefix">1</int> <int name="maxInspections">5</int> <int name="minQueryLength">4</int> <float name="maxQueryFrequency">0.90</float> <float name="thresholdTokenFrequency">0.90</float> </lst> <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"> <lst name="defaults"> <str name="df">term</str> <str name="spellcheck.dictionary">default</str> <str name="spellcheck">on</str> <str name="spellcheck.extendedResults">true</str> <str name="spellcheck.count">10</str> <str name="spellcheck.alternativeTermCount">10</str> <str name="spellcheck.maxResultsForSuggest">10</str> <str name="spellcheck.collate">true</str> <str name="spellcheck.collateExtendedResults">true</str> <str name="spellcheck.maxCollationTries">10</str> <str name="spellcheck.maxCollations">5</str> <str name="spellcheck.onlyMorePopular">true</str> </lst> <arr name="last-components"> <str>spellcheck</str> </arr> </requestHandler> 

I also use thresholdTokenFrequency , but it does not work . I tried changing the threshold value between 0 and 1 . but he always gives the same result . Any help?

+2
source share

Source: https://habr.com/ru/post/915478/


All Articles