Hello,
I created parent-child in ElasticSearch.
I use has_parent for query data, but I want to sort this data follow some parent field which is a String.
I tried to find solutions, I found how to sort in ElasticSearch documents
"query": {
"has_parent" : {
"parent_type" : "blog",
"score" : true,
"query" : {
"function_score" : {
"script_score": {
"script": "_score * doc['view_count'].value"
}
}
}
}
}
It use "score" * doc['view_count'] for searching which is an integer, but I want to do some calculations with String for searching it (with Groovy), but I don't know what should I do.
If you have another idea, please tell me.
thanks for helping me.