Package org.elasticsearch.script
Class StringFieldScript
java.lang.Object
org.elasticsearch.script.AbstractFieldScript
org.elasticsearch.script.StringFieldScript
public abstract class StringFieldScript extends AbstractFieldScript
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringFieldScript.Emit
static interface
StringFieldScript.Factory
static interface
StringFieldScript.LeafFactory
-
Field Summary
Fields Modifier and Type Field Description static ScriptContext<StringFieldScript.Factory>
CONTEXT
static long
MAX_CHARS
The maximum number of chars a script should be allowed to emit.static java.lang.String[]
PARAMETERS
Fields inherited from class org.elasticsearch.script.AbstractFieldScript
fieldName, leafSearchLookup, MAX_VALUES
-
Constructor Summary
Constructors Constructor Description StringFieldScript(java.lang.String fieldName, java.util.Map<java.lang.String,java.lang.Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx)
-
Method Summary
Modifier and Type Method Description void
emit(java.lang.String v)
java.util.List<java.lang.String>
resultsForDoc(int docId)
Execute the script for the provideddocId
.void
runForDoc(int docId, java.util.function.Consumer<java.lang.String> consumer)
Methods inherited from class org.elasticsearch.script.AbstractFieldScript
checkMaxSize, execute, extractFromSource, getDoc, getParams, setDocument
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
MAX_CHARS
public static final long MAX_CHARSThe maximum number of chars a script should be allowed to emit.- See Also:
- Constant Field Values
-
CONTEXT
-
PARAMETERS
public static final java.lang.String[] PARAMETERS
-
-
Constructor Details
-
StringFieldScript
public StringFieldScript(java.lang.String fieldName, java.util.Map<java.lang.String,java.lang.Object> params, SearchLookup searchLookup, org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
resultsForDoc
public final java.util.List<java.lang.String> resultsForDoc(int docId)Execute the script for the provideddocId
.- Returns:
- a mutable
List
that contains the results of the script and will be modified the next time you call resultsForDoc(int).
-
runForDoc
public final void runForDoc(int docId, java.util.function.Consumer<java.lang.String> consumer) -
emit
public final void emit(java.lang.String v)
-