NEAR non-leaf subqueries

Jean-Francois Dockes jf at dockes.org
Sat Jan 21 07:18:47 GMT 2017


Olly Betts writes:
 > >  > The code I pushed before wouldn't handle an OR of more than two things,
 > >  > so you couldn't do a 3+-way stem expansion:
 > >  > 
 > >  >     (text OR texts) NEAR (search OR searches OR searched OR searching)
 > >  > 
 > >  > But I've just pushed an update which will handle this.
 > > 
 > > Ok, I hadn't even noticed the limitation. Dit it silently truncated the
 > > OR list ?
 > 
 > It would throw Xapian::UnimplementedError.
 > 
 > > But, actually, so does the previous version (commit 389dfb319a66), which
 > > explains why I had not understood what the limitation was.
 > > 
 > > Both versions also work fine with "floor floor floor"p:
 > > 
 > > (floors OR flooring OR floored OR floor) NEAR 13
 > > (floors OR flooring OR floored OR floor) NEAR 13
 > > (floors OR flooring OR floored OR floor)
 > > 
 > > So: me happy but confused...
 > 
 > I suspect that at most two of those terms are present in any given
 > document in your database - the limitation was actually on the number of
 > terms returning positions together for the OR, not the number in the
 > query.

I can confirm, making sure that some documents have 3 different term
matches, the query triggers an exception with commit 389dfb319a66, but it
works fine with the latest orpositionlist branch.

Cheers,

jf



More information about the Xapian-discuss mailing list