[Xapian-discuss] Different query parsing in v0.9.9 and v1.0.5

Olly Betts olly at survex.com
Fri Apr 18 06:26:37 BST 2008


On Fri, Apr 18, 2008 at 07:06:59AM +0200, Lars Kruse wrote:
> I am using the python bindings for xapian in a debian system (python 2.4).
> 
> I just noticed, that the following returns different queries for different
> versions of xapian:
>  xapian.QueryParser().parse_query("field_2").get_description()
> 
> The result for xapian v0.9.9:
>  'Xapian::Query((field:(pos=1) PHRASE 2 2:(pos=2)))'
> (the query string is splitted into tokens)
> 
> The result for xapian v1.0.5:
>  'Xapian::Query(field_2:(pos=1))'
> (the query string stays the same)
> 
> Was there a change of default settings, that caused this change of behaviour?

Yes, "_" is now regarded as a word character by QueryParser and
TermGenerator (the latter is new in 1.0.0):

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

> I would like to implement a wrapper around v0.9 to mimick the behaviour of v1.0
> for this specific kind of query.
> Could anybody give me a hint, where to start?

I guess you'd have to write your own QueryParser alternative, or
backport the 1.0.x one somehow.

> (Debian stable (Etch) still ships v0.9.9 - thus I would like to keep
> backward-compatibility for the small feature set, that I am using.)

I'd suggest just installing the backported packages for 1.0.x from
xapian.org.

Cheers,
    Olly



More information about the Xapian-discuss mailing list