nest - ElasticSearch Order By String


Question: How do you order by Date in Elasticsearch Nest C# API.


Login to See the Rest of the Answer

Answer: See the code below

var  response = await _elasticClient.SearchAsync<MyIndex>
                             (
                      s => s.Query(q => q.QueryString(d => d.Query("Technology")))
                      .Sort(a => a.Descending(b => b.DateInserted))
                          .From((page - 1) * pageSize)
                          .Size(pageSize));

 






For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email AddressContact: [email protected]