Reputation: 71
I am confused about the difference between these two queries. From the official document, my understanding is that both of these queries make a intersection of result Big and result Little. But if in this way, the final returned matches of these two are same.
Hope someone can give us an explanation of this, examples better.
Thanks
Upvotes: 0
Views: 436
Reputation: 217354
From the official documentation, SpanContainingQuery
will return...
...matching spans from
big
that contain matches fromlittle
whereas SpanWithinQuery
will return...
...matching spans from
little
that are enclosed withinbig
In clear, the former will keep matches that contain another Spans, while the latter will keep matches that are contained within another Spans.
You can find a few usage examples of both in the official Lucene test cases.
Upvotes: 2