[Xapian-discuss] Partial search on prefixed data

Olly Betts olly at survex.com
Tue Aug 31 15:52:50 BST 2010


On Mon, Aug 30, 2010 at 05:31:01PM +0200, Sean McCleary wrote:
> You guessed my problem.  Sorry; I don't feel too smart now.  :)

You needn't - this wasn't documented, or at least not in the API docs.  I've
now noted all the cases I can think of where FLAG_PARTIAL and FLAG_WILDCARD
aren't currently supported.

> One more question: Is there no way to combine FLAG_PARTIAL and FLAG_PHRASE?
> 
> In this same auto-complete, let's say I have two possible results:
> 
> The Difference Engine
> A World of Difference
> 
> When I type in "difference engine" _not_ as a phrase, then I get both of
> those in my results.
> 
> But if I do it as a phrase, it only seems to search whole words, so having
> entered "difference en" in the field gives me no results, even if
> FLAG_PARTIAL is turned on.  Do these two flags not work together?

Not currently.

OP_PHRASE only really supports simple terms as components of the phrase, so
a wildcard can't be used there.  This OP_PHRASE limitation could be removed
(all operators would need to be able to merge position lists of their
subqueries) but nobody has implemented that yet.

There's a little hack in the query handling which expands "A PHRASE (B OR C)"
to "(A PHRASE B) OR (A PHRASE C)", but that's likely to be unreasonably
expensive for the number of terms a wildcard can easy expand to, so we don't
let wildcards in a phrase use this feature.

Cheers,
    Olly



More information about the Xapian-discuss mailing list