2012-09-19 5 views
3

현재 Solr 3.6에서 Suggester를 작업 중입니다. 외부 사전 소스를 제공하여 Suggester를 구성했습니다.Suggester에서 대소 문자를 구분하는 법을 무시하는 방법? Solr 3.6

solrconfig.xml :

<searchComponent name="spellcheck" class="solr.SpellCheckComponent"> 

    <str name="queryAnalyzerFieldType">textSpell</str> 

    <lst name="spellchecker"> 
     <str name="name">suggest</str> 
     <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> 
     <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str> 
     <float name="threshold">0.005</float> 
     <str name="buildOnCommit">true</str> 
    <bool name="exactMatchFirst">true</bool> 
    <str name="sourceLocation">D:\source.txt</str> 

    </lst> 

    </searchComponent> 

Source.txt가 :

나는 "N"를 검색하기 위해 노력하고있어
nokia 2 
nokia 5233 3 
nokia 5130 2 
Symbian 1 
samsung 6712 2 
htc 2 
HTC Wild 6 
htc one 7 
Nokia 1280 5 

, 그 결과

nokia 5233 
nokia 5130 
nokia 

아래 나 제안 결과는 "Nokia 1280"에 포함되지 않습니다.

어떤 이유가있을 수 있습니까? Suggester에서 대소 문자를 구분하지 않으려면 어떻게해야하나요?

+0

당신은 어떤 분야에 대한 제안을 사용하고 있습니까? 그것의 타입과 schema.xml 부분을 보여주세요. – Mysterion

+0

그는 필드를 전혀 사용하지 않습니다. 그는 외부 사전 파일을 사용하고 있습니다. – waldol1

답변

1

나는 https://cwiki.apache.org/confluence/display/solr/Suggester

시도가 SUGGESTER에서 "필드"매개 변수를 사용하여,이 문서가 당신을 도울 것입니다 생각

<searchComponent name="spellcheck" class="solr.SpellCheckComponent"> 
     <str name="queryAnalyzerFieldType">textSpell</str> 
     <lst name="spellchecker"> 
      <str name="name">suggest</str> 
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> 
      <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str> 
      <float name="threshold">0.005</float> 
      <str name="buildOnCommit">true</str> 
      <bool name="exactMatchFirst">true</bool> 
      <str name="field">phoneName</str> 
      <str name="sourceLocation">D:\source.txt</str> 
     </lst> 
    </searchComponent> 

필드 유형 정의

<fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100"> 
     <analyzer> 
      <tokenizer class="solr.StandardTokenizerFactory"/> 
      <filter class="solr.StandardFilterFactory"/> 
      <filter class="solr.LowerCaseFilterFactory"/> 
     </analyzer> 
    </fieldType> 

필드 definetion

<field name="phoneName" type="string" indexed="true" stored="false" required="false" multiValued="false"/> 
관련 문제