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 Rupert Fiasco <ru...@gmail.com> on 2009/02/06 20:47:19 UTC

Issuing just a spell check query

The docs for the SpellCheckComponent say

"The SpellCheckComponent is designed to provide inline spell checking
of queries without having to issue separate requests."

I would like to issue just a spell check query, I dont care about it
being inline and piggy-backing off a normal search query.

How would I achieve this?

I tried monkeying with making a new requestHandler but using class =
"solr.SearchHandler" always tries to do a normal search.

I succeeded in adding inline spell checking to the default request
handler by *adding*

     <arr name="last-components">
       <str>spellcheck</str>
     </arr>

to its requestHandler config - I would like to *remove* the default
search component - maybe by making a new request handler which just
does spell checking?

Is something like this possible?



  <requestHandler name="/spellcheck" class="solr.SearchHandler">
    <!-- default values for query parameters -->
     <lst name="defaults">
        <str name="spellcheck.count">5</str>
     </lst>

     <arr name="first-components">
       <str>spellcheck</str>
     </arr>

     <!-- remove default search component -->
     <arr name="remove-components">
       <str>default</str>
     </arr>

  </requestHandler>





Now, I can sort of achieve what I want by in fact a normal search but
then using a dummy value for my "q" parameter (for me "00000000000000"
works) and then I get no search docs back, but I do get the spell
suggestions I want, driven by the "spellcheck.q" parameter.

But this seems very hacky and Solr is still having to run a search
against my dummy value.

A roundabout way of asking: how can I fire off *just* a spell check query?

Thanks in advance
-Rupert

Re: Issuing just a spell check query

Posted by Grant Ingersoll <gs...@apache.org>.
On Feb 12, 2009, at 8:37 PM, Chris Hostetter wrote:

>
> : > A roundabout way of asking: how can I fire off *just* a spell  
> check query?
>
> : I don't think it is possible with SpellCheckComponent. But note  
> that only

It's possible:  http://wiki.apache.org/solr/SpellCheckComponent#head-e8bab117a0af711723b935b83da381ad2f67983c

