[Xapian-discuss] searching with wildcards for special fields
Olly Betts
olly at survex.com
Tue Nov 15 21:20:34 GMT 2011
On Tue, Nov 15, 2011 at 04:16:58PM +0000, James Aylett wrote:
> On 15 Nov 2011, at 15:16, Websuche :: Felix Antonius Wilhelm Ostmann wrote:
>
> > Only for wildcards in the middle i currently have the problem, that i
> > want to build a <part1> PHRASE/100 <part2>, but i cannot get this to
> > work, but i think this is possible and i am only missing a thing :)
> > I use "query = xapian.Query(xapian.Query.OP_PHRASE, part1, part2)", how
> > can i add the /100 to that?
>
> Is this in python? Looks like a bug (I can't use the four parameter constructor either).
You can't do the equivalent in C++ - i.e. this won't compile:
Xapian::Query query(Xapian::query::OP_PHRASE, "part1", "part2", 100);
So I don't think it's a bug that it doesn't work in Python either. It
could be a feature request, but passing the subqueries in a tuple (or
other sequence) works, and naturally extends to more than two
subqueries, so I think that's better anyway:
>>> query = xapian.Query(xapian.Query.OP_PHRASE, ("part1", "part2"), 100)
>>> str(query)
'Xapian::Query((part1 PHRASE 100 part2))'
Cheers,
Olly
More information about the Xapian-discuss
mailing list