|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elasticsearch.script.AbstractExecutableScript
org.elasticsearch.script.AbstractSearchScript
public abstract class AbstractSearchScript
A base class for any script type that is used during the search process (custom score, facets, and so on).
If the script returns a specific numeric type, consider overriding the type specific base classes
such as AbstractDoubleSearchScript, AbstractFloatSearchScript and AbstractLongSearchScript
for better performance.
The use is required to implement the ExecutableScript.run() method.
| Constructor Summary | |
|---|---|
AbstractSearchScript()
|
|
| Method Summary | |
|---|---|
protected DocLookup |
doc()
Returns the doc lookup allowing to access field data (cached) values as well as the current document score (where applicable). |
protected FieldsLookup |
fields()
Allows to access the *stored* fields. |
double |
runAsDouble()
|
float |
runAsFloat()
|
long |
runAsLong()
|
protected float |
score()
Returns the current score and only applicable when used as a scoring script in a custom score query!. |
void |
setNextDocId(int doc)
|
void |
setNextReader(org.apache.lucene.index.IndexReader reader)
|
void |
setNextScore(float score)
|
void |
setScorer(org.apache.lucene.search.Scorer scorer)
|
protected SourceLookup |
source()
Allows to access the actual source (loaded and parsed). |
| Methods inherited from class org.elasticsearch.script.AbstractExecutableScript |
|---|
setNextVar, unwrap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.elasticsearch.script.ExecutableScript |
|---|
run, setNextVar, unwrap |
| Constructor Detail |
|---|
public AbstractSearchScript()
| Method Detail |
|---|
protected final float score()
doc() and get the score from it.
protected final DocLookup doc()
protected final SourceLookup source()
protected final FieldsLookup fields()
public void setScorer(org.apache.lucene.search.Scorer scorer)
setScorer in interface SearchScriptpublic void setNextReader(org.apache.lucene.index.IndexReader reader)
setNextReader in interface SearchScriptpublic void setNextDocId(int doc)
setNextDocId in interface SearchScriptpublic void setNextScore(float score)
setNextScore in interface SearchScriptpublic float runAsFloat()
runAsFloat in interface SearchScriptpublic long runAsLong()
runAsLong in interface SearchScriptpublic double runAsDouble()
runAsDouble in interface SearchScript
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||