We don't track of the maximum position per doc. One way to do ends-with queries would be to write a token filter that emits a special token at the end of the wrapped token stream and use it as the last token of a phrase query.
On Thu, Mar 21, 2019 at 1:29 PM Michael Sokolov <msoko...@gmail.com> wrote: > > Hi, if I want to write a begins-with, ends-with, or exact-match style > query; like a phrase query, but anchored to the beginning of a field, the > end, or both, is there a generally-accepted best way? I can see how to > maybe create a positional query that specifies the exact position for each > term (at least in theory -- I'm not sure if there is a Query that does > this?) but do we keep track of max(position, field, doc) so I can know that > there are not any subsequent terms in the field? > > -Mike -- Adrien --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org