I am using Elasticsearch latest version 5.6.4. I want to index the special characters and search them for the field title.special. Below is my mappings:
PUT index1
{
"mappings": {
"isContainer:false": {
"properties": {
"connectorSpecific": {
"properties": {
"title": {
"type": "text",
"store": true,
"fields": {
"special":{
"type": "text",
"analyzer": "special",
"search_analyzer": "special"
}
}
}
}
}
},
"settings": {
"index": {
"analysis": {
"analyzer": {
"special": {
"filter": [
"lowercase"
],
"tokenizer": "whitespace"
}
}
}
}
}
}
}
}
When I query in Kibana using term query,
GET index1/_search
{
"query": {
"term": {
"title.special": {
"value": "-unconstrained_net_use_inf_tw"
}
}
}
}
Nothing returns. But when I do a match search, documents do return. for eg.
GET index1/_search
{
"query": {
"match": {
"title.special": {
"value": "-unconstrained_net_use_inf_tw"
}
}
}
}
Is there something wrong in my mappings? How to make term query work on special characters like *,-,+ etc. Any help is appreciated