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
- "domain": "sp-abcd.com"
- "domain": "hk-abcd.com"
- "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.