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

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

2012-12-11 Thread Hasenberger, Josef
Hi, I wonder if there is a way to use a SpanQuery to find documents with fields that end with a certain term. Kind of the oppoisite of SpanFirstQuery, i.e. "SpanLastQuery", if you want. What I would like to do: Find terms that are at the end of a field. Example: Assume the following field conte