I'm trying percolate query in elasticsearch, but creating an index as explained in the docs I'm greeted with an error. I ran the following:
PUT /my_percolate_index
{
"mappings": {
"doctype": {
"properties": {
"message": {
"type": "text"
}
}
},
"queries": {
"properties": {
"query": {
"type": "percolator"
}
}
}
}
}
I'm greeted with the following error:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]"
},
"status": 400
}
Am I missing something here?
Since you're using ES 6, you just need to move the
query
field inside your mapping typeNote that as of ES 6, only a single mapping type is allowed within any index.