Query needed for ensuring position of word


#1

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.


(Mayya Sharipova) #2

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.