//ads:
?>
Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it
PHP Snippet 1:
{
"properties": {
"order": {
"type": "text",
"fielddata": true
}
}
}
PHP Snippet 2:
curl -X PUT -H "Content-Type: application/json" \
-d '{"properties": {"format": { "type":"text","fielddata": true}}}' \
<your_host>:9200/<your_index>/_mapping
PHP Snippet 3:
.Sort(s => s
.Ascending(f => f.Field1.Suffix("keyword"))
.Ascending(f => f.Field2.Suffix("keyword"))
.Ascending(f => f.Field3.Suffix("keyword")))