[Xapian-devel] Composition of NEAR and OR

Jean-Francois Dockes jean-francois.dockes at wanadoo.fr
Wed Nov 15 20:24:55 GMT 2006

Olly Betts writes:
 > I'm not sure this flattening is really the best way to handle this -
 > fixing NearPostList to handle non-LeafPostLists would be more efficient
 > I think.  I think all that really needs is a PositionList subclass which
 > can return (in order) all the positions in any of a list of
 > PositionLists, which isn't too hard.

About the NearPostList code, I've tried to read phrasepostlist.cc, and
there is one thing at least which I don't understand, which is
how/when/whether the 'terms' postlists get positionned to the right
document before read_position_list() is called for each (in
phrasepostlist.cc, NearPostList::test_doc()). Which tends to indicate that
I'm not quite ready to write a new PositionList subclass...

 > However, you could try just returning from flatten_subqs if op isn't
 > OP_NEAR or OP_PHRASE and see if that does the job.  Calling
 > "get_description" on the restructured query should show if it worked
 > or not.

I'll try this tomorrow (and have another pass at trying to understand the
code now that I know it's not explicitely designed not to support this).

J.F. Dockes

More information about the Xapian-devel mailing list