0

I've got this problem that I can't solve. Partly because I can't explain it with the right terms. I'm new to this so sorry for this clumsy question.

Below you can see an overview of my goal.

I'm using Magento CE 1.7.0.2 & Solr 4.6.0.

Here you can see my goal..

my config.xml

  <searchComponent class="solr.SpellCheckComponent" name="suggester">
    <lst name="spellchecker">
      <str name="name">suggester</str>
      <str name="field">didyoumean</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookupFactory</str>
      <float name="threshold">0.005</float>
      <str name="buildOnCommit">true</str>
      <str name="spellcheckIndexDir">spellchecker</str>
    </lst> 
  </searchComponent>
  <requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggester">
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">suggester</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.count">10</str>
      <str name="spellcheck.collate">true</str>
    </lst>
    <arr name="components">
      <str>suggester</str>
    </arr>
  </requestHandler>

its working fine But the problem is its giving only one word suggestions...

If i'm searching for suggestions for this word me its giving the following suggestions,

http://127.0.0.1:8080/solr/collection1/suggester?q=me&wt=json&indent=true

{
  "responseHeader":{
    "status":0,
    "QTime":3},
  "spellcheck":{
    "suggestions":[
      "me",{
        "numFound":6,
        "startOffset":0,
        "endOffset":2,
        "suggestion":["men's",
          "mens",
          "mephisto",
          "men",
          "merrell",
          "mesh"]},
      "collation","men's"]}}

& now i'm searching for the suggestions with "adidas bla" that should give adidas black like this combination of 2 & more words suggestions also

Please check here once

here i'm getting the products, like that only i want to get the suggestions also i tried like this also but its not giving like that.

Any ideas ?

Community
  • 1
  • 1
Naresh
  • 681
  • 2
  • 12
  • 39

1 Answers1

0

Check solr API documentation.It has a 'term' handler that can be useful in your case.It can be used as solr_url/terms?q=abc.This will suggest you all the terms related to your query.For more information check this out http://wiki.apache.org/solr/TermsComponentSolr terms component

javacreed
  • 958
  • 1
  • 8
  • 20