I created a dropdown for sorting Elastic Search queries , see below
<input data-role="combobox"
data-value-field="sortDescription"
data-text-field="sortDescription"
data-bind="value:sortDescription,
source: sortOptions,
visible: isVisible,
enabled: isEnabled,
events: {
change: onChange,
open: onOpen,
close: onClose
}"
style="width: 300px"
/>
I created Index on Elastic search with Id ,title ,Price,Location
sortdescription holds the value that we selected in the dropdown, when I pass sortdescription to Elastic search queries through Kendo ,its converting sortdescription to String and its not replacing the selected value,
Appreciate your thoughts/Suggestions.
var querydata= {
"fields": ["_id", "title", "description","price"],
"query": {
"filtered" : {
"filter": {
"bool": {
"must": {
"geo_distance_range" : {
"from" : "0km",
"to" : "20km",
"location" : {
"lat" : 40.12,
"lon" : -71.34
}
}
},
}
}
}
},
"sort": [
{ sortdescription : { "order": "asc" }},
{ "_score": { "order": "asc" }}
]
};