Considering Lucene level every term in the document field is attributed by
positions (if you don't omit them) i.e. your document looks like ["red"@0,
"redder"@1, "reddest"@2,"yellow"@3, "blue"@4]
pls check the info PhraseQuery, SpanQueries and positionIncrementGap.
I have an experience of obtaining
If a query matches one or more values of a multivalued field, is it
possible to get the indexes back for WHICH values? For example, for a
document with a multivalue field having ["red", "redder", "reddest",
"yellow", "blue"] as its value, if "red" is the query, could we know that
values 0,1, and 2