[Xapian-discuss] Making Spelling Suggestion/Correction Work!

Richard Boulton richard at lemurconsulting.com
Sat Jul 28 00:33:25 BST 2007


Benny Chan wrote:
> Hello All,
> 
> I have found solutions to my previous issues and have stumbled upon a new
> one. Spelling suggestion. I can't get it to work. I index my documents as
> usual, then I run this code in PHP:
> 
...

> 
> I type in mispelled words like "edcation" and "scool" but get nothing. The
> words "education" and "school" return results so I'm assuming those words
> are in the spelling database. However, I don't know. I just index documents
> as usual without manually creating a separate spelling database.

Yes, you need to add words to the spelling database explicitly.  You can 
use the WritableDatabase::add_spelling() method to do this, or the 
FLAG_SPELLING option of the termgenerator to do so.  I don't think 
scriptindex has support for adding spellings to the spelling correction 
database yet, though.

-- 
Richard



More information about the Xapian-discuss mailing list