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 satya swaroop <sa...@gmail.com> on 2011/01/11 10:37:07 UTC

spell suggest response

Hi All,
         can we get just suggestions only without the files response??
Here I state an example
when i query
    http://localhost:8080/solr/spellcheckCompRH?q=java daka
usar&spellcheck=true&spellcheck.count=5&spellcheck.collate=true

i get some result of java files and then the suggestions for the words
daka-data , usar-user. But actually i need only the spell suggestions.
But here time is getting consumed for displaying of files and then giving
spell suggestions. Cant we post a query to solr where we can get
the response as only spell suggestions???

Regards,
satya

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi Grijesh,
            i added both the termscomponent and spellcheck component to the
terms requesthandler, when i send a query as
http://localhost:8080/solr/terms?terms.fl=text&terms.prefix=java&&rows=7&omitHeader=true&spellcheck=true&spellcheck.q=java&spellcheck.count=20

the result i get is
<response>
-
<lst name="terms">
-
<lst name="text">
<int name="java">6</int>
<int name="javabas">6</int>
<int name="javas">6</int>
<int name="javascript">6</int>
<int name="javac">6</int>
<int name="javax">6</int>
</lst>
</lst>
-
<lst name="spellcheck">
<lst name="suggestions"/>
</lst>
</response>



when i send this
http://localhost:8080/solr/terms?terms.fl=text&terms.prefix=jawa&&rows=5&omitHeader=true&spellcheck=true&spellcheck.q=jawa&spellcheck.count=20
i get the result as

<response>
-
<lst name="terms">
<lst name="text"/>
</lst>
-
<lst name="spellcheck">
-
<lst name="suggestions">
-
<lst name="jawa">
int name="numFound">20</int>
<int name="startOffset">0</int>
<int name="endOffset">4</int>
-
<arr name="suggestion">
<str>java</str>
<str>away</str>
<str>jav</str>
<str>jar</str>
<str>ara</str>
<str>apa</str>
<str>ana</str>
<str>ajax</str>


Now i need to know how to make ordering of the terms as in the 1st query the
result obtained is inorder and i want only javax, javac,javascript but not
javas,javabas.... how can it be done??

Regards,
satya

Re: spell suggest response

Posted by Grijesh <pi...@gmail.com>.
Hi Satya,

In this example you are not using spellchecking .I am saying use spellcheck
component also with Terms component so it will give you the spellcheck
suggestion also. Then combined both the lists.

-----
Thanx:
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spell-suggest-response-tp2233409p2271114.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi Grijesh,
               Though i use autosuggest i maynot get the exact results, the
order is not accurate.. As for example if i type
http://localhost:8080/solr/terms/?terms.fl=spell&terms.prefix=solr&terms.sort=index&terms.lower=solr&terms.upper.incl=true
                             i get results as...
solr
solr.amp
solr.datefield
solr.p
solr.pdf
   like that.But this may not lead to getting accurate results as we get in
spellchecking,

i require suggestions for any word irrespective of whether it is correct or
not, is there anything to be changed in solr to get suggestions as we get
when we type a wrong word in spellchecking... If so please let me know...

Regards,
satya

Re: spell suggest response

Posted by Grijesh <pi...@gmail.com>.
I have configured a request handled for autosuggest (used term component for
autosuggest) with last component as spellcheck component.

and query with terms.prefix and spellcheck=true

It gives the output from terms component and also output from spellchek
component
exact handler configuration currently don't have 


-----
Thanx:
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spell-suggest-response-tp2233409p2270743.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi Grijesh,
                As you said you are implementing this type. Can you tell how
did you made in brief..

Regards,
satya

Re: spell suggest response

Posted by Grijesh <pi...@gmail.com>.
I have Not implemented on any public site .
I just seen the auto-suggest list of google which have the lists containing
both auto-suggest and spell-check

Like just type on google "jave"
it will give the suggestion 

java script
java se
jave staffing
java string
jave s 

So i was trying to implement that type of combined autusuggest with
containing correct words.
So I used both spellcheck components with any of autosuggest implementation
(used terms or NGramFilter) 
And got the both suggestion autosuggest and correct words from spellcheck
component

-----
Thanx:
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spell-suggest-response-tp2233409p2270669.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: spell suggest response

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

Sounds interesting.  Do you have an example of this on some public site that one 
could see?
I'm mainly curious and want to see how it compares to auto-complete on 
http://search-lucene.com for example.

Thanks,
Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/



----- Original Message ----
> From: Grijesh.singh <pi...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Thu, January 13, 2011 5:39:53 AM
> Subject: Re: spell suggest response
> 
> 
> Similar type of work I have done earlier by using spell-check component  with
> auto-suggest combined.
> 
> Autosuggest will provide the words  starting with query term and spellcheck
> returns the words similar to  that.
> I have combined both suggestion in single list to  display
> 
> -----
> Grijesh
> -- 
> View this message in context: 
>http://lucene.472066.n3.nabble.com/spell-suggest-response-tp2233409p2247479.html
> Sent  from the Solr - User mailing list archive at Nabble.com.
> 

Re: spell suggest response

Posted by "Grijesh.singh" <pi...@gmail.com>.
Similar type of work I have done earlier by using spell-check component with
auto-suggest combined.

Autosuggest will provide the words starting with query term and spellcheck
returns the words similar to that.
I have combined both suggestion in single list to display

-----
Grijesh
-- 
View this message in context: http://lucene.472066.n3.nabble.com/spell-suggest-response-tp2233409p2247479.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi Juan,
             yeah.. i tried of onlyMorePopular and got some results but are
not similar words or near words to the word i have given in the query..
Here i state you the output..

