diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQuery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQuery.java index 97bd9730a9e..fed5b8e6b21 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQuery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/MultiPhrasePrefixQuery.java @@ -162,7 +162,7 @@ public class MultiPhrasePrefixQuery extends Query { } else { break; } - if (terms.size() > maxExpansions) { + if (terms.size() >= maxExpansions) { break; } } while (enumerator.next());