[Xapian-discuss] constructing phrase queries

gervin23 gervin23 at fastmail.fm
Thu Sep 30 13:24:48 BST 2004


> What we really need to do is sort out the python bindings so 
 > you can just do:
> 
> terms = [ 'to', 'be', 'or', 'not', 'to', 'be' ]
> query = xapian.Query_from_list(xapian.Query.OP_PHRASE, terms)
> 
> Or for convenience, perhaps even just:
> 
> terms = [ 'to', 'be', 'or', 'not', 'to', 'be' ]
> query = xapian.Query_phrase(terms)

oh yeah, these statements are much more natural for python newcomers.

what i'm really trying to acomplish is something like the following 
(sidenote, i already have wildcarding worked out):

query for '"flight schedul*"' would result in:

(flight:(pos=1) PHRASE 2 schedule:(pos=2)) OR (flight:(pos=3) PHRASE 2 
scheduling:(pos=4))

or even better (but unsure if possible from syntax point-of-view):

(flight:(pos=1) PHRASE 2 (schedule:(pos=2) OR scheduling:(pos=2)))

andrew



More information about the Xapian-discuss mailing list