[Xapian-discuss] xapian 1.0.0 / 1.0.1 fatal problem

Olly Betts olly at survex.com
Wed Jun 13 00:22:43 BST 2007


It's hard to follow if you top-post when you reply, especially if you
then reply to yourself repeatedly!

Alexander Lind:
> >>The difference is demonstrated by the last print statement. With 
> >>0.9.x, it prints:
> >>/Performing query `Xapian::Query(love)'/
> >>
> >>With 1.0.x it prints
> >>/Performing query `Xapian::Query(Zlove)'
> >>
> >>/There is probably a good reason for this new behavior, but it did 
> >>have me scratching my head for a while :)  Is it supposed to be like 
> >>this, or is it a bug?

It is supposed to be like that.  There's rationale for the various
changes here:

http://www.xapian.org/docs/termgenerator.html

> >>In the new simplesearch.php5 example, the query object is created 
> >>like so:
> >>
> >>$query = new XapianQuery(XapianQuery::OP_OR, $terms);

In 1.0.0, but not in 1.0.1 - there the simple examples have all been
updated to use QueryParser and TermGenerator, since (a) that's simpler
and (b) it's what most users are likely to want to do.

> And I just figured out its this particular line that causes the Z prefix 
> to appear in the description:
> 
> $query_parser->set_stemming_strategy(QueryParser_STEM_ALL);
> 
> So I should probably stem differently I take it.

The expectation is that from now on, most people will index text with
(the new class) Xapian::TermGenerator, and parse query strings with
Xapian::QueryParser.  Hence QueryParser works with terms as produced by
TermGenerator.

I guess all your terms are stemmed and have no prefix?  I'm certainly
happy to have QueryParser configurable to support other sensible
"stemming strategies" provided the code remains maintainable, and
"STEM_ALL but with no Z prefixes" seems suitable.

Cheers,
    Olly



More information about the Xapian-discuss mailing list