java.lang.Object
org.elasticsearch.script.DocBasedScript
org.elasticsearch.script.AbstractFieldScript
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, sourceFields inherited from class org.elasticsearch.script.DocBasedScript
docReader -
Constructor Summary
ConstructorsConstructorDescriptionGeoPointFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, OnScriptError onScriptError, org.apache.lucene.index.LeafReaderContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionfinal intcount()The number of results produced the last timeAbstractFieldScript.runForDoc(int)was called.protected final voidemit(double lat, double lon) protected voidemitFromObject(Object value) extractFromSource(String path) final double[]lats()Latitude values from the last timeAbstractFieldScript.runForDoc(int)was called.static GeoPointFieldScript.FactoryleafAdapter(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) final double[]lons()Longitude values from the last timeAbstractFieldScript.runForDoc(int)was called.protected voidfinal voidExecute the script for the provideddocId, passing results to theconsumerMethods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, emitFromCompositeScript, emitFromSource, emitValueFromCompositeScript, execute, getParams, newContext, runForDocMethods inherited from class org.elasticsearch.script.DocBasedScript
docAsMap, field, fields, getDoc, setDocument, source
-
Field Details
-
CONTEXT
-
PARSE_FROM_SOURCE
-
PARAMETERS
-
-
Constructor Details
-
GeoPointFieldScript
public GeoPointFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, OnScriptError onScriptError, org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
leafAdapter
public static GeoPointFieldScript.Factory leafAdapter(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) -
prepareExecute
protected void prepareExecute()- Specified by:
prepareExecutein classAbstractFieldScript
-
runForDoc
Execute the script for the provideddocId, passing results to theconsumer -
lats
public final double[] lats()Latitude values from the last timeAbstractFieldScript.runForDoc(int)was called. This array is mutable and will change with the next call ofAbstractFieldScript.runForDoc(int). It is also oversized and will contain garbage at all indices at and abovecount(). -
lons
public final double[] lons()Longitude values from the last timeAbstractFieldScript.runForDoc(int)was called. This array is mutable and will change with the next call ofAbstractFieldScript.runForDoc(int). It is also oversized and will contain garbage at all indices at and abovecount(). -
count
public final int count()The number of results produced the last timeAbstractFieldScript.runForDoc(int)was called. -
extractFromSource
- Overrides:
extractFromSourcein classAbstractFieldScript
-
emitFromObject
- Specified by:
emitFromObjectin classAbstractFieldScript
-
emit
protected final void emit(double lat, double lon)
-