Skip to content

Commit 77101fc

Browse files
committed
Merge
1 parent ef633d5 commit 77101fc

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,12 @@ public enum Cap {
984984
/**
985985
* Support avg_over_time aggregation that gets evaluated per time-series
986986
*/
987-
AVG_OVER_TIME(Build.current().isSnapshot());
987+
AVG_OVER_TIME(Build.current().isSnapshot()),
988+
989+
/**
990+
* chicken_score ES|QL function
991+
*/
992+
CHICKEN_SCORE(Build.current().isSnapshot());
988993

989994
private final boolean enabled;
990995

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.elasticsearch.xpack.esql.expression.function.aggregate.Top;
3535
import org.elasticsearch.xpack.esql.expression.function.aggregate.Values;
3636
import org.elasticsearch.xpack.esql.expression.function.aggregate.WeightedAvg;
37+
import org.elasticsearch.xpack.esql.expression.function.fulltext.ChickenScore;
3738
import org.elasticsearch.xpack.esql.expression.function.fulltext.Kql;
3839
import org.elasticsearch.xpack.esql.expression.function.fulltext.Match;
3940
import org.elasticsearch.xpack.esql.expression.function.fulltext.QueryString;
@@ -436,8 +437,8 @@ private static FunctionDefinition[][] snapshotFunctions() {
436437
def(Rate.class, Rate::withUnresolvedTimestamp, "rate"),
437438
def(MaxOverTime.class, uni(MaxOverTime::new), "max_over_time"),
438439
def(AvgOverTime.class, uni(AvgOverTime::new), "avg_over_time"),
439-
def(Term.class, bi(Term::new), "term") } };
440-
}
440+
def(ChickenScore.class, uni(ChickenScore::new), "chicken_score"),
441+
def(Term.class, bi(Term::new), "term") } };}
441442

442443
public EsqlFunctionRegistry snapshotRegistry() {
443444
if (Build.current().isSnapshot() == false) {

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/FullTextWritables.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
2828
if (EsqlCapabilities.Cap.TERM_FUNCTION.isEnabled()) {
2929
entries.add(Term.ENTRY);
3030
}
31+
if (EsqlCapabilities.Cap.CHICKEN_SCORE.isEnabled()) {
32+
entries.add(ChickenScore.ENTRY);
33+
}
3134

3235
return Collections.unmodifiableList(entries);
3336
}

0 commit comments

Comments
 (0)