다-를 건너뛰는 제안이 반환하는 동 문서로 원래 검색
-
21-12-2019 - |
문제
나는 추천 검색어 작업을 잘하고 나는 다음과 같이 얻을 제안하는 경우에도 원래는 키워드 결과를 반환(만약 우리가 가진 문서는 맞춤법이 우리의 컬렉션에서).그러나,종종,나는 제안이 반환하는 정확한 결과입니다.Ex.검색 노란색 민트 주석,나는"당신이 말은 노란색 민트 통?"
이 있을 제거하는 방법이 제안을 반환하는 것과 같은 효과를 원래 기간입니까?
내가 사용하여다 4.6.0 여기서 정보 solrconfig.xml
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">text_general</str>
<!-- a spellchecker built from a field of the main index -->
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">spell2</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
<str name="distanceMeasure">internal</str>
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
<float name="accuracy">0.1</float>
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
<int name="maxEdits">2</int>
<!-- the minimum shared prefix when enumerating terms -->
<int name="minPrefix">0</int> <!-- if set to 1, must start with same letter -->
<!-- maximum number of inspections per result. -->
<int name="maxInspections">5</int>
<!-- minimum length of a query term to be considered for correction -->
<int name="minQueryLength">4</int>
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
<float name="maxQueryFrequency">0.01</float>
</lst>
<!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
<lst name="spellchecker">
<str name="name">wordbreak</str>
<str name="classname">solr.WordBreakSolrSpellChecker</str>
<str name="field">spell2</str>
<str name="combineWords">true</str>
<str name="breakWords">true</str>
<int name="maxChanges">10</int>
<str name="buildOnCommit">true</str>
<int name="minBreakLength">3</int>
</lst>
</searchComponent>
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="echoParams">none</str>
<int name="rows">10</int>
<str name="df">contents</str>
<str name="defType">edismax</str>
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck">on</str>
<str name="spellcheck.extendedResults">false</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.alternativeTermCount">25</str>
<str name="spellcheck.maxResultsForSuggest">25</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.maxCollationTries">10</str>
<str name="spellcheck.maxCollations">5</str>
<str name="spellcheck.onlyMorePopular">false</str>
<str name="spellcheck.collateParam.defType">dismax</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
여기서 정보 schema.xml
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<field name="spell2" type="text_general" indexed="true" stored="false" required="false" multiValued="true" />
예를 들어 쿼리 http://localhost:8985/solr/(collection)/spell?q=yellow%20buttermints
환
<str name="collation">yellow (butter mints)</str>
<str name="collation">yellow buttermint</str>
"노란색 buttermints"및"노란색 buttermint"동일한 결과를 반환합니다.
해결책
지가 있다고 생각하지 않은 명확한을 보장하는 방법이다.하지만 이것은 확실히 도움말-
추가 이 필터는 모두에서 쿼리와 인덱스 시간 EnglishMinimalStemFilterFactory
나는 확실하지 않으면 어떻게 SynonymFilterFactory 에서 작동합니다.당신이 시도할 수 있습없이 그것은 너무
제휴하지 않습니다 StackOverflow