I want to use SpanNearQuery in my search request, i have set 'with_positions_offsets' to the 'term_vector' option of a text field property in mapping when i created a index .And then i indexed some docs to my
elasticsearch before i use SpanNearQuery to search my data.But it seems that the 'Slop' option of SpanNearQuery does not work ,the search result contains all matches data,no matter how far the distance between those words is.
Did I miss something?Or something wrong with my search way?
Could anybody please help me? I am so lucky if anybody can give me some ideas about this.I use the Nest client,the version of it is 2.0,And the version of elasticsearch is 2.2.0
Thank you !
I used a type=string field,and specified “search_analyzer”、“analyzer”、similarity”、“store”、“type” options for the Full-Text search field.
It is seems that the SpanNearQuery QueryContainer can not work together with FunctionScoreQuery.
Actually,I specified SpanNearQuery QueryContainer to the "Query" option of FunctionScoreQuery before i have some ideas on how to use SpanNearQuery.Then I found there was nothing related to SpanNearQuery in the JSON request to ES.So I got my Full-Text QueryContainer by SpanNearQuery only,and the two option "slop" and "inorder" worked.I am so amazing,but i still can not understand that how the "slop" option control the "span_term" clauses of SpanNearQuery.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.