Skip to content

Commit

Permalink
feat: adjust max size
Browse files Browse the repository at this point in the history
  • Loading branch information
zhxymh committed Aug 28, 2024
1 parent e8a631b commit 4978823
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,7 @@ public IEnumerable<T> ExecuteCollection<T>(QueryModel queryModel)

if (queryAggregator.Take != null)
{
var take = queryAggregator.Take.Value;
var skip = queryAggregator.Skip ?? 0;

if (skip + take > ElasticQueryLimit)
{
var exceedCount = skip + take - ElasticQueryLimit;
take -= exceedCount;
}

descriptor.Take(take);
descriptor.Size(take);
descriptor.Size(queryAggregator.Take.Value);
}

if (queryAggregator.After != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public class ElasticsearchOptions
public int NumberOfShards { get; set; } = 1;
public int NumberOfReplicas { get; set; } = 1;
public Refresh Refresh { get; set; } = Refresh.False;
public int MaxResultWindow { get; set; } = int.MaxValue;
public int MaxResultWindow { get; set; } = 10000;
}

0 comments on commit 4978823

Please sign in to comment.