daevaorn / djapian

High level Xapian integration for Django
Other
6 stars 3 forks source link

Spelling suggestions #74

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, how to get spelling suggestion? For example, users may type a query 
with misspell, so query may produce results, but I want to warn user about 
misprint.
I used get_corrected_query_string(), but it do not correct the string if 
was found exact match by indexer.search.

Maby Xapian::Database::get_spelling_suggestion is what I need?

Original issue reported on code.google.com by and...@polyakov.name on 21 Aug 2009 at 8:21

GoogleCodeExporter commented 9 years ago
`get_spelling_suggestion` accepts only words. It cannot correct entire query 
string.
But you can split query to bits and pass them through `get_spelling_suggestion` 
and
then join together again. Try it out.

Original comment by daevaorn on 28 Aug 2009 at 11:53

GoogleCodeExporter commented 9 years ago
How do I do this using djapian? What is the path to `get_spelling_suggestion`?

Original comment by and...@polyakov.name on 28 Aug 2009 at 1:18

GoogleCodeExporter commented 9 years ago
There is no public interface but you can dig in like this: 

{{{
db = MyModel.indexer._db.open()
db.get_spelling_suggestion(word)
}}}

Original comment by daevaorn on 29 Aug 2009 at 8:50

GoogleCodeExporter commented 9 years ago

Original comment by daevaorn on 19 Sep 2009 at 9:18

GoogleCodeExporter commented 9 years ago

Original comment by daevaorn on 19 Sep 2009 at 9:44