Although, the QueryComponent might balk at their not being a q  
specified if you are using the /select.  I committed a fix for this a  
few days ago that now lets one turn off the QueryComponent by issuing  
query=false (it's on by default), but you would need trunk for that.

Of course, you can also do what Hoss suggests.


>
>
> maybe i'm missing something, but why can't you just say...
>
>  <requestHandler name="/spellCheckCompRH" class="solr.SearchHandler">
>    <arr name="components">
>      <str>spellcheck</str>
>    </arr>
>  </requestHandler>
>
>
> ...i havne't tried it, but there's no reason i know of for
> SpellcheckComponent to be dependent on QueryComponent, so it should  
> work.
>
> if it doesn't that seems like a bug.
>
>
>
>
> -Hoss
>


Re: Issuing just a spell check query

Posted by Chris Hostetter <ho...@fucit.org>.
: > A roundabout way of asking: how can I fire off *just* a spell check query?

: I don't think it is possible with SpellCheckComponent. But note that only

maybe i'm missing something, but why can't you just say...

  <requestHandler name="/spellCheckCompRH" class="solr.SearchHandler">
    <arr name="components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>


...i havne't tried it, but there's no reason i know of for 
SpellcheckComponent to be dependent on QueryComponent, so it should work.

if it doesn't that seems like a bug.




-Hoss


Re: Issuing just a spell check query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sat, Feb 7, 2009 at 1:17 AM, Rupert Fiasco <ru...@gmail.com> wrote:

>
> I would like to issue just a spell check query, I dont care about it
> being inline and piggy-backing off a normal search query.
>
> How would I achieve this?
>
> Now, I can sort of achieve what I want by in fact a normal search but
> then using a dummy value for my "q" parameter (for me "00000000000000"
> works) and then I get no search docs back, but I do get the spell
> suggestions I want, driven by the "spellcheck.q" parameter.
>
> But this seems very hacky and Solr is still having to run a search
> against my dummy value.
>
> A roundabout way of asking: how can I fire off *just* a spell check query?


I don't think it is possible with SpellCheckComponent. But note that only
the first search pays the price, if you don't change (q, sort, rows, count)
then subsequent queries hit the cache.

So I'd suggest you search for a dummy value (or *:*), make
fl=<your_unique_key> (for minimal payload) and ignore the documents
returned.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Issuing just a spell check query

Posted by Rupert Fiasco <ru...@gmail.com>.
But its deprecated (??)

-Rupert

On Fri, Feb 6, 2009 at 11:51 AM, Otis Gospodnetic
<ot...@yahoo.com> wrote:
> Rupert,
>
> You could use the SpellCheck*Handler* to achieve this.
>
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>
>
>
> ________________________________
> From: Rupert Fiasco <ru...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Friday, February 6, 2009 2:47:19 PM
> Subject: Issuing just a spell check query
>
> The docs for the SpellCheckComponent say
>
> "The SpellCheckComponent is designed to provide inline spell checking
> of queries without having to issue separate requests."
>
> I would like to issue just a spell check query, I dont care about it
> being inline and piggy-backing off a normal search query.
>
> How would I achieve this?
>
> I tried monkeying with making a new requestHandler but using class =
> "solr.SearchHandler" always tries to do a normal search.
>
> I succeeded in adding inline spell checking to the default request
> handler by *adding*
>
>     <arr name="last-components">
>       <str>spellcheck</str>
>     </arr>
>
> to its requestHandler config - I would like to *remove* the default
> search component - maybe by making a new request handler which just
> does spell checking?
>
> Is something like this possible?
>
>
>
>  <requestHandler name="/spellcheck" class="solr.SearchHandler">
>    <!-- default values for query parameters -->
>     <lst name="defaults">
>        <str name="spellcheck.count">5</str>
>     </lst>
>
>     <arr name="first-components">
>       <str>spellcheck</str>
>     </arr>
>
>     <!-- remove default search component -->
>     <arr name="remove-components">
>       <str>default</str>
>     </arr>
>
>  </requestHandler>
>
>
>
>
>
> Now, I can sort of achieve what I want by in fact a normal search but
> then using a dummy value for my "q" parameter (for me "00000000000000"
> works) and then I get no search docs back, but I do get the spell
> suggestions I want, driven by the "spellcheck.q" parameter.
>
> But this seems very hacky and Solr is still having to run a search
> against my dummy value.
>
> A roundabout way of asking: how can I fire off *just* a spell check query?
>
> Thanks in advance
> -Rupert
>

Re: Issuing just a spell check query

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Rupert,

You could use the SpellCheck*Handler* to achieve this.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch




________________________________
From: Rupert Fiasco <ru...@gmail.com>
To: solr-user@lucene.apache.org
Sent: Friday, February 6, 2009 2:47:19 PM
Subject: Issuing just a spell check query

The docs for the SpellCheckComponent say

"The SpellCheckComponent is designed to provide inline spell checking
of queries without having to issue separate requests."

I would like to issue just a spell check query, I dont care about it
being inline and piggy-backing off a normal search query.

How would I achieve this?

I tried monkeying with making a new requestHandler but using class =
"solr.SearchHandler" always tries to do a normal search.

I succeeded in adding inline spell checking to the default request
handler by *adding*

     <arr name="last-components">
       <str>spellcheck</str>
     </arr>

to its requestHandler config - I would like to *remove* the default
search component - maybe by making a new request handler which just
does spell checking?

Is something like this possible?



  <requestHandler name="/spellcheck" class="solr.SearchHandler">
    <!-- default values for query parameters -->
     <lst name="defaults">
        <str name="spellcheck.count">5</str>
     </lst>

     <arr name="first-components">
       <str>spellcheck</str>
     </arr>

     <!-- remove default search component -->
     <arr name="remove-components">
       <str>default</str>
     </arr>

  </requestHandler>





Now, I can sort of achieve what I want by in fact a normal search but
then using a dummy value for my "q" parameter (for me "00000000000000"
works) and then I get no search docs back, but I do get the spell
suggestions I want, driven by the "spellcheck.q" parameter.

But this seems very hacky and Solr is still having to run a search
against my dummy value.

A roundabout way of asking: how can I fire off *just* a spell check query?

Thanks in advance
-Rupert