Re: Opposite of SpanFirstQuery - Searching for documents by last term in a field

2016-12-14 Thread Alan Woodward
I’ve done this before by appending a special token to text fields via a TokenFilter. It hasn’t caused a noticeable problem with term stats, and field:* still works because the token is only added if the document in question actually has data in that particular field. Alan Woodward www.flax.co.

Re: Opposite of SpanFirstQuery - Searching for documents by last term in a field

2016-12-13 Thread Trejkaz
On Wed, Dec 12, 2012 at 3:04 AM, Ian Lea wrote: > The javadoc for SpanFirstQuery says it is a special case of > SpanPositionRangeQuery so maybe you can use the latter directly, > although you might need to know the position of the last term which > might be a problem. > > Alternatives might includ

Re: Opposite of SpanFirstQuery - Searching for documents by last term in a field

2012-12-11 Thread Ian Lea
The javadoc for SpanFirstQuery says it is a special case of SpanPositionRangeQuery so maybe you can use the latter directly, although you might need to know the position of the last term which might be a problem. Alternatives might include reversing the terms and using SpanFirst or adding a specia