0
我正在使用solr 5.3
我的字符串是: - Anirudh,Ani,Aniket
當我輸入「Ani」時,它確實給了我所有上面的字符串。
但是當我輸入「ket」時,它不會給出任何結果。
預計: - 「Aniket」。
使用solr suggestor搜索中間或後綴字符串?
solrconfig.xml中
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">FreeTextLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">name</str>
<!-- <str name="weightField">price</str> -->
<str name="suggestAnalyzerFieldType">key_lower_case</str>
<str name="buildOnStartup">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler"
startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
Schema.xml的: -
<schema name='history' version='1.1'>
<types>
<fieldtype name='string' class='solr.StrField' />
<fieldtype name='long' class='solr.TrieLongField' />
<fieldType name="key_lower_case" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
</types>
<fields>
<field name='id' type='long' required='true' />
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name='user_id' type='string'/>
<field name='jsons' type='string' multiValued='true' />
<field name="row_type" type='string'/>
<field name='name' type='key_lower_case' indexed="true" stored="true" required='true'/>
<field name='composite_row-type_name' type='string'/>
<dynamicField name='*_string' type='string' multiValued='true' indexed='true' stored='true'/>
</fields>
<uniqueKey>composite_row-type_name</uniqueKey>
<solrQueryParser defaultOperator='OR' />
</schema>
歡迎您提出建議和意見。 在此先感謝。