Hi Rene, On 03/17/2010 at 11:17 AM, Rene Hackl-Sommer wrote: > <SpanNot fieldName="MyField"> > <Include> > <!-- Gets all the matching spans within L_2 boundaries and includes > them --> > <SpanNot> > <Include> > <SpanNear slop="2147483647" inOrder="false" > > <SpanTerm>t293</SpanTerm> > <SpanTerm>t4979</SpanTerm> > </SpanNear> > </Include> > <Exclude> > <SpanTerm>L_2</SpanTerm> > </Exclude> > </SpanNot> > </Include> > <Exclude> > <!-- Gets all the matching spans from L_3 boundaries and excludes them > --> > <SpanNot> > <Include> > <SpanNear slop="2147483647" inOrder="false" > > <SpanTerm>t293</SpanTerm> > <SpanTerm>t4979</SpanTerm> > </SpanNear> > </Include> > <Exclude> > <SpanTerm>L_3</SpanTerm> > </Exclude> > </SpanNot> > </Exclude> > </SpanNot> > > Shouldn't this query only leave documents, where t293 and t4979 are in > the same L_2, but not within the same L_3?
I'm not sure what's wrong with the above (have you tried each of the two nested SpanNot clauses independently?), but here's another thing to try: <SpanNot> <Include> <SpanOr> <SpanNear slop="2147483647" inOrder="true"> <SpanTerm>t293</SpanTerm> <SpanTerm>L_3</SpanTerm> <SpanTerm>t4979</SpanTerm> </SpanNear> <SpanNear slop="2147483647" inOrder="true"> <SpanTerm>t4979</SpanTerm> <SpanTerm>L_3</SpanTerm> <SpanTerm>t293</SpanTerm> </SpanNear> <SpanOr> <Exclude> <SpanTerm>L_2</SpanTerm> </Exclude> </SpanNot> Steve --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org