0
...
        SearchRequest searchRequest = new SearchRequest
        {
            Size = 100,
            Source = sf,
            Filter = filters,
            Sort = sortsFields
        };

var searchResponse = client.Search<dynamic>(searchRequest);

NEST does not return the correct sorted SearchResponse from all the shards when sorting is used.

Turn on ES slowlog to see the queries from all the shards in elasticsearch.yml and execute the same query w/ sense. The result is totally out of order.

  • index.search.slowlog.threshold.query.warn: 5ms
  • index.search.slowlog.threshold.query.info: 5ms
  • index.search.slowlog.threshold.query.debug: 5ms
  • index.search.slowlog.threshold.query.trace: 5ms

Is there any way to fix this ?

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
Philip K. Adetiloye
  • 3,102
  • 4
  • 37
  • 63
  • could you provide an example query i.e listing sort fields and difference in result from sense and nest ? – keety Oct 21 '14 at 18:17

1 Answers1

0

Good news...I fixed the problem simply by specifying my index.

this.settings = new ConnectionSettings(
                node,
                "x-event-*"
            );

this.client = new ElasticClient(settings);

When sorting without specifying any default index or Indices in your SearchRequest, the sorting result is not correct.

Philip K. Adetiloye
  • 3,102
  • 4
  • 37
  • 63