I have created the index with following setting and mapping:
PUT test
{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 1
},
"mappings": {
"documents": {
"properties": {
"title": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"url": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"tags": {
"type": "keyword"
}
}
}
}
}
In above mapping, I have declared tags as type keyword for the exact match.and added 10 documents into it for example:
PUT test/documents/1
{
"title":"John",
"url":"/john",
"tags":["name question","how"]
}
but I want to add multi-fields support for tags to support partial tags matching so I have updated index mapping as follows:
PUT test/documents/_mapping
{
"properties": {
"title": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"url": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"tags": {
"type": "keyword",
"fields": {
"raw": {
"type": "text"
}
}
}
}
}
is this right way to updae index mapping? Can now my tags support partial matching? Please help me into this