[Xapian-discuss] Xapian, PHP bindings and spellings correction

Bruno at Badiliz xapian at badiliz.fr
Tue Mar 3 12:42:12 GMT 2009


Hi Olly,

I'am sorry to say .... that you were right ! 
Excuse me to take your time because I forget to set the FLAG_SPELLING and
the database to my termGenerator during the indexation.
I just add this 2 lines and everything run exactly has it should : 
  $indexer->set_flags( XapianTermGenerator::FLAG_SPELLING );
  $indexer->set_database( $database );

One more time thank you for your help and your wonderfull work

Best regards, 
Bruno at Badiliz


-----Message d'origine-----
De : Olly Betts [mailto:olly at survex.com] 
Envoyé : mardi 3 mars 2009 12:49
À : Bruno at Badiliz
Cc : xapian-discuss at lists.xapian.org
Objet : Re: [Xapian-discuss] Xapian, PHP bindings and spellings correction

On Tue, Mar 03, 2009 at 11:23:31AM +0000, Bruno at Badiliz wrote:
> Even with this code, get_corrected_query_string()does not return any words
even
> with a misspell word "chaussuire"  in a database of 40000 doc and 436 doc
which
> contain "chaussure" without the "i" !!!

I suspect you haven't added any spellings to your database.

You can either do this from the text being indexed (if using
TermGenerator, then set FLAG_SPELLING to do it automatically:
http://xapian.org/docs/apidoc/html/classXapian_1_1TermGenerator.html )
or add spellings from a dictionary (using WritableDatabase::add_spelling():
http://xapian.org/docs/apidoc/html/classXapian_1_1WritableDatabase.html )
or both if you wish.

Cheers,
    Olly




More information about the Xapian-discuss mailing list