[Xapian-discuss] Wildcards

Olly Betts olly at survex.com
Thu Feb 22 15:53:28 GMT 2007


On Thu, Feb 22, 2007 at 05:29:29PM +0530, Gupteshwar Joshi wrote:
> How could I enable the WILDCARDS in it ?
> I followed with the online manual which says  it is disabled by default
> there given some method to enable but I am not understood it properly
> where to make changes.

You need to pass extra flags to Xapian::QueryParser::parse_query().  For
PHP4:

    $queryparser->parse_query($string,
	QueryParser_FLAG_BOOLEAN|QueryParser_FLAG_PHRASE|QueryParser_FLAG_LOVEHATE|QueryParser_FLAG_WILDCARD);

And for PHP5:

    $queryparser->parse_query($string,
	XapianQueryParser::FLAG_BOOLEAN|XapianQueryParser::FLAG_PHRASE|XapianQueryParser::FLAG_LOVEHATE|XapianQueryParser::FLAG_WILDCARD);

The default flags are (currently) BOOLEAN, PHRASE, and LOVEHATE.  There
should be a shorthand for "the default flags", but there isn't
currently.

Cheers,
    Olly



More information about the Xapian-discuss mailing list