Skip to content
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
77101fc
Merge
tteofili Apr 11, 2025
819b364
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Apr 22, 2025
e2f774d
first chicken_score PoC
tteofili Apr 30, 2025
457aebe
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Apr 30, 2025
494f95e
first chicken_score PoC
tteofili Apr 30, 2025
8f38eb3
[CI] Auto commit changes from spotless
Apr 30, 2025
701fe46
more tests, minor fixes
tteofili May 2, 2025
0ed4f70
minor test fixes
tteofili May 2, 2025
bab8a4b
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili May 2, 2025
9e78a73
spotless
tteofili May 2, 2025
ddb40cd
improved tests
tteofili May 8, 2025
d1e2f1a
[CI] Auto commit changes from spotless
May 8, 2025
5ba09df
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 14, 2025
ec3b05a
missing readFrom
tteofili May 16, 2025
59ec292
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 21, 2025
d0c17a4
missing function wiring
tteofili May 21, 2025
b8001af
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili May 21, 2025
d6b2649
[CI] Auto commit changes from spotless
May 21, 2025
6944207
chicken_score --> score, fixed FTF checks and namedwritable reading
tteofili May 22, 2025
880ec89
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili May 22, 2025
994c9de
spotless
tteofili May 22, 2025
522bdfb
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 22, 2025
e8229e1
minor test fix
tteofili May 22, 2025
2edaef8
more tests
tteofili May 22, 2025
a15844d
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 22, 2025
f0d3b76
slightly better FTF check for EVAL s = score(...)
tteofili May 22, 2025
eac33c1
improved tests
tteofili May 22, 2025
bb78db6
spotless
tteofili May 22, 2025
68023d8
more tests
tteofili May 22, 2025
2200e15
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 22, 2025
2e0c9d6
verifier test fixes
tteofili May 22, 2025
d43d52e
[CI] Auto commit changes from spotless
May 22, 2025
14d763b
fixed info, test fixes
tteofili May 23, 2025
77f41ae
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili May 23, 2025
6356809
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 23, 2025
7e67a7b
minor refactoring
tteofili May 23, 2025
d4c2392
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 23, 2025
fa34213
enable score in WHERE with FTFs, more tests
tteofili May 23, 2025
e2ac064
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili May 23, 2025
0ccc315
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jun 5, 2025
1c0b575
spotless
tteofili Jun 5, 2025
52f8b3e
csv tests, minor adjustments
tteofili Jun 5, 2025
cce6f98
csv tests, minor adjustments
tteofili Jun 5, 2025
51c5427
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jun 5, 2025
4237ac7
Update docs/changelog/127551.yaml
tteofili Jun 5, 2025
80cf204
dropped old todo
tteofili Jun 5, 2025
bb60241
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili Jun 5, 2025
28568a4
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jun 10, 2025
9e01d7b
reset
tteofili Jun 10, 2025
141ec72
Delete docs/changelog/127551.yaml
tteofili Jun 10, 2025
ac3b001
removed changelog (unneeded)
tteofili Jun 10, 2025
5ed05c9
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili Jun 10, 2025
31db011
Update x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/…
tteofili Jun 26, 2025
36959c8
Update x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsea…
tteofili Jun 26, 2025
979c615
Merge branch 'main' into esql_namedqueries
tteofili Jun 26, 2025
e125cbe
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jun 30, 2025
62817f4
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jul 1, 2025
df01c8a
revert unwanted changes
tteofili Jul 1, 2025
ee51465
restore
tteofili Jul 1, 2025
25e9d4c
only run esql spec IT
tteofili Jul 2, 2025
df3f8ac
csv test fixes
tteofili Jul 3, 2025
0c46574
[CI] Auto commit changes from spotless
Jul 3, 2025
28848db
csv test fixes
tteofili Jul 3, 2025
e19ea6b
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili Jul 3, 2025
177b9f3
csv test fixes
tteofili Jul 3, 2025
1bec8d6
csv test fixes
tteofili Jul 3, 2025
45e96bb
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jul 3, 2025
d91cf10
data type fix
tteofili Jul 3, 2025
d121042
dropped test
tteofili Jul 3, 2025
6060f84
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jul 10, 2025
10edc05
improved checks and tests
tteofili Jul 11, 2025
0d7ecd1
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jul 11, 2025
afc1287
[CI] Auto commit changes from spotless
Jul 11, 2025
f0cd402
check score is always used before limit, aggs, etc.
tteofili Jul 11, 2025
eb14196
Merge branch 'esql_namedqueries' of github.com:tteofili/elasticsearch…
tteofili Jul 11, 2025
b964313
spotless
tteofili Jul 11, 2025
f4dfa0a
non pushable disjunction csv test
tteofili Jul 11, 2025
88997d9
minor fix
tteofili Jul 11, 2025
97822b3
minor fix
tteofili Jul 11, 2025
86287a9
minor fix
tteofili Jul 11, 2025
852fb22
minor fix
tteofili Jul 11, 2025
c941ea7
Merge branch 'main' of github.com:elastic/elasticsearch into esql_nam…
tteofili Jul 14, 2025
e888da2
ScoreTests and docs
tteofili Jul 14, 2025
398aa7c
revert
tteofili Jul 14, 2025
18df6f0
Update x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/…
tteofili Jul 15, 2025
87bce59
Merge branch 'main' into esql_namedqueries
tteofili Jul 15, 2025
c0e6258
[CI] Auto commit changes from spotless
Jul 15, 2025
c852c81
Merge branch 'main' into esql_namedqueries
tteofili Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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

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

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

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

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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

