lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Hazari <rajeshhaz...@gmail.com>
Subject Re: Trying to get AnalyzingInfixSuggester to work in Solr?
Date Wed, 06 May 2015 18:59:28 GMT
I just tested your config with my schema and it worked.

my config :
  <searchComponent class="solr.SpellCheckComponent" name="suggest1">
    <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.fst.AnalyzingInfixLookupFactory</str>
      <str name="field">textSuggest</str>
      <float name="threshold">0.005</float>
      <str name="buildOnCommit">true</str>
          <str name="suggestAnalyzerFieldType">text_general</str>
          <bool name="exactMatchFirst">true</bool>
    </lst>
  </searchComponent>

<queryConverter name="queryConverter"
class="org.apache.solr.spelling.SuggestQueryConverter"/>

  <requestHandler class="org.apache.solr.handler.component.SearchHandler"
name="/suggest1">
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">suggest</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.collate">true</str>
    </lst>
    <arr name="components">
      <str>suggest1</str>
    </arr>
  </requestHandler>


http://localhost:8585/solr/collection1/suggest1?q=apple&rows=10&wt=json&indent=true

{
  "responseHeader":{
    "status":0,
    "QTime":2},
  "spellcheck":{
    "suggestions":[
      "apple",{
        "numFound":5,
        "startOffset":0,
        "endOffset":5,
        "suggestion":["<b>apple</b>",
          "<b>apple</b> and",
          "<b>apple</b> and facebook",
          "<b>apple</b> and facebook learn",
          "<b>apple</b> and facebook learn from"]},
      "collation","<b>apple</b>"]}}



*Rajesh**.*

On Wed, May 6, 2015 at 2:48 PM, Rajesh Hazari <rajeshhazari@gmail.com>
wrote:

> Just add the queryConverter definition in your solr config you should use
> see multiple term suggestions.
> and also make sure you have shingleFilterFactory as one of the filter in
> you schema field definitions for your field "text_general".
>
> <filter class="solr.ShingleFilterFactory" maxShingleSize="5"
> outputUnigrams="true"/>
>
>
> *Rajesh**.*
>
> On Wed, May 6, 2015 at 1:47 PM, O. Olson <olson_ord@yahoo.it> wrote:
>
>> Thank you Rajesh. I'm not familiar with the queryConverter. How do you
>> wire
>> it up to the rest of the setup? Right now, I just put it between the
>> SpellCheckComponent and the RequestHandler i.e. my config is as:
>>
>>     <searchComponent class="solr.SpellCheckComponent" name="suggest">
>>     <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.fst.AnalyzingInfixLookupFactory</str>
>>       <str name="field">text</str>
>>       <float name="threshold">0.005</float>
>>       <str name="buildOnCommit">true</str>
>>           <str name="suggestAnalyzerFieldType">text_general</str>
>>           <bool name="exactMatchFirst">true</bool>
>>     </lst>
>>   </searchComponent>
>>
>>   <queryConverter name="queryConverter"
>> class="org.apache.solr.spelling.SuggestQueryConverter"/>
>>
>>   <requestHandler class="org.apache.solr.handler.component.SearchHandler"
>> name="/suggest">
>>     <lst name="defaults">
>>       <str name="spellcheck">true</str>
>>       <str name="spellcheck.dictionary">suggest</str>
>>       <str name="spellcheck.onlyMorePopular">true</str>
>>       <str name="spellcheck.count">5</str>
>>       <str name="spellcheck.collate">true</str>
>>     </lst>
>>     <arr name="components">
>>       <str>suggest</str>
>>     </arr>
>>   </requestHandler>
>>
>>         Is this correct? I do not see any difference in my results i.e.
>> the
>> suggestions are the same as before.
>> O. O.
>>
>>
>>
>>
>>
>> Rajesh Hazari wrote
>> > make sure you have this query converter defined in your config
>> > <queryConverter name="queryConverter"
>> > class="org.apache.solr.spelling.SuggestQueryConverter"/>
>> > *Thanks,*
>> > *Rajesh**.*
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Trying-to-get-AnalyzingInfixSuggester-to-work-in-Solr-tp4204163p4204173.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message