Hi everyone,
I am new to Elasticsearch, and using ES 5.1.1. When I create a Map for my type, I set property "index" of a text field to "not_analyzed", but when I try to query document using term filter, it did not return any matched documents, or when I test the mapping, the text is split. Could anyone please help me out of this? Thanks in advance.
I create a mapping:
PUT /gb
{
"mappings": {
"tweet": {
"properties": {
"tag": {
"type": "text",
"index": "not_analyzed"
}
}
}
}
}
I add a document
PUT gb/tweet/1
{
"tag": "Black-cats"
}
I query document using term filter: return no documents
GET gb/tweet/_search
{
"query": {
"term": {
"tag": "Black-cats"
}
}
}
I test the mapping: didn't return 1 term, but 2 (black, and cat)
GET gb/_analyze
{
"field": "tag",
"text": ["Black-cats"]
}