Skip to content

Commit 2c982c0

Browse files
committed
Added multi-field test
1 parent a9d6c0d commit 2c982c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/test/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTextAggregatorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ public void testSignificanceOnTextArrays() throws IOException {
137137
for (int i = 0; i < 10; i++) {
138138
Document doc = new Document();
139139
doc.add(new Field("text", "foo", textFieldType));
140-
String json ="{ \"text\" : [\"foo\",\"foo\"]}";
140+
String json ="{ \"text\" : [\"foo\",\"foo\"], \"title\" : [\"foo\", \"foo\"]}";
141141
doc.add(new StoredField("_source", new BytesRef(json)));
142142
w.addDocument(doc);
143143
}
144144

145145
SignificantTextAggregationBuilder sigAgg = new SignificantTextAggregationBuilder("sig_text", "text");
146+
sigAgg.sourceFieldNames(Arrays.asList(new String [] {"title", "text"}));
146147
try (IndexReader reader = DirectoryReader.open(w)) {
147148
assertEquals("test expects a single segment", 1, reader.leaves().size());
148149
IndexSearcher searcher = new IndexSearcher(reader);

0 commit comments

Comments
 (0)