http://localhost:8080/solr/spellcheckCompRH?q=java&rows=0&spellcheck=true&spellcheck.collate=true&spellcheck.onlyMorePopular=true&spellcheck.count=20

the o/p i get is
-<arr name="suggestion">
<str>data</str>
<str>have</str>
<str>can</str>
<str>any</str>
<str>all</str>
<str>has</str>
<str>each</str>
<str>part</str>
<str>make</str>
<str>than</str>
<str>also</str>
</arr>



but this words are not similar to the given word 'java'.... the near words
would be javac,javax,data,java.io... etc.., the stated words are present in
the index..


Regards,
satya

Re: spell suggest response

Posted by Juan Grande <ju...@gmail.com>.
It isn't exactly what you want, but did you try with the "onlyMorePopular"
parameter?

http://wiki.apache.org/solr/SpellCheckComponent#spellcheck.onlyMorePopular

Regards,

Juan Grande

On Wed, Jan 12, 2011 at 7:29 AM, satya swaroop <sa...@gmail.com>wrote:

> Hi stefan,
>            I need the words from the index record itself. If java is given
> then the relevant or similar or near words in the index should be shown.
> Even the given keyword is true... can it be possible???
>
>
> ex:-
>
>
> http://localhost:8080/solr/spellcheckCompRH?q=java&rows=0&spellcheck=true&spellcheck.count=10
>                           In the o/p the suggestions will not be coming as
> java is a word that spelt correctly...
>           But cant we get near suggestions as javax,javac....etc.., ???(the
> terms in the index)
>
> I read  about  suggester in solr wiki at
> http://wiki.apache.org/solr/Suggester . But i tried to implement it but
> got
> errors as
>
> *error loading class org.apache.solr.spelling.suggest.suggester*
>
> Regards,
> satya
>

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi stefan,
            I need the words from the index record itself. If java is given
then the relevant or similar or near words in the index should be shown.
Even the given keyword is true... can it be possible???


ex:-

http://localhost:8080/solr/spellcheckCompRH?q=java&rows=0&spellcheck=true&spellcheck.count=10
                           In the o/p the suggestions will not be coming as
java is a word that spelt correctly...
          But cant we get near suggestions as javax,javac....etc.., ???(the
terms in the index)

I read  about  suggester in solr wiki at
http://wiki.apache.org/solr/Suggester . But i tried to implement it but got
errors as

*error loading class org.apache.solr.spelling.suggest.suggester*

Regards,
satya

Re: spell suggest response

Posted by Stefan Matheis <ma...@googlemail.com>.
satya,

nice to hear, that it work's :)

on your question to similar words: i would say no - suggestions are only
generated based on available records, and afaik only if the given
word/phrase is misspelled. Perhaps MoreLikeThis could help you, but not sure
on this - especially because you're talking about single words and not
similar documents :/

Stefan

On Wed, Jan 12, 2011 at 6:14 AM, satya swaroop <sa...@gmail.com>wrote:

> Hi Stefan,
>          Ya it works :)..... Thanks...
>          But i have a question... can it be done only getting spell
> suggestions even if the spelled word is correct... I mean near words to
> it...
>           ex:-
>
>
> http://localhost:8080/solr/spellcheckCompRH?q=java&rows=0&spellcheck=true&spellcheck.count=10
>                           In the o/p the suggestions will not be coming as
> java is a word that spelt correctly...
>          But cant we get near suggestions as javax,javac....etc.., ???
>
> Regards,
> satya
>

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi Stefan,
          Ya it works :)..... Thanks...
          But i have a question... can it be done only getting spell
suggestions even if the spelled word is correct... I mean near words to
it...
           ex:-

http://localhost:8080/solr/spellcheckCompRH?q=java&rows=0&spellcheck=true&spellcheck.count=10
                           In the o/p the suggestions will not be coming as
java is a word that spelt correctly...
          But cant we get near suggestions as javax,javac....etc.., ???

Regards,
satya

Re: spell suggest response

Posted by Stefan Matheis <ma...@googlemail.com>.
Satya,

what about rows=0 .. if i got i correct .. :)

Regards
Stefan

On Tue, Jan 11, 2011 at 1:19 PM, satya swaroop <sa...@gmail.com>wrote:

> Hi Gora,
>           I am using solr for file indexing and searching, But i have a
> module where i dont need any files result but only the spell suggestions,
> so
> i asked is der anyway in solr where i would get the spell suggestion
> responses only.. I think it is clear for u now.. If not tell me I will try
> to explain still furthur...
>
> Regards,
> satya
>

Re: spell suggest response

Posted by satya swaroop <sa...@gmail.com>.
Hi Gora,
           I am using solr for file indexing and searching, But i have a
module where i dont need any files result but only the spell suggestions, so
i asked is der anyway in solr where i would get the spell suggestion
responses only.. I think it is clear for u now.. If not tell me I will try
to explain still furthur...

Regards,
satya

Re: spell suggest response

Posted by Gora Mohanty <go...@mimirtech.com>.
On Tue, Jan 11, 2011 at 3:07 PM, satya swaroop <sa...@gmail.com> wrote:
> Hi All,
>         can we get just suggestions only without the files response??
> Here I state an example
> when i query
>    http://localhost:8080/solr/spellcheckCompRH?q=java daka
> usar&spellcheck=true&spellcheck.count=5&spellcheck.collate=true
>
> i get some result of java files and then the suggestions for the words
> daka-data , usar-user. But actually i need only the spell suggestions.
> But here time is getting consumed for displaying of files and then giving
> spell suggestions. Cant we post a query to solr where we can get
> the response as only spell suggestions???
[...]

Not sure why you would want to use Solr for this. I would suggest
using the LGPL aspell library. As aspell exposes a C interface, Java
bindings can be created with SWIG, if needed.

Regards,
Gora