[Xapian-discuss] Contextual search via xapian

Richard Boulton richard at lemurconsulting.com
Tue Jul 15 15:22:55 BST 2008


Denis Kuzmenok wrote:
> Hi,
> i wonder is it possible to make contextual search via xapian?
> I tried with this way:
> index all keywords into 1 database with omega, structure like: name =>
> searchable,
> url
> 
> Then i put text into query i do search.
> But xapian find keywords which don't come in the same order as in
> text, like: today nokia reveals 6500 = nokia 6500, but i want to find
> any keywords in the same order as in text... NEAR is that i need, but
> it means AND FOLLOWED BY so all words must be founded :(
> Any suggestion?

If what you're looking for is simply an operator which matches words 
within a given window, and in a given order, you need the OP_PHRASE 
query operator.  See the documentation comment in 
xapian-core/include/xapian/query.h for details.

If that's not what you're looking for, perhaps you could give a piece of 
sample code / commands and data, which we can run, and the results you 
would like the code to produce.  We might then be able to tell you how 
to change your code to get the desired results.

-- 
Richard



More information about the Xapian-discuss mailing list