I am getting the following error on search. I just added a new field to index and it is of boolean type:
{
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "........",
"node": ".......",
"reason": {
"type": "query_shard_exception",
"reason": "Can only use prefix queries on keyword and text fields - not on [isXYZ] which is of type [boolean]",
"index_uuid": "...........",
"index": "......."
}
}
]
}
This is the query which causes the error:
{
"query": {
"bool": {
"must": {
"simple_query_string": {
"query": "xyz*",
"default_operator": "or",
"fields": [
"isXYZ",
"anotherField"
]
}
}
}
}
But it works fine for following query:
{
"query": {
"bool": {
"must": {
"bool": {
"must": [
{
"simple_query_string": {
"query": "true",
"default_operator": "or",
"fields": ["isXYZ"]
}
}
]
}
}
}
}
}
I am not sure what is wrong. I am new to Elastic Search