java.lang.Object
org.elasticsearch.script.DocBasedScript
org.elasticsearch.script.AbstractFieldScript
org.elasticsearch.script.AbstractLongFieldScript
org.elasticsearch.script.GeoPointFieldScript
Script producing geo points. Similarly to what
LatLonDocValuesField does,
it encodes the points as a long value.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScriptContext<GeoPointFieldScript.Factory>static final String[]static final GeoPointFieldScript.FactoryFields inherited from class org.elasticsearch.script.AbstractFieldScript
fieldName, MAX_VALUES, sourceLookupFields inherited from class org.elasticsearch.script.DocBasedScript
docReader -
Constructor Summary
ConstructorsConstructorDescriptionGeoPointFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidemit(double lat, double lon) protected voidemitFromObject(Object value) extractFromSource(String path) static GeoPointFieldScript.FactoryleafAdapter(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) voidrunGeoPointForDoc(int doc, Consumer<GeoPoint> consumer) Consumers must copy the emitted GeoPoint(s) if stored.Methods inherited from class org.elasticsearch.script.AbstractLongFieldScript
count, emit, runForDoc, runForDoc, valuesMethods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, emitFromCompositeScript, emitFromSource, emitValueFromCompositeScript, execute, getParamsMethods inherited from class org.elasticsearch.script.DocBasedScript
docAsMap, field, fields, getDoc, setDocument
-
Field Details
-
CONTEXT
-
PARSE_FROM_SOURCE
-
PARAMETERS
-
-
Constructor Details
-
GeoPointFieldScript
public GeoPointFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
leafAdapter
public static GeoPointFieldScript.Factory leafAdapter(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) -
runGeoPointForDoc
Consumers must copy the emitted GeoPoint(s) if stored. -
extractFromSource
- Overrides:
extractFromSourcein classAbstractFieldScript
-
emitFromObject
- Specified by:
emitFromObjectin classAbstractFieldScript
-
emit
protected final void emit(double lat, double lon)
-