After an intensive trial-and-error phase I finally got it working with this configuration:

      <searchComponent name="suggest" class="solr.SuggestComponent">
        <lst name="suggester">
          <str name="name">mySuggester</str>
          <str name="lookupImpl">FuzzyLookupFactory</str>
          <str name="dictionaryImpl">HighFrequencyDictionaryFactory</str>
          <str name="storeDir">suggest</str>
          <float name="threshold">0.1</float>
          <str name="field">spellchk</str>
          <str name="suggestAnalyzerFieldType">textSpell</str>
          <str name="buildOnOptimize">true</str>
          <str name="buildOnStartup">true</str>
        </lst>
      </searchComponent>


However, to be honest, I still have no idea why this time it worked and the others did not. In order to learn for the next time, any clarifications would be highly appreciated.

Thanks!



El 03/04/2016 a las 12:10, Fundera Developer escribió:
After correcting some stupid mistakes, and adding all the parameters I have compiled from every example I found googling around, I have this configuration:

      <str name="name">mySuggester</str>
<str name="classname">org.apache.solr.spelling.suggest.Suggester</str> <str name="lookupImpl">org.apache.solr.spelling.suggest.jaspell.JaspellLookupFactory</str>
      <str name="field">spellchk</str>
      <float name="accuracy">0.1</float>
      <float name="threshold">0.0</float>
      <str name="storeDir">suggest</str>
      <str name="buildOnOptimize">true</str>
      <str name="buildOnStartup">true</str>

However, still no fuzzy suggestions  :-(

Any ideas?

Thanks in advance!!


El 03/04/2016 a las 11:47, Fundera Developer escribió:
Following on this, I have been able to make Solr load correctly by replacing the line in the solrconfig.xml:

   <str name="lookupImpl">JaspellLookupFactory</str>


with the fully qualified class name:

   <str
name="lookupImpl">org.apache.solr.spelling.suggest.jaspell.JaspellLookupFactory</str>


and now I can, as I said, start Solr, build the suggestions and run them. However, I am still getting nothing "fuzzy". If I query with "managem", I get several suggestions ("management" among them), but trying with "managm" or "manahem" does not provide any suggestions, even if I configure the accuracy parameter as low as 0.5 (and reindex, of course).

Am I doing something wrong? Is there any better alternative to getting fuzzy suggestions?

Thanks in advance!!



El 02/04/2016 a las 20:27, Fundera Developer escribió:
Hi all,

At present I am providing suggestions in my app with this configuration in my solrconfig.xml:

      <searchComponent name="suggest" class="solr.SuggestComponent">
        <lst name="suggester">
          <str name="name">mySuggester</str>
          <str name="lookupImpl">WFSTLookupFactory</str>
          <str name="field">spellchk</str>
          <float name="threshold">0.005</float>
          <str name="buildOnOptimize">true</str>
          <str name="buildOnStartup">true</str>
        </lst>
      </searchComponent>
      <requestHandler name="/suggest" class="solr.SearchHandler"
   startup="lazy" >
        <lst name="defaults">
          <str name="suggest">true</str>
          <str name="suggest.dictionary">mySuggester</str>
          <str name="suggest.count">5</str>
        </lst>
        <arr name="components">
           <str>suggest</str>
        </arr>
      </requestHandler>


However, I would like to provide fuzzy suggestions, so that if the user types "managme", I can suggest "management". Based on the documentation I found on the wiki and googling, I tried with this configuration:

      <searchComponent name="suggest" class="solr.SuggestComponent">
        <lst name="suggester">
          <str name="name">mySuggester</str>
          <str name="lookupImpl">JaspellLookupFactory</str>
          <str name="field">spellchk</str>
          <str name="accuracy">0.6</str>
          <str name="buildOnOptimize">true</str>
          <str name="buildOnStartup">true</str>
        </lst>
      </searchComponent>


But if I start my Solr instance with that configuration, I get this error in the log:

2016-04-02 18:24:26.018 ERROR (coreLoadExecutor-6-thread-1) [ x:funderatenders] o.a.s.c.CoreContainer Error creating core [myapp]:
   Error loading class 'JaspellLookupFactory'
   org.apache.solr.common.SolrException: Error loading class
   'JaspellLookupFactory'
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:820)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:658)
        at
org.apache.solr.core.CoreContainer.create(CoreContainer.java:814)
        at
org.apache.solr.core.CoreContainer.access$000(CoreContainer.java:87)
        at
org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:467)
        at
org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:458)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at
org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:231)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)


What is the correct way to use and configure the JaspellLookupFactory, or where can I find documentation on it?

Thanks in advance!
















Reply via email to