NEW ERROR:
Hi again. Im updating the main post, to be more visible the problem. Im trying to do context suggest, and in all shard i get the following error:
{
"_shards": {
"total": 5,
"successful": 0,
"failed": 5,
"failures": [
{
"index": "app",
"shard": 0,
"status": 500,
"reason": "BroadcastShardOperationFailedException[[app][0] ]; nested: ElasticsearchException[failed to execute suggest]; nested: ElasticsearchParseException[no mapping defined for [users]]; "
}
}
And here the mapping for user:
{
"app" : {
"mappings" : {
"users" : {
"properties" : {
"document" : {
"type" : "string"
},
"email" : {
"type" : "string"
},
"first_name" : {
"type" : "string"
},
"group" : {
"type" : "string"
},
"last_name" : {
"type" : "string"
},
"suggest" : {
"type" : "completion",
"analyzer" : "simple",
"payloads" : true,
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50,
"context" : {
"users" : {
"type" : "category",
"path" : "_type",
"default" : [ "users_active" ]
}
}
}
}
}
}
}
}
OLD ERROR:
Hello friends, I have a strange bug happening in my project. Im using PHP client of ES.
When I start my application for the first time, automatically creates all mappings in the same way, only changing necessary params. And all of them is created correctly.
After that, every time I add something to my database automatically creates a document in the correct index. And everything works same for both, only changing necessary params.
For some reason that I can't figure out, every time that I create an user, he is creating a mapping inside the user mapping, and this only happens with users type. Every other type is creating correctly, and in the same way.
I searched for everything inside my code, but nothing makes any sense, because the same way I do to others documents insertions, I do for this one. And every dump I did before creating a document is identical for any insertion method. I really don't know what the problem is...