File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
server/src/test/java/org/elasticsearch/index/mapper Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ public void testEnableFieldData() throws IOException {
88
88
throw new UnsupportedOperationException ();
89
89
}).build (null , null ));
90
90
assertThat (exc .getMessage (), containsString (IndicesService .INDICES_ID_FIELD_DATA_ENABLED_SETTING .getKey ()));
91
+ assertFalse (ft .isAggregatable ());
91
92
92
93
client ().admin ().cluster ().prepareUpdateSettings ()
93
94
.setTransientSettings (Settings .builder ().put (IndicesService .INDICES_ID_FIELD_DATA_ENABLED_SETTING .getKey (), true ))
@@ -97,6 +98,7 @@ public void testEnableFieldData() throws IOException {
97
98
throw new UnsupportedOperationException ();
98
99
}).build (null , null );
99
100
assertWarnings (ID_FIELD_DATA_DEPRECATION_MESSAGE );
101
+ assertTrue (ft .isAggregatable ());
100
102
} finally {
101
103
// unset cluster setting
102
104
client ().admin ().cluster ().prepareUpdateSettings ()
Original file line number Diff line number Diff line change @@ -53,4 +53,12 @@ public void testTermsQuery() {
53
53
Query query = ft .termQuery ("id" , context );
54
54
assertEquals (new TermInSetQuery ("_id" , Uid .encodeId ("id" )), query );
55
55
}
56
+
57
+ public void testIsAggregatable () {
58
+ MappedFieldType ft = new IdFieldMapper .IdFieldType (() -> false );
59
+ assertFalse (ft .isAggregatable ());
60
+
61
+ ft = new IdFieldMapper .IdFieldType (() -> true );
62
+ assertTrue (ft .isAggregatable ());
63
+ }
56
64
}
You can’t perform that action at this time.
0 commit comments