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 class
static interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScriptContext<GeoPointFieldScript.Factory>
static final String[]
static final GeoPointFieldScript.Factory
Fields inherited from class org.elasticsearch.script.AbstractFieldScript
fieldName, MAX_VALUES, source
Fields 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 int
count()
The number of results produced the last timeAbstractFieldScript.runForDoc(int)
was called.protected final void
emit
(double lat, double lon) protected void
emitFromObject
(Object value) extractFromSource
(String path) final double[]
lats()
Latitude values from the last timeAbstractFieldScript.runForDoc(int)
was called.static GeoPointFieldScript.Factory
leafAdapter
(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) final double[]
lons()
Longitude values from the last timeAbstractFieldScript.runForDoc(int)
was called.protected void
final void
Execute the script for the provideddocId
, passing results to theconsumer
Methods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, emitFromCompositeScript, emitFromSource, emitValueFromCompositeScript, execute, getParams, newContext, runForDoc
Methods 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:
prepareExecute
in 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:
extractFromSource
in classAbstractFieldScript
-
emitFromObject
- Specified by:
emitFromObject
in classAbstractFieldScript
-
emit
protected final void emit(double lat, double lon)
-