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, sourceLookup
Fields 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 TypeMethodDescriptionfinal int
count()
The number of results produced the last timerunForDoc(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 timerunForDoc(int)
was called.static GeoPointFieldScript.Factory
leafAdapter
(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) final double[]
lons()
Longitude values from the last timerunForDoc(int)
was called.final void
runForDoc
(int docId) Execute the script for the provideddocId
.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
Methods 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) -
runForDoc
public final void runForDoc(int docId) Execute the script for the provideddocId
. -
runForDoc
Execute the script for the provideddocId
, passing results to theconsumer
-
lats
public final double[] lats()Latitude values from the last timerunForDoc(int)
was called. This array is mutable and will change with the next call ofrunForDoc(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 timerunForDoc(int)
was called. This array is mutable and will change with the next call ofrunForDoc(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 timerunForDoc(int)
was called. -
extractFromSource
- Overrides:
extractFromSource
in classAbstractFieldScript
-
emitFromObject
- Specified by:
emitFromObject
in classAbstractFieldScript
-
emit
protected final void emit(double lat, double lon)
-