[Xapian-discuss] Design-question/problem - boolean prefixes

Carsten Reimer carsten.reimer at galileo-press.de
Tue Sep 15 08:12:40 BST 2009


To all who replied in this thread,

thanks a lot for your help. It led me the right way in solving our 
problem here and to better understand how Xapian works.

We were able to solve the acalability issue of our application and 
probably we improved search püerformance as well.

So again thanks a lot.

With best regards

Carsten Reimer

John Leach schrieb:
> On Sun, 2009-08-30 at 06:25 +0100, Olly Betts wrote:
>> On Fri, Aug 28, 2009 at 01:23:01PM +0100, John Leach wrote:
>>> I believe that the most efficient way to do the query would actually be
>>> to use the OP_FILTER query on the book id term - not sure if you can do
>>> this via the query parser, so you'd have to build that yourself.
>> It's not so much "most efficient", as "avoiding the filter affecting the
>> weights".  To do this, add "book:" as a boolean filter, and then the
>> QueryParser will apply it for you using OP_FILTER - see:
>>
>> http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#ac4192166cf335462bbfa8f1f17a667c
> 
> Ah, I hadn't got around to understanding boolean prefixes yet, thanks
> Olly!
> 
> Carsten, if this isn't clear, at index time you'd need to add the book
> id term to every document with a prefix, say "XBOOKID", so the term for
> book 88 would be "XBOOKID88".
> 
> Then when setting up the query parser you'd do:
> 
> qp.add_boolean_prefix("book", "XBOOKID");
> 
> which would translate a query of "book:88" back into the term XBOOKID88
> (and use it as an OP_FILTER, as Olly stated).
> 
> John.
> 


-- 
Carsten Reimer
Web Developer
carsten.reimer at galileo-press.de
Phone +49.228.42150.73

Galileo Press GmbH
Rheinwerkallee 4 - 53227 Bonn - Germany
Phone +49.228.42150.0 (Zentrale) .77 (Fax)
http://www.galileo-press.de/

Managing Directors: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
HRB 8363 Amtsgericht Bonn




More information about the Xapian-discuss mailing list