[Xapian-discuss] Adding spell correction

Frank J Bruzzaniti frank.bruzzaniti at gmail.com
Wed Mar 25 13:48:24 GMT 2009


Olly Betts wrote:
> On Wed, Mar 25, 2009 at 12:22:08PM +1030, Frank J Bruzzaniti wrote:
>   
>> I'm using omega with a custom php front end (I've already added 
>> XapianQueryParser::FLAG_SPELLING_CORRECTION).
>>     
>
> There are patches for omega and scriptindex here:
>
> http://trac.xapian.org/ticket/296
>
> No patch for omindex yet, or documentation updates.  If you have patches
> for either, please attach to the ticket.
>
> Cheers,
>     Olly
>
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>   
I'm using PHP as the front end for my searches. Not sure if that means 
the patches will work for me.

I have this in my PHP code:

$query = $qp->parse_query( $query_string ,
            XapianQueryParser::FLAG_PHRASE
            | XapianQueryParser::FLAG_BOOLEAN
            | XapianQueryParser::FLAG_LOVEHATE
            | XapianQueryParser::FLAG_SPELLING_CORRECTION
        );

print 'Spelling Correction: '.$qp->get_corrected_query_string().'<br />';

Not sure what else I need to change.

I checked out the doco here:
http://xapian.org/docs/spelling.html

But also found this email which seems to have some extra information but 
I'm not sure what files to alter:
http://lists.tartarus.org/pipermail/xapian-discuss/2009-March/006469.html

Frank





More information about the Xapian-discuss mailing list