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 Aleksey Gogolev <po...@dev.co.ua> on 2008/10/12 18:18:11 UTC
Question about solr spellcheck
Hello!
I use solr 1.3 and I have two questions about spellcheck.
I want to get search results and spelling suggestion for "Acer Aspire
one", so I perform this http query:
http://localhost:8983/solr/spellCheckCompRH?q=Acer+Aspire+one&version=2.2&start=0&rows=10&indent=on&wt=json&fl=*%2Cscore&hl=on&hl.fl=name,description&sort=price_uah+asc,score+desc&spellcheck=true&spellcheck.count=1&spellcheck.collate=true&spellcheck.onlyMorePopular=true
I got a bunch of docs, because spelling is OK. And also I got a
spelling suggestion: "acer spire one". The problem is that there are
no docs for query "acer spire one".
There are some docs for q=acer+one and there are docs for q=spire. But
there are no docs for q=acer+spire+one.
Is there a way to get only selling suggestions that produces at least
one doc?
Thank you for your attention.
--
Aleksey Gogolev
developer,
dev.co.ua
Aleksey
Re[2]: Question about solr spellcheck
Posted by Aleksey Gogolev <po...@dev.co.ua>.
Hello Grant,
GI> This came up the other day, too, see http://lucene.markmail.org/message/cnrrkw3d35wqxhzz?q=How+to+tokenize/analyze+docs+for+the+spellchecker
GI> .
GI> I think we could add this to the Lucene spellchecker, or at least to
GI> the SpellCheckComponent. rameshgalla, care to write up your code as a
GI> patch?
GI> Of course, then the question becomes would you want collated to go and
GI> check the various permutations until you come up with one that has hits?
GI> An alternative approach would be to add a component that transforms
GI> the query into what I call a backoff query, i.e. it converts AND to OR
The first solution sounds more suitable, but alternative approach is
also interestiong. Thanks for relpy.
--
Aleksey Gogolev
developer,
dev.co.ua
Aleksey mailto:postman@dev.co.ua
Re: Question about solr spellcheck
Posted by Grant Ingersoll <gs...@apache.org>.
This came up the other day, too, see http://lucene.markmail.org/message/cnrrkw3d35wqxhzz?q=How+to+tokenize/analyze+docs+for+the+spellchecker
.
I think we could add this to the Lucene spellchecker, or at least to
the SpellCheckComponent. rameshgalla, care to write up your code as a
patch?
Of course, then the question becomes would you want collated to go and
check the various permutations until you come up with one that has hits?
An alternative approach would be to add a component that transforms
the query into what I call a backoff query, i.e. it converts AND to OR
-Grant
On Oct 13, 2008, at 1:25 AM, rameshgalla wrote:
>
> Hi,
>
> I don't know there is better solution for this one. But I resolved
> this
> problem in my application like this.
> After getting the spell suggestion I have performed the search
> operation
> without displaying the results.
> If the numdocs is greater than or equal to one only I have displayed
> the
> spellcheck result. Otherwise don't display the spell check value.
> --
> View this message in context: http://www.nabble.com/Question-about-solr-spellcheck-tp19943116p19949041.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--------------------------
Grant Ingersoll
Lucene Boot Camp Training Nov. 3-4, 2008, ApacheCon US New Orleans.
http://www.lucenebootcamp.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ
Re[2]: Question about solr spellcheck
Posted by Aleksey Gogolev <po...@dev.co.ua>.
Hello rameshgalla,
Monday, October 13, 2008, 8:25:56 AM, you wrote:
r> Hi,
r> I don't know there is better solution for this one. But I resolved this
r> problem in my application like this.
r> After getting the spell suggestion I have performed the search operation
r> without displaying the results.
r> If the numdocs is greater than or equal to one only I have displayed the
r> spellcheck result. Otherwise don't display the spell check value.
Thanks. I also thought about this solution, but I hope that somebody
know more elegant way :)
--
Aleksey Gogolev
developer,
dev.co.ua
Aleksey mailto:postman@dev.co.ua
Re: Question about solr spellcheck
Posted by rameshgalla <ra...@cognizant.com>.
Hi,
I don't know there is better solution for this one. But I resolved this
problem in my application like this.
After getting the spell suggestion I have performed the search operation
without displaying the results.
If the numdocs is greater than or equal to one only I have displayed the
spellcheck result. Otherwise don't display the spell check value.
--
View this message in context: http://www.nabble.com/Question-about-solr-spellcheck-tp19943116p19949041.html
Sent from the Solr - User mailing list archive at Nabble.com.