Span Near Query is not working for me

I have below script to test span near query


curl -XPUT 'ourhost/xiaolongindexername/'

curl -XPUT 'ourhost/xiaolongindexername/xiaolongindexertype/1' -d '{

"company":"Safari Books Online"


#test match query to make sure index is inserted properly

curl -XGET 'ourhost/xiaolongindexername/xiaolongindexertype/_search' -d
'{"query": {"match":{"company":"safari"}}}'

curl -XGET 'ourhost/xiaolongindexername/xiaolongindexertype/_search' -d '{
"query": { "span_near" : {"clauses" : [ {"span_term" : {"company" :
"Safari"}}, {"span_term" : {"company" : "Books"}}, {"span_term" : {
"company" : "Online" } } ],"slop" : 100,"in_order" :
false,"collect_payloads" : false } } }'

I can get result for match query but not for span query.

Does anyone have any clue?



You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit