diff --git a/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java b/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java index fa2fd033bee..bcf1e924315 100644 --- a/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java +++ b/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java @@ -160,6 +160,12 @@ public class QueryStringQueryParser extends XQueryParser { queryBuilder.setOccur(op == Operator.AND ? BooleanClause.Occur.MUST : BooleanClause.Occur.SHOULD); } + @Override + public void setPhraseSlop(int phraseSlop) { + super.setPhraseSlop(phraseSlop); + queryBuilder.setPhraseSlop(phraseSlop); + } + /** * @param type Sets how multiple fields should be combined to build textual part queries. */ diff --git a/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java index ee56d07ca65..296fd973a5b 100644 --- a/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java @@ -1387,6 +1387,44 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase