Skip to content

Commit 3be681b

Browse files
committed
Merge branch 'netty-flow-control-handler' of github.com:mhl-b/elasticsearch into netty-flow-control-handler
2 parents b749dd3 + 8170e19 commit 3be681b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/changelog/126441.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126441
2+
summary: Add flow-control and remove auto-read in netty4 http pipeline
3+
area: Network
4+
type: enhancement
5+
issues: []

server/src/main/java/org/elasticsearch/common/lucene/search/SpanBooleanQueryRewriteWithMaxClause.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
import org.apache.lucene.search.Query;
2525
import org.apache.lucene.util.AttributeSource;
2626
import org.apache.lucene.util.BytesRef;
27+
import org.elasticsearch.ElasticsearchStatusException;
2728
import org.elasticsearch.lucene.queries.SpanMatchNoDocsQuery;
29+
import org.elasticsearch.rest.RestStatus;
2830

2931
import java.io.IOException;
3032
import java.util.Collection;
@@ -95,13 +97,14 @@ private Collection<SpanQuery> collectTerms(IndexReader reader, MultiTermQuery qu
9597
while ((bytes = termsEnum.next()) != null) {
9698
if (queries.size() >= maxExpansions) {
9799
if (hardLimit) {
98-
throw new RuntimeException(
100+
throw new ElasticsearchStatusException(
99101
"["
100102
+ query.toString()
101103
+ " ] "
102104
+ "exceeds maxClauseCount [ Boolean maxClauseCount is set to "
103105
+ IndexSearcher.getMaxClauseCount()
104-
+ "]"
106+
+ "]",
107+
RestStatus.BAD_REQUEST
105108
);
106109
} else {
107110
return queries;

0 commit comments

Comments
 (0)