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 {
8888 throw new UnsupportedOperationException ();
8989 }).build (null , null ));
9090 assertThat (exc .getMessage (), containsString (IndicesService .INDICES_ID_FIELD_DATA_ENABLED_SETTING .getKey ()));
91+ assertFalse (ft .isAggregatable ());
9192
9293 client ().admin ().cluster ().prepareUpdateSettings ()
9394 .setTransientSettings (Settings .builder ().put (IndicesService .INDICES_ID_FIELD_DATA_ENABLED_SETTING .getKey (), true ))
@@ -97,6 +98,7 @@ public void testEnableFieldData() throws IOException {
9798 throw new UnsupportedOperationException ();
9899 }).build (null , null );
99100 assertWarnings (ID_FIELD_DATA_DEPRECATION_MESSAGE );
101+ assertTrue (ft .isAggregatable ());
100102 } finally {
101103 // unset cluster setting
102104 client ().admin ().cluster ().prepareUpdateSettings ()
Original file line number Diff line number Diff line change @@ -53,4 +53,12 @@ public void testTermsQuery() {
5353 Query query = ft .termQuery ("id" , context );
5454 assertEquals (new TermInSetQuery ("_id" , Uid .encodeId ("id" )), query );
5555 }
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+ }
5664}
You can’t perform that action at this time.
0 commit comments