Query needed for ensuring position of word

Is there a way to form the query which will ensure the position of the word while matching ?

Example:
Indexed phrase is "Dark of the moon" (Standard analyzed, no stopword filter)
I should have a query where in i should be able to match below:
"Dark x y z"
"Dark x y moon"
"x y z moon"

Summing it up: I should be able to check position of the word given any input.

Available from v 7.0 Interval queries will allow fine-grained control over the order and proximity of matching terms.
In the versions 6.x, you can take advantage of Span queries. For example, Span First Query matches at the beginning of the field.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.