From a4365971a09337bf4d639bbabb2377137c576167 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Fri, 21 Apr 2017 02:56:26 +0200 Subject: [PATCH] [TEST] make sure that the random query_string query generator defines a default_field or a list of fields --- .../apache/lucene/queryparser/classic/MapperQueryParser.java | 2 +- .../index/query/QueryStringQueryBuilderTests.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java b/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java index 015972c5684..947c7cf3ccd 100644 --- a/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java +++ b/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java @@ -787,7 +787,7 @@ public class MapperQueryParser extends QueryParser { fields = context.simpleMatchToIndexNames(field); } else { Map fieldsAndWeights = settings.fieldsAndWeights(); - fields = fieldsAndWeights == null ? Collections.emptyList() : settings.fieldsAndWeights().keySet(); + fields = fieldsAndWeights == null ? Collections.emptyList() : fieldsAndWeights.keySet(); } return fields; } diff --git a/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java index 5b9990c81cd..f478b5437b4 100644 --- a/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java @@ -85,8 +85,7 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase