Skip to content

Commit 5a44a0e

Browse files
committed
simplify
1 parent 6dbff84 commit 5a44a0e

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpProcessor.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -189,33 +189,14 @@ private void writeGeoIpData(IngestDocument document, String targetField, Map<Str
189189
String key = entry.getKey();
190190
Object value = entry.getValue();
191191

192-
// Keep composite objects (like location with lat/lon) as objects
193-
// since they represent a single logical field (geopoint)
194-
if (isCompositeProperty(key, value)) {
195-
document.setFieldValue(targetField + "." + key, value);
196-
} else {
197-
document.setFieldValue(targetField + "." + key, value);
198-
}
192+
document.setFieldValue(targetField + "." + key, value);
199193
}
200194
} else {
201195
// In classic mode, write as a single nested object
202196
document.setFieldValue(targetField, data);
203197
}
204198
}
205199

206-
/**
207-
* Determines if a property should be kept as a composite object rather than being flattened.
208-
* Currently, this includes the "location" property which contains lat/lon coordinates.
209-
*
210-
* @param key the property key
211-
* @param value the property value
212-
* @return true if the property is composite and should remain as an object
213-
*/
214-
private static boolean isCompositeProperty(String key, Object value) {
215-
// The "location" property contains lat/lon and represents a geopoint, so keep it as an object
216-
return "location".equals(key) && value instanceof Map;
217-
}
218-
219200
/**
220201
* Retrieves and verifies a {@link IpDatabase} instance for each execution of the {@link GeoIpProcessor}. Guards against missing
221202
* custom databases, and ensures that database instances are of the proper type before use.

0 commit comments

Comments
 (0)