Skip to content

Commit b000271

Browse files
authored
Update expert script example with termStats (#112377)
This commit fixes compilation of the expert script example to implement the new required method of score script making termStats available.
1 parent c1d9e7e commit b000271

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public boolean needs_score() {
124124
return false; // Return true if the script needs the score
125125
}
126126

127+
@Override
128+
public boolean needs_termStats() {
129+
return false; // Return true if the script needs term statistics via get_termStats()
130+
}
131+
127132
@Override
128133
public ScoreScript newInstance(DocReader docReader)
129134
throws IOException {

0 commit comments

Comments
 (0)