Skip to content
5 changes: 5 additions & 0 deletions docs/changelog/135603.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 135603
summary: Make FUSE available in release builds
area: ES|QL
type: feature
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,7 @@ fuseWithLinearAndL2Norm

required_capability: fork_v9
required_capability: fuse_v6
required_capability: semantic_text_field_caps
required_capability: metadata_score
required_capability: fuse_l2_norm

FROM books METADATA _id, _index, _score
| FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 )
Expand Down Expand Up @@ -658,6 +657,7 @@ id_0.0 | 0.0
fuseWithRowLinearAndL2Norm

required_capability: fuse_v6
required_capability: fuse_l2_norm

ROW my_score = [0, 1, 2, 3, 4]::double, _index = "my_index", _fork = "foo"
| MV_EXPAND my_score
Expand Down Expand Up @@ -759,6 +759,7 @@ id_4.0 | 0.01563 | foo
fuseWithRowLinearL2NormAndZeroScores

required_capability: fuse_v6
required_capability: fuse_l2_norm

ROW _id = ["a", "b", "c"], _score = 0.0, _index = "my_index", my_fork = "foo"
| MV_EXPAND _id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public void testFuseSimpleLinear() {
}

public void testFuseLinearWithWeightsAndNormalizer() {
assumeTrue("requires FUSE_L2_NORM capability", EsqlCapabilities.Cap.FUSE_L2_NORM.isEnabled());

var query = """
FROM test METADATA _score, _id, _index
| WHERE id > 2
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ processingCommand
| forkCommand
| rerankCommand
| inlineStatsCommand
| fuseCommand
// in development
| {this.isDevVersion()}? lookupCommand
| {this.isDevVersion()}? insistCommand
| {this.isDevVersion()}? fuseCommand
;

whereCommand
Expand Down Expand Up @@ -326,6 +326,17 @@ inlineStatsCommand
| INLINESTATS stats=aggFields (BY grouping=fields)?
;

fuseCommand
: FUSE (fuseType=identifier)? (fuseConfiguration)*
;

fuseConfiguration
: SCORE BY score=qualifiedName
| KEY BY key=fields
| GROUP BY group=qualifiedName
| WITH options=mapExpression
;

//
// In development
//
Expand All @@ -337,17 +348,6 @@ insistCommand
: DEV_INSIST qualifiedNamePatterns
;

fuseCommand
: DEV_FUSE (fuseType=identifier)? (fuseConfiguration)*
;

fuseConfiguration
: SCORE BY score=qualifiedName
| KEY BY key=fields
| GROUP BY group=qualifiedName
| WITH options=mapExpression
;

setCommand
: SET setField SEMICOLON
;
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/plugin/esql/src/main/antlr/lexer/Fuse.g4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

lexer grammar Fuse;

DEV_FUSE : {this.isDevVersion()}? 'fuse' -> pushMode(FUSE_MODE);
FUSE : 'fuse' -> pushMode(FUSE_MODE);

mode FUSE_MODE;
FUSE_PIPE : PIPE -> type(PIPE), popMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ public enum Cap {
/**
* FUSE command
*/
FUSE_V6(Build.current().isSnapshot()),
FUSE_V6,

/**
* Support improved behavior for LIKE operator when used with index fields.
Expand Down Expand Up @@ -1560,6 +1560,11 @@ public enum Cap {

DENSE_VECTOR_AGG_METRIC_DOUBLE_IF_FNS,

/**
* FUSE L2_NORM score normalization support
*/
FUSE_L2_NORM(Build.current().isSnapshot()),

/**
* Support for requesting the "_tsid" metadata field.
*/
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading