2017-04-21 5 views
0

solr 6.5.0의 맞춤법 검사와 관련된 문제가 있습니다. 맞춤법 검사 요청 처리기/맞춤법 검사를 통해 쿼리를 실행하면 쿼리가 예상대로 작동하며 잘못된 단어에 대해 맞춤법을 제안합니다.SOLR 맞춤법 검사 결과가 반환되지 않습니다.

{ 
    "responseHeader":{ 
    "status":0, 
    "QTime":42}, 
    "response":{"numFound":0,"start":0,"docs":[] 
    }, 
    "spellcheck":{ 
    "suggestions":{ 
     "injary":{ 
     "numFound":3, 
     "startOffset":0, 
     "endOffset":6, 
     "origFreq":0, 
     "suggestion":[{ 
      "word":"injury", 
      "freq":121}, 
      { 
      "word":"inward", 
      "freq":3}, 
      { 
      "word":"injure", 
      "freq":1}]}}, 
    "correctlySpelled":false, 
    "collations":{ 
     "collation":{ 
     "collationQuery":"injury", 
     "hits":121, 
     "misspellingsAndCorrections":[ 
      "injary","injury"]}, 
     "collation":{ 
     "collationQuery":"inward", 
     "hits":3, 
     "misspellingsAndCorrections":[ 
      "injary","inward"]}, 
     "collation":{ 
     "collationQuery":"injure", 
     "hits":1, 
     "misspellingsAndCorrections":[ 
      "injary","injure"]}}}} 

그러나 표준 요청 처리기/select를 통해 쿼리를 실행하면 제안이 없습니다.

{ 
    "responseHeader":{ 
    "status":0, 
    "QTime":0, 
    "params":{ 
     "q":"injary", 
     "indent":"on", 
     "spellcheck":"on", 
     "wt":"json", 
     "_":"1492780436450"}}, 
    "response":{"numFound":0,"start":0,"docs":[] 
    }} 

도움을 주시면 감사하겠습니다.

 <lst name="spellchecker"> 
     <str name="name">default</str> 
     <str name="field">content</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.01</float> 
     <float name="thresholdTokenFrequency">.0001</float> 
     </lst> 

    <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"> 
    <lst name="defaults"> 
     <!-- Solr will use suggestions from both the 'default' spellchecker 
      and from the 'wordbreak' spellchecker and combine them. 
      collations (re-written queries) can include a combination of 
      corrections from both spellcheckers --> 
     <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">5</str> 
     <str name="spellcheck.maxResultsForSuggest">5</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="wt">json</str> 
    </lst> 
    <arr name="last-components"> 
     <str>spellcheck</str> 
    </arr> 
    </requestHandler> 

<requestHandler name="/select" class="solr.SearchHandler"> 
    <!-- default values for query parameters can be specified, these 
     will be overridden by parameters in the request 
     --> 
    <lst name="defaults"> 
     <str name="echoParams">explicit</str> 
     <int name="rows">10</int> 
     <str name="df">_text_</str> 
     <str name="wt">json</str> 
     <!-- spell check component configuration --> 
     <str name="spellcheck">true</str> 
     <str name="spellcheck.count">5</str> 
     <str name="spellcheck.collate">true</str> 
     <str name="spellcheck.maxCollationTries">5</str> 
    </lst> 
    <arr name="last-components"> 
     <str>spellcheck</str> 
    </arr> 
    </requestHandler> 
+0

이것은 'solrconfig.xml'의 일부이며 Solr을 수정 한 후에 다시 시작 했습니까? – freedev

+0

변경 후 다시 시작했습니다. – Zoran

답변

0

문제가 내 관리 - 스키마 파일에 관련이 나타납니다

나는 다음과 같은 라인에 두 개의 요청 핸들러를 가져 오는 solrconfig.xml을 수정, 나머지는 기본값입니다.

XML 파일을 구문 분석하고 XML 파일의 필드를 유형 문자열로 관리되는 스키마 파일에 자동으로 추가합니다. 사전 필드에서 text_general을 입력 할 때 예상대로 작동하기 시작했습니다.

나는 어떻게 이런 식으로 작동하는지 볼 수는 없지만 다른 변경은하지 않았습니다. 내 핵심을 삭제하고 실수로 시작하지 않았는지 확인하기 위해 처음부터 시작했지만 효과가있었습니다.