10 changes: 10 additions & 0 deletions docs/reference/query-languages/esql/kibana/docs/functions/score.md

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
###############################################
# Tests for Score function
#

scoreSingle
required_capability: metadata_score
required_capability: score_function
required_capability: match_function

// tag::score-function[]
FROM books METADATA _score
| WHERE match(title, "Return") AND match(author, "Tolkien")
| EVAL first_score = score(match(title, "Return"))
// end::score-function[]
| KEEP book_no, title, _score, first_score
| SORT book_no
| LIMIT 5
;

// tag::score-single-result[]
book_no:keyword | title:text | _score:double | first_score:double
2714 | Return of the King Being the Third Part of The Lord of the Rings | 3.1309072971343994 | 1.9245924949645996
7350 | Return of the Shadow | 4.8434343338012695 | 3.5432329177856445
// end::score-single-result[]
;

scoreSingleNoMetadata
required_capability: score_function
required_capability: match_function

FROM books
| WHERE match(title, "Return") AND match(author, "Tolkien")
| EVAL first_score = score(match(title, "Return"))
| KEEP book_no, title, first_score
| SORT book_no
| LIMIT 5
;

book_no:keyword | title:text | first_score:double
2714 | Return of the King Being the Third Part of The Lord of the Rings | 1.9245924949645996
7350 | Return of the Shadow | 3.5432329177856445
;

scoreAfterEval
required_capability: score_function
required_capability: metadata_score
required_capability: match_function

FROM books METADATA _score
| EVAL stars = to_long(ratings / 2.0)
| EVAL s1 = score(match(author, "William"))
| WHERE match(author, "Faulkner")
| SORT book_no
| KEEP book_no, author, stars, s1
| limit 5;

book_no:keyword | author:text | stars:long | s1:double
2378 | [Carol Faulkner, Holly Byers Ochoa, Lucretia Mott] | 3 | 0.0
2713 | William Faulkner | 2 | 1.9043500423431396
2847 | Colleen Faulkner | 3 | 0.0
2883 | William Faulkner | 2 | 1.9043500423431396
3293 | Danny Faulkner | 2 | 0.0
;

scoreMatchWithFilterConjunction
required_capability: score_function
required_capability: match_function

FROM books
| WHERE match(title, "Return") AND match(author, "Tolkien")
| EVAL s1 = score(match(title, "Rings") and ratings > 4.6)
| KEEP book_no, title, s1
| SORT book_no
| LIMIT 5;

book_no:keyword | title:text | s1:double
2714 | Return of the King Being the Third Part of The Lord of the Rings | 1.9245924949645996
7350 | Return of the Shadow | 0.0
;

scoreMatchWithDisjunction
required_capability: score_function
required_capability: match_function

FROM books
| WHERE match(title, "Return") AND match(author, "Tolkien")
| EVAL s1 = score(match(title, "Rings") or match(title, "Shadow"))
| KEEP book_no, title, s1
| SORT book_no
| LIMIT 5;

book_no:keyword | title:text | s1:double
2714 | Return of the King Being the Third Part of The Lord of the Rings | 1.9245924949645996
7350 | Return of the Shadow | 3.5432329177856445
;

scoreMatchWithDisjunctionAndFilter
required_capability: score_function
required_capability: match_function

FROM books
| WHERE match(title, "Return") AND match(author, "Tolkien")
| EVAL s1 = score(match(title, "Rings") or match(title, "Shadow") and ratings > 4.6)
| KEEP book_no, title, s1
| SORT book_no
| LIMIT 5;

book_no:keyword | title:text | s1:double
2714 | Return of the King Being the Third Part of The Lord of the Rings | 1.9245924949645996
7350 | Return of the Shadow | 3.5432329177856445
;

scoreMatchDisjunctionNonPushable
required_capability: score_function
required_capability: match_function

FROM books
| WHERE match(title, "Return") AND match(author, "Tolkien")
| EVAL s1 = score(match(title, "Rings") or ratings > 4.6)
| KEEP book_no, title, s1
| SORT book_no
| LIMIT 5;

book_no:keyword | title:text | s1:double
2714 | Return of the King Being the Third Part of The Lord of the Rings | 1.9245924949645996
7350 | Return of the Shadow | 0.0
;
Loading
Loading