저는 Solr을 처음 사용 했으므로 제목과 설명의 두 필드를 기반으로 자동 완성 기능을 구현하고 싶습니다. 또한 결과 집합은 id 및 category와 같은 다른 필드에 의해 더 제한되어야합니다. 샘플 데이터 :solr 여러 필드에서 키워드 자동 완성
Title: The brown fox lives in the woods
Description: The fox is found in the woods where brown leaves cover the ground. The animal's fur is brown in color and has a long tail.
원하는 자동 완성 결과 :
<fieldType name="autocomplete" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="25" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<field name="id" type="int" indexed="true" stored="true"/>
<field name="category" type="string" indexed="true" stored="true"/>
<field name="title" type="text_general" indexed="true" stored="true"/>
<field name="description" type="text_general" indexed="true" stored="true"/>
<field name="ac-terms" type="autocomplete" indexed="true" stored="false" multiValued="true" omitNorms="true" omitTermFreqAndPositions="false" />
<copyField source="title" dest="ac-terms"/>
<copyField source="description" dest="ac-terms"/>
쿼리 요청 :
http://localhost:9090/solr/select?q=(ac-terms:brown)
이 결과를 주문하는 방법이 있습니까? – lennard