Hi Dear Solr,

    I config the Solr to try to get search suggestion but seem not the 
suggestion that I want.

the follow search component and request handler:

<searchComponent name="suggest" class="solr.SuggestComponent">
  <lst name="suggester">
    <str name="name">mySuggester</str>
    <str name="lookupImpl">FuzzyLookupFactory</str>
    <str name="dictionaryImpl">DocumentDictionaryFactory</str>
    <str name="field">title</str>    // the contents is from "title"
    <str name="suggestAnalyzerFieldType">string</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>
<str name="suggest.dictionary">mySuggester</str>
  </lst>
  <arr name="components">
    <str>suggest</str>
  </arr>
</requestHandler>

http://localhost:8983/solr/articles/suggest?hl=on&suggest.build=true&suggest.dictionary=mySuggester&suggest.q=hello&suggest=true
 

the result is :
{
  "responseHeader":{
    "status":0,
    "QTime":14},
  "command":"build",
  "suggest":{"mySuggester":{
      "hello":{
        "numFound":3,
        "suggestions":[{
            "term":"hello every one, im rebot",    // the whole contents from 
field "title"
            "weight":0,
            "payload":""},
          {
            "term":"hello the autosuggest feature to satisfy two main 
requirements",   // the whole contents from field "title"
            "weight":0,
            "payload":""},
          {
            "term":"hello world, Im program",    // the whole contents from 
field "title"
            "weight":0,
            "payload":""}]}}}}

BUT the expected result should be phrase instead of the whole contents from the 
field "title" :
 
"suggestions":[{
            "term":"hello every one",  // expected result should be phrase like 
this
            "weight":0,
            "payload":""},
          {
            "term":"hello autosuggest",  // expected result should be phrase 
like this
            "weight":0,
            "payload":""},
          {
            "term":"hello world",  // expected result should be phrase like this
            "weight":0,
            "payload":""}]}}}}

So what is wrong? Did I config anything wrong?

thanks a lot for the help



Stiven.Zhou
stiven.z...@swisoft.cn 

Reply via email to