Solr Suggester 5.3不返回结果

时间:2015-12-17 12:12:06

标签: java php solr autosuggest

我正在尝试使用Solr 5.3.0实现自动完成功能

我的谢马:

<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="id" type="string" indexed="true"   stored="true" required="true" multiValued="false" />
<field name="type"    type="string"   indexed="true"  stored="true"  multiValued="false" />
<field name="name"    type="string"   indexed="true"  stored="true"  multiValued="false" />
<field name="isbn"    type="string"   indexed="true"  stored="true"  multiValued="false" />
<field name="title"    type="string"   indexed="true"  stored="true"  multiValued="false" />
<field name="year"    type="string"   indexed="true"  stored="true"  multiValued="false" />
<field name="pages"    type="int"   indexed="true"  stored="true"  multiValued="false" />
<field name="page"    type="int"   indexed="true"  stored="true"  multiValued="false" />
<field name="family"  type="string" indexed="true" stored="true" multiValued="false" />
<field name="text"    type="doctext"   indexed="true"  stored="true"  multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
<field name="alsearch"   type="string"   indexed="true"  stored="true"  multiValued="false" />

solrconfig.xml上的我的配置:

<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="storeDir">suggester_fuzzy_dir</str>>

<str name="dictionaryImpl">DocumentDictionaryFactory</str>

<str name="field">name</str>
<str name="suggestAnalyzerFieldType">string</str>
<str name="buildOnStartup">true</str>
<str name="buildOnCommit">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>
 <str name="suggest.dictionary">mySuggester</str>
</lst>
<arr name="components">
  <str>suggest</str>
</arr>

当我尝试: http://localhost:8983/solr/alsearch/suggest?suggest=true&suggest.build=true&suggest.dictionary=mySuggester&wt=xml&suggest.q=marketing

结果是:

<response><lst name="responseHeader"><int name="status">0</int><int name="QTime">2633</int></lst><str name="command">build</str><lst name="suggest"><lst name="mySuggester"><lst name="marketing"><int name="numFound">0</int><arr name="suggestions"/></lst></lst></lst></response>

出了什么问题?

0 个答案:

没有答案