From 4978823cfcb666c2b22835fa5cc6127ee97a56ae Mon Sep 17 00:00:00 2001 From: zhxymh Date: Wed, 28 Aug 2024 17:44:42 +0800 Subject: [PATCH] feat: adjust max size --- .../Linq/ElasticsearchQueryExecutor.cs | 12 +----------- .../Options/ElasticsearchOptions.cs | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/AElf.EntityMapping.Elasticsearch/Linq/ElasticsearchQueryExecutor.cs b/src/AElf.EntityMapping.Elasticsearch/Linq/ElasticsearchQueryExecutor.cs index e6cfe552..0065c796 100644 --- a/src/AElf.EntityMapping.Elasticsearch/Linq/ElasticsearchQueryExecutor.cs +++ b/src/AElf.EntityMapping.Elasticsearch/Linq/ElasticsearchQueryExecutor.cs @@ -74,17 +74,7 @@ public IEnumerable ExecuteCollection(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) diff --git a/src/AElf.EntityMapping.Elasticsearch/Options/ElasticsearchOptions.cs b/src/AElf.EntityMapping.Elasticsearch/Options/ElasticsearchOptions.cs index d922adcb..bf6e5342 100644 --- a/src/AElf.EntityMapping.Elasticsearch/Options/ElasticsearchOptions.cs +++ b/src/AElf.EntityMapping.Elasticsearch/Options/ElasticsearchOptions.cs @@ -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; } \ No newline at end of file