@@ -94,12 +94,12 @@ private static void mapEntity(XContentBuilder xContentBuilder, Class clazz, bool
94
94
boolean isGeoField = isGeoField (field );
95
95
96
96
Field singleField = field .getAnnotation (Field .class );
97
- if (!isGeoField && isEntity (field ) && ! isAnnotated (field )) {
97
+ if (!isGeoField && isEntity (field ) && isAnnotated (field )) {
98
98
if (singleField == null ) {
99
99
continue ;
100
100
}
101
101
boolean nestedOrObject = isNestedOrObjectField (field );
102
- mapEntity (xContentBuilder , getFieldType (field ), false , EMPTY , field .getName (), nestedOrObject , field . getAnnotation ( Field . class ) .type ());
102
+ mapEntity (xContentBuilder , getFieldType (field ), false , EMPTY , field .getName (), nestedOrObject , singleField .type ());
103
103
if (nestedOrObject ) {
104
104
continue ;
105
105
}
@@ -126,7 +126,7 @@ private static void mapEntity(XContentBuilder xContentBuilder, Class clazz, bool
126
126
}
127
127
128
128
private static boolean isAnnotated (java .lang .reflect .Field field ) {
129
- return field .getAnnotation (Field .class ) == null && field .getAnnotation (MultiField .class ) == null && field .getAnnotation (GeoPointField .class ) = = null ;
129
+ return field .getAnnotation (Field .class ) != null || field .getAnnotation (MultiField .class ) != null || field .getAnnotation (GeoPointField .class ) ! = null ;
130
130
}
131
131
132
132
private static void applyGeoPointFieldMapping (XContentBuilder xContentBuilder , java .lang .reflect .Field field ) throws IOException {
@@ -146,9 +146,6 @@ private static void applyDefaultIdFieldMapping(XContentBuilder xContentBuilder,
146
146
/**
147
147
* Apply mapping for a single @Field annotation
148
148
*
149
- * @param xContentBuilder
150
- * @param field
151
- * @param fieldAnnotation
152
149
* @throws IOException
153
150
*/
154
151
private static void addSingleFieldMapping (XContentBuilder xContentBuilder , java .lang .reflect .Field field ,
@@ -177,9 +174,6 @@ private static void addSingleFieldMapping(XContentBuilder xContentBuilder, java.
177
174
/**
178
175
* Apply mapping for a single nested @Field annotation
179
176
*
180
- * @param builder
181
- * @param field
182
- * @param annotation
183
177
* @throws IOException
184
178
*/
185
179
private static void addNestedFieldMapping (XContentBuilder builder , java .lang .reflect .Field field ,
@@ -204,9 +198,6 @@ private static void addNestedFieldMapping(XContentBuilder builder, java.lang.ref
204
198
/**
205
199
* Multi field mappings for string type fields, support for sorts and facets
206
200
*
207
- * @param builder
208
- * @param field
209
- * @param annotation
210
201
* @throws IOException
211
202
*/
212
203
private static void addMultiFieldMapping (XContentBuilder builder , java .lang .reflect .Field field ,
@@ -226,9 +217,6 @@ private static void addMultiFieldMapping(XContentBuilder builder, java.lang.refl
226
217
/**
227
218
* Facet field for string type, for other types we don't need it(long, int, double, float)
228
219
*
229
- * @param builder
230
- * @param field
231
- * @param annotation
232
220
* @throws IOException
233
221
*/
234
222
private static void addFacetMapping (XContentBuilder builder , java .lang .reflect .Field field , Field annotation ) throws IOException {
@@ -243,9 +231,6 @@ private static void addFacetMapping(XContentBuilder builder, java.lang.reflect.F
243
231
* Sort field for string type, for other types we don't need it(long, int, double, float)
244
232
* value of the field should be converted to lowercase and not analise
245
233
*
246
- * @param builder
247
- * @param field
248
- * @param annotation
249
234
* @throws IOException
250
235
*/
251
236
private static void addSortMapping (XContentBuilder builder , java .lang .reflect .Field field , Field annotation ) throws IOException {
0 commit comments