java.lang.Object
org.elasticsearch.script.DocBasedScript
org.elasticsearch.script.AbstractFieldScript
org.elasticsearch.script.GeometryFieldScript
Script producing geometries. It generates a unique
Geometry
for each document.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ScriptContext<GeometryFieldScript.Factory>
static final String[]
static final GeometryFieldScript.Factory
Fields inherited from class org.elasticsearch.script.AbstractFieldScript
fieldName, MAX_VALUES, source
Fields inherited from class org.elasticsearch.script.DocBasedScript
docReader
-
Constructor Summary
ConstructorDescriptionGeometryFieldScript
(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 void
emitFromObject
(Object value) final Geometry
geometry()
Geometry
from the last timeAbstractFieldScript.runForDoc(int)
was called.static GeometryFieldScript.Factory
leafAdapter
(Function<SearchLookup, CompositeFieldScript.LeafFactory> parentFactory) 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, extractFromSource, 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
-
GeometryFieldScript
public GeometryFieldScript(String fieldName, Map<String, Object> params, SearchLookup searchLookup, OnScriptError onScriptError, org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
leafAdapter
public static GeometryFieldScript.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
-
geometry
Geometry
from the last timeAbstractFieldScript.runForDoc(int)
was called. -
count
public final int count()The number of results produced the last timeAbstractFieldScript.runForDoc(int)
was called. It is 1 if the document exists, otherwise 0. -
emitFromObject
- Specified by:
emitFromObject
in classAbstractFieldScript
-