File tree 5 files changed +21
-10
lines changed
server/src/main/java/org/elasticsearch/index/mapper
5 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -164,12 +164,12 @@ public Query existsQuery(QueryShardContext context) {
164
164
165
165
@ Override
166
166
public IndexFieldData .Builder fielddataBuilder (String fullyQualifiedIndexName ) {
167
- throw new UnsupportedOperationException ("[rank_feature] fields do not support sorting, scripting or aggregating" );
167
+ throw new IllegalArgumentException ("[rank_feature] fields do not support sorting, scripting or aggregating" );
168
168
}
169
169
170
170
@ Override
171
171
public Query termQuery (Object value , QueryShardContext context ) {
172
- throw new UnsupportedOperationException ("Queries on [rank_feature] fields are not supported" );
172
+ throw new IllegalArgumentException ("Queries on [rank_feature] fields are not supported" );
173
173
}
174
174
}
175
175
Original file line number Diff line number Diff line change @@ -104,17 +104,17 @@ public String typeName() {
104
104
105
105
@ Override
106
106
public Query existsQuery (QueryShardContext context ) {
107
- throw new UnsupportedOperationException ("[rank_features] fields do not support [exists] queries" );
107
+ throw new IllegalArgumentException ("[rank_features] fields do not support [exists] queries" );
108
108
}
109
109
110
110
@ Override
111
111
public IndexFieldData .Builder fielddataBuilder (String fullyQualifiedIndexName ) {
112
- throw new UnsupportedOperationException ("[rank_features] fields do not support sorting, scripting or aggregating" );
112
+ throw new IllegalArgumentException ("[rank_features] fields do not support sorting, scripting or aggregating" );
113
113
}
114
114
115
115
@ Override
116
116
public Query termQuery (Object value , QueryShardContext context ) {
117
- throw new UnsupportedOperationException ("Queries on [rank_features] fields are not supported" );
117
+ throw new IllegalArgumentException ("Queries on [rank_features] fields are not supported" );
118
118
}
119
119
}
120
120
Original file line number Diff line number Diff line change @@ -43,4 +43,9 @@ public void normalizeOther(MappedFieldType other) {
43
43
}
44
44
});
45
45
}
46
+
47
+ public void testIsAggregatable () {
48
+ MappedFieldType fieldType = createDefaultFieldType ();
49
+ assertFalse (fieldType .isAggregatable ());
50
+ }
46
51
}
Original file line number Diff line number Diff line change @@ -26,4 +26,8 @@ protected MappedFieldType createDefaultFieldType() {
26
26
return new RankFeaturesFieldMapper .RankFeaturesFieldType ();
27
27
}
28
28
29
+ public void testIsAggregatable () {
30
+ MappedFieldType fieldType = createDefaultFieldType ();
31
+ assertFalse (fieldType .isAggregatable ());
32
+ }
29
33
}
Original file line number Diff line number Diff line change @@ -99,13 +99,15 @@ public MappedFieldType() {
99
99
@ Override
100
100
public abstract MappedFieldType clone ();
101
101
102
- /** Return a fielddata builder for this field
103
- * @throws IllegalArgumentException if the fielddata is not supported on this type.
104
- * An IllegalArgumentException is needed in order to return an http error 400
105
- * when this error occurs in a request. see: {@link org.elasticsearch.ExceptionsHelper#status}
102
+ /**
103
+ * Return a fielddata builder for this field
106
104
*
107
105
* @param fullyQualifiedIndexName the name of the index this field-data is build for
108
- * */
106
+ *
107
+ * @throws IllegalArgumentException if the fielddata is not supported on this type.
108
+ * An IllegalArgumentException is needed in order to return an http error 400
109
+ * when this error occurs in a request. see: {@link org.elasticsearch.ExceptionsHelper#status}
110
+ */
109
111
public IndexFieldData .Builder fielddataBuilder (String fullyQualifiedIndexName ) {
110
112
throw new IllegalArgumentException ("Fielddata is not supported on field [" + name () + "] of type [" + typeName () + "]" );
111
113
}
You can’t perform that action at this time.
0 commit comments