Is there a way to retrieve all records in a (ElasticSearch) NEST query?

jac picture jac · Jan 15, 2015 · Viewed 20.2k times · Source

I'm doing this query in NEST

var result = elasticClient.Search<SearchItemClass>( s=>
    s.Index("indexName")
     .Type("typeName")
     .Query(q => q.ConstantScore(score => score.Filter(f => f.Term("fieldName", "term"))))
);

And this will return 10 Hits by default.

Is there a way I can get ALL results, WITHOUT indicating .Size(value) or .Take(value)?

Thanks in advance!

Answer

bittusarkar picture bittusarkar · Jan 15, 2015

This is a dup of Elasticsearch query to return all records. To use scan and scroll, look at the NEST documentation here.