Elasticsearch query_string exact match

Viewed 5646

I have an index containing field video with value 1.flv. If I do the following query:

"query": {
    "query_string": {
        "query": "2.flv"
    }
}

query still returns all records with 1.flv.

Can anyone point me to right solution?

Here is sample data returned for 1.flv (as you can see, nothing contains 2.flv!)

  "hits" : {
    "total" : 8,
    "max_score" : 0.625,
    "hits" : [ {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "_meta",
      "_score" : 0.625,
      "fields" : {
        "video" : "1.flv",
        "body" : "Really?"
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "0fYsYOTHT7O-7P6CVi7l3w",
      "_score" : 0.625,
      "fields" : {
        "video" : "1.flv",
        "body" : "fadsfasfas"
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "O9VjgFdmQra6hYxwMdGuTg",
      "_score" : 0.48553526,
      "fields" : {
        "video" : "1.flv",
        "body" : "Search is hard. Search should be easy."
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "A6k3FEKKSzKTSAVIT-4EbA",
      "_score" : 0.48553526,
      "fields" : {
        "video" : "1.flv",
        "body" : "Really?"
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "eFnnM4PrTSyW6wfxHWdE8A",
      "_score" : 0.48553526,
      "fields" : {
        "video" : "1.flv",
        "body" : "Hello!"
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "ZogAiyanQy6ddXA3o7tivg",
      "_score" : 0.48553526,
      "fields" : {
        "video" : "1.flv",
        "body" : "dcxvxc"
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "O0HcT7aGTrqKQxF25KsOwQ",
      "_score" : 0.37158427,
      "fields" : {
        "video" : "1.flv",
        "body" : "Hello!"
      }
    }, {
      "_index" : "videos",
      "_type" : "comment",
      "_id" : "l2d53OFITb-etooWEAI0_w",
      "_score" : 0.37158427,
      "fields" : {
        "video" : "1.flv",
        "body" : "dasdas"
      }
    } ]
  }
}
1 Answers
Related