You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by abhayd <aj...@hotmail.com> on 2010/10/28 14:48:03 UTC

spellcheck component does not work with request handler

I am using SOLR 1.3

I wanted to add spellcheck component to to standard request handler it so
did this
  <requestHandler name="standard" class="solr.SearchHandler" default="true">
    <!-- default values for query parameters -->
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <arr name="last-components">
      <str>spellcheck</str>
       </arr>
     </lst>
  </requestHandler>

but for some reason it does not return suggestion for misspelled words. For
instance iphole does not get a suggestion of iphone.
here is my query
http://localhost:10101/solr/core1/select?q=user_query:iphole&spellcheck=true&spellcheck.collate=true

At the same time when I added another request handler
 <requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
    <lst name="defaults">
      <!-- omp = Only More Popular -->
      <str name="spellcheck.onlyMorePopular">false</str>
      <!-- exr = Extended Results -->
      <str name="spellcheck.extendedResults">false</str>
      <!--  The number of suggestions to return -->
      <str name="spellcheck.count">1</str>
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>
it works fine and returns suggestion
here is my query
http://localhost:10101/solr/core1/spell?q=iphole&spellcheck=true&spellcheck.collate=true

Any thoughts why it is not working?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spellcheck-component-does-not-work-with-request-handler-tp1786079p1786079.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: spellcheck component does not work with request handler

Posted by abhayd <aj...@hotmail.com>.
hi thanks.. It worked.!!
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spellcheck-component-does-not-work-with-request-handler-tp1786079p1789163.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: spellcheck component does not work with request handler

Posted by "Dyer, James" <Ja...@ingrambook.com>.
In your "standard" Search Handler, you have the "last-components" array inside <lst name="defaults">.  However, it should be outside as in the "/spell" Search Handler.  Try this:

<requestHandler name="standard" class="solr.SearchHandler" default="true">
 <!-- default values for query parameters -->
 <lst name="defaults">
  <str name="echoParams">explicit</str>
 </lst>
 <arr name="last-components">
  <str>spellcheck</str>
 </arr>
</requestHandler>

James Dyer
E-Commerce Systems
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: abhayd [mailto:ajdabholkar@hotmail.com] 
Sent: Thursday, October 28, 2010 7:48 AM
To: solr-user@lucene.apache.org
Subject: spellcheck component does not work with request handler


I am using SOLR 1.3

I wanted to add spellcheck component to to standard request handler it so
did this
  <requestHandler name="standard" class="solr.SearchHandler" default="true">
    <!-- default values for query parameters -->
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <arr name="last-components">
      <str>spellcheck</str>
       </arr>
     </lst>
  </requestHandler>

but for some reason it does not return suggestion for misspelled words. For
instance iphole does not get a suggestion of iphone.
here is my query
http://localhost:10101/solr/core1/select?q=user_query:iphole&spellcheck=true&spellcheck.collate=true

At the same time when I added another request handler
 <requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
    <lst name="defaults">
      <!-- omp = Only More Popular -->
      <str name="spellcheck.onlyMorePopular">false</str>
      <!-- exr = Extended Results -->
      <str name="spellcheck.extendedResults">false</str>
      <!--  The number of suggestions to return -->
      <str name="spellcheck.count">1</str>
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>
it works fine and returns suggestion
here is my query
http://localhost:10101/solr/core1/spell?q=iphole&spellcheck=true&spellcheck.collate=true

Any thoughts why it is not working?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spellcheck-component-does-not-work-with-request-handler-tp1786079p1786079.html
Sent from the Solr - User mailing list archive at Nabble.com.