I have data in my Elasticsearch with a field
PUT /logs/visited_domains/1
{
"visited_domain":"microsoft.com"
}
PUT /logs/visited_domains/2
{
"visited_domain":"not-microsoft.com"
}
The mapping is:
{
"properties": {
"visited_domain": {
"type": "string",
"index": "not_analyzed"
}
}
}
When I do an ElasticSearch of
{
"query": {
"filtered": {
"filter": {
"term": {
"visited_domain": "microsoft.com"
}
}
}
}
}
I will get both results. But I only want the exact match. Any ideas of how I alter the query or improve the mapping?
EDIT: I changed one of my examples from notmicrosoft.com
to not-microsoft.com
because this dash is causing alot of the trouble. notmicrosoft.com
does not return, but not-microsoft.com
does, when searching for microsoft.com
.