'string' type field with 'keyword' analyzed field is failing on query

Elasticsearch Version: 2.4
Language: Python 2.7
Current default mapping for field called 'domain' which signified domain-name of a web site.

 "domain": {
            "type": "string",
            "analyzer": "keyword"
    }

Lets suppose I have three documents with this field value as specified below

  1. "domain": "sp-abcd.com"
  2. "domain": "hk-abcd.com"
  3. "domain": "abcd.com"

Now I made a search query DSL

from elasticsearch_dsl import Search
search_query = Search()
search_query = search_query.query('match_phrase', domain='abcd.com')
results = search_query.execute()

Now I am getting all the three documents rather than getting only third document as stated in example. I have used 'term' query filter as well but no luck
Any thoughts how I can achieve this preferably making better search_queries.

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