Hi All,
I am using Nest Library for elastic search in my .net core project.
I am facing problem in sorting of result.
the sorted result returned from elasticSearch is not properly sorted.
I am also using paging.
below is the search query
var searchRequest = new SearchRequest(indexName)
{
Size = pageSize,
From = ((pageIndex - 1) * pageSize),
Query = new MatchAllQuery(),
Sort = new List { new FieldSort { Field = "93.keyword", Order = sortOrder }, }
};
var searchResponse = await _client.SearchAsync<dynamic>(searchRequest);
return searchResponse;
Note : Field = "93.keyword" is text field
And the mapping are as follows :
"93": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}