8

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!

jac
  • 81
  • 1
  • 1
  • 4
  • 1
    I have rephrased my inquiry. The answers from the duplicate question did not seem to help my problem. – jac Jan 15 '15 at 22:57
  • I know that for the bare json queries there is a size parameter that defaults to 10. You can set this to a maximum of 10,000. After that you have to use scrolls and some sort of pagination to scan through the results. – NDEthos Mar 22 '17 at 16:29

1 Answers1

5

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

Community
  • 1
  • 1
bittusarkar
  • 6,247
  • 3
  • 30
  • 50
  • 3
    How is this a duplicate, this question refers to NEST. Your link refers to curl? – Marcus Jul 24 '19 at 18:20
  • 1
    Since the "duplicate" question is actually about JSON and curl, here is a decent Nest solution: https://stackoverflow.com/a/37801683/152133 – matthughes404 Apr 07 '20 at 16:04