Commit graph

101 commits

Author SHA1 Message Date
Kathleen DeRusso
2d38751fe7
Add knn query vector builder example over a semantic text field to docs (#130135) 2025-06-27 08:18:40 -04:00
Liam Thompson
4df0e9930c
[DOCS] Update ESQL metadata fields page (#129939)
* [DOCS] Update ESQL metadata fields page

**esql-metadata-fields.md:**
- restructured from bullet list to table format for metadata fields
- added `_index_mode` and `_source` fields to available metadata
- improved field descriptions (more detailed)
- added "usage and limitations" section
- reorganized examples into subsections with headers
- added `_score` sorting example
- added tip box linking to search documentation

* 🚙Drive by updates to search functions ref page

moved tutorial link into tip box at top
added cross-reference to search overview documentation
minor text flow improvements and punctuation fixes

* Fix id typo

* Apply suggestions from review

Co-authored-by: Bogdan Pintea <sig11@mailbox.org>
2025-06-25 12:00:28 +02:00
Alexander Spies
7b5e92fcb2
ESQL: Declare LOOKUP JOIN as GA in docs (#129947)
* Declare LU JOIN GA in 9.1
* Align applies_to tags for sample, change_point

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-06-25 09:30:37 +02:00
Mark J. Hoy
7249ac4d42
Mark Token Pruning for Sparse Vector as GA (#128854)
* remove [preview] labels sparse vec / token pruning

* Update docs/changelog/128854.yaml

* update changelog

* set changelog to feature/ml

* set proper area

* add applies_to labels

* add clarification for token pruning behaviour
2025-06-24 11:36:02 -04:00
Martijn van Groningen
ae3c3601fd
Remove docs warning that synthetic source is in es|ql is experimental. (#129930) 2025-06-24 16:59:55 +02:00
Nik Everett
59a10bdd7b
ESQL: Add counters to signature for IS NULL (#129670)
This adds `counter_long` and `counter_double` to the signatures of
supported fields for `IS NULL` and `IS NOT NULL`. We hadn't been
generating those signatures since the docs v3 migration, so this had to
plug those in. In addition, it changes the wording on a few things and
adds a note that if a field is only in some documents then the ones
missing the field will have `NULL` - which is important information for
`IS NULL` and `IS NOT NULL`.
2025-06-24 01:18:15 +01:00
Liam Thompson
8c06acccf8
[DOCS][ESQL] GA search functions for 9.1 (#129786)
* [DOCS][ESQL] Flip preview booleans, to GA search functions

* render docs, tweak some applies_to metadata in docs gen code

- **rendered docs (md):**
  - kql: removed serverless preview, added ga 9.1.0
  - match: removed serverless preview, added ga 9.1.0
  - match_phrase: changed from preview 9.1.0 to unavailable 9.0 + ga 9.1.0
  - qstr: removed serverless preview, added ga 9.1.0
  - search functions list: removed bullet point before term function

- **docs generation code (java):**
  - match_phrase: updated function info annotations to unavailable 9.0 + ga 9.1.0
  - query_string: uncommented ga 9.1.0 annotation
2025-06-23 20:51:54 +01:00
Craig Taverner
e6347b8ab0
[DOCS] Update ES|QL generated docs to consistently use the applies_to metadata (#128576)
- Add PREVIEW annotations to all preview functions
- Update docs generation logic to use annotations instead of preview boolean
* Changed stack: ga 9.1 to stack: coming in multiple places
  - Match.java: Updated the options parameter description
  - MultiMatch.java: Updated the options parameter description
  - ToLower.java: Reformatted parameter description and updated version annotation
  - ToUpper.java: Removed the appliesTo annotation entirely and reformatted parameter description

- updated applies_to annotations to specify both preview 9.0.0 and ga 9.1.0 lifecycle stages
- added version-specific documentation examples with applies_to markers for ga 9.1.0 features
- enhanced to_lower and to_upper functions to indicate support for multi-valued expressions in ga 9.1.0
- added version guards around function parameters and descriptions using applies_to syntax
- updated function parameter descriptions to indicate ga 9.1.0 availability for named parameters
- use detailedDescription + and fix match_phrase applies_to syntax
- strip inline applies_to from kibana docs
- update roundto, matchphrase lifecycles
-  fix match named params info
- various spatial functions are preview
- unsigned long is preview
- update qstr
- Update TO_LOWER/TO_UPPER parameter descriptions for clarity
- hide spatial functions per https://github.com/elastic/elasticsearch/pull/129839
- added `stack: ga 9.1.0` blocks to match_phrase.md and qstr.md examples
- simplified term.md version from `preview 9.0.0` to just `preview`
- added `applies_to = "stack: ga 9.1.0"` to matchphrase and querystring java annotations
- removed version `9.0.0` from term function annotation
- deleted unused `makeCallout()` and `appendLifeCycleAndVersion()` methods


Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: Nik Everett <nik9000@gmail.com>
2025-06-23 20:07:41 +02:00
Alexander Spies
efb1397fe9
ESQL: Hide spatial grid functions behind SNAPSHOT (#129839)
#125143 added 9 spatial grid functions and released them into Serverless. We think this is not the best long-term approach and the functions in #129581 are likely better.

As a first step, rmove the spatial grid functions added in #125143 from release builds so they don't get released into 8.19/9.1.

---------

Co-authored-by: Craig Taverner <craig@amanzi.com>
2025-06-23 17:16:30 +02:00
Nik Everett
0b35acf861
ESQL: Fix misspelling in generated docs (#129789)
Pulled from #128576 so it's easier to review.
2025-06-20 20:42:37 +01:00
Jan Kuipers
5449d95dcd
ES|QL categorize tech preview -> GA (#129398) 2025-06-19 12:06:28 +02:00
Jan Kuipers
df76c15edd
ES|QL sample documentation (#129350)
* ES|QL sample documentation

* Update docs/reference/query-languages/esql/_snippets/commands/layout/sample.md

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-06-17 10:56:14 +02:00
Julian Kiryakov
7fb130c53b
Add Support for LIKE (LIST) (#129170)
Adds support for LIKE function alternative syntax with a list of patterns.
Examples:

FROM foo
| WHERE bar LIKE ("A*","B*", "C?")
The new syntax is documented as part of the existing LIKE function documentation. We will use the existing WildcardLike java implementation for existing cases using the old syntax and one list argument case to improve mixed cluster compatibility.
2025-06-17 03:49:44 +02:00
Ioana Tagirta
4daf983ea9
Docs: Fix indentation for query options (#129395) 2025-06-13 15:40:52 +02:00
Kathleen DeRusso
17d463f6bf
Register match_phrase as a function not a snapshot function (#129255)
* Register match_phrase as a function not a snapshot function

* Update usage
2025-06-11 13:01:24 -04:00
Liam Thompson
778b868227
[ESQL] Fix typo in search-functions.md (#129260)
^^
2025-06-11 15:42:45 +02:00
István Zoltán Szabó
045c23339d
[DOCS] Adds preview tag to the CHANGE_POINT ES|QL command in the command list. (#129247) 2025-06-11 13:21:55 +02:00
Bogdan Pintea
6c7730d1c9
ESQL: Extend RENAME syntax to allow a new = old syntax (#129212)
This extends RENAME's grammar to allow a new syntax: `| RENAME new_name
= old_name` This is supported along the existing `... old_name AS
new_name` syntax.

Closes #129208
2025-06-11 21:16:48 +10:00
Larisa Motova
1333ea8883
[ES|QL] Specify population in StdDev docs (#129225)
There are 2 types of Standard Deviation: population and
sample, this commit clarifies that the existing is population.
2025-06-10 12:47:11 -10:00
Carlos Delgado
366e00f5c5
ES|QL - kNN function initial support (#127322) 2025-06-10 11:11:42 +02:00
Ioana Tagirta
15dd896a61
Remove null example for match_phrase (#129173) 2025-06-10 10:27:15 +02:00
Kathleen DeRusso
b214fbfcdc
Take match_phrase out of snapshot and make tech preview (#128925)
* Take match_phrase out of snapshot and make tech preview

* Update docs/changelog/128925.yaml

* PR feedback

* Adding regenerated test data

* Update docs/changelog/128925.yaml

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* [CI] Auto commit changes from spotless

* Checkstyle

* Correct docs

* Hopefully fix docs build

* Found one more bad docs link - here's hoping this now fixes the doc build

* OMG bitten by - vs _

---------

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Aurélien FOUCRET <aurelien.foucret@gmail.com>
2025-06-09 18:55:49 +02:00
Kathleen DeRusso
5d22ad6874
Add clarification to semantic_text documentation on default quantization and lexical search support (#128927)
* Add clarifications to semantic text documentation

* Regnerate match ESQL docs

* Fix whitespace

* PR feedback

* Update docs/reference/elasticsearch/mapping-reference/semantic-text.md

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-06-06 15:01:50 +02:00
Kathleen DeRusso
eee423aaa0
[ES|QL] Add MATCH_PHRASE (#127661)
* Initial commit of match_phrase

* Add MatchPhraseQueryTests

* First pass at CSV specs

* Update docs/changelog/127661.yaml

* Refactor so MatchPhrase doesn't use all fulltext test cases, just text only

* Fix tests

* Add some CSV test cases

* Fix test

* Update changelog

* Update tests

* Comment out MATCH_PHRASE in search-functions Markdown

* Minor PR feedback

* PR feedback - refactor/consolidate code

* Add some more tests

* Fix some tests

* [CI] Auto commit changes from spotless

* Fix tests

* PR feedback - add tests, support boost and numeric data

* Revert "PR feedback - add tests, support boost and numeric data"

This reverts commit 4e7a699e3e.

* Apply testing/PR feedback outside numeric support only

* Regenerate docs

* Add negative test

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>

* PR feedback

* Fix auto-commit error

* Regenerate docs

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

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

* Remove non text field types

* Fake test data

* Remove tests that no longer should pass without ip/date/version support

* Put real data in score tests now that I was able to engineer a failure

* Realized the scoring test might be flakey because how it was written, updated

* PR feedback

* PR feedback

* [CI] Auto commit changes from spotless

* Add check to MatchPhrase tests

* Fix merge errors

* [CI] Auto commit changes from spotless

* Test generated docs

* Add additional verifier tests

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-06-04 12:32:24 -04:00
mbivert-ipsos
aa0a829a08
[DOCS] Fix missing spaces (#128550) 2025-06-04 18:59:42 +03:00
Craig Taverner
11f0c5526a
ES|QL Support for ST_GEOHASH, ST_GEOTILE and ST_GEOHEX (#125143)
Added support for the three primary scalar grid functions:
* `ST_GEOHASH(geom, precision)`
* `ST_GEOTILE(geom, precision)`
* `ST_GEOHEX(geom, precision)`

As well as versions of these three that take an optional `geo_shape` boundary (must be a `BBOX` ie. `Rectangle`).

And also supporting conversion functions that convert the grid-id from long to string and back to long.

This work represents the core of the feature to support geo-grid aggregations in ES|QL.
2025-06-03 11:49:34 +02:00
Ioana Tagirta
abf5f00413
Document boost option for match_phrase (#128738) 2025-06-02 11:57:03 +02:00
Nik Everett
1b151eda4b
ESQL: Compute engine support for tagged queries (#128521)
Begins adding support for running "tagged queries" to the compute
engine. Here, it's just the `LuceneSourceOperator` because that's
useful and contained.

Example time! Say you are running:
```
FROM foo
| STATS MAX(v) BY ROUND_TO(g, 0, 100, 1000, 100000)
```

It's *often* faster to run this as four queries:
* The docs that round to `0`
* The docs that round to `100`
* The docs that round to `1000`
* The docs that round to `100000`

This creates an ESQL operator that can run these queries, one after the
other and attach those tags.

Aggs uses this trick and it's *way* faster when it can push down count
queries, but it's still faster when it pushes doc loading things. This
implementation in `LuceneSourceOperator` is quite similar to the doc
loading version in _search.

I don't have performance measurements yet because I haven't plugged this
into the language. In _search we call this `filter-by-filter` and enable
it when each group averages to more than 5000 documents and when there
isn't an `_doc_count` field. It's faster in those cases not to push. I
expect we'll be pretty similar.
2025-05-29 12:41:58 -04:00
Ioana Tagirta
55956d4029
Docs: Fix match_phrase docs for zero_terms_query (#128387) 2025-05-23 19:33:26 +02:00
Nik Everett
584c60e233
ESQL: Enable docs for ROUND_TO (#128378)
Plug the docs in for ROUND_TO.
2025-05-23 19:06:05 +02:00
Nik Everett
dd180be55d
ESQL: Fix docs for ROUND_TO (#128382)
The examples included a filter we use for testing by mistake.
2025-05-24 01:28:29 +10:00
Nik Everett
45bfaab448
ESQL: ROUND_TO function (#128278)
Creates a `ROUND_TO` function that rounds it's input to one of the
provided values. Like so:
```
ROUND_TO(v, 0, 5000, 10000, 20000, 40000, 100000)

   v   | ROUND_TO
     0 | 0
   100 | 0
  6000 | 5000
 45001 | 40000
999999 | 100000
```

For some sequences of numbers you could do this with the `/` operator -
but for arbitrary sequences of numbers you needed `CASE` which is quite
slow. And hard to read!

Rewriting the example above would look like:
```
CASE (
  v <   5000,     0,
  v <  10000,  5000,
  v <  20000, 10000,
  v <  40000, 20000,
  v < 100000, 40000,
  100000
)
```

Even better, this is *fast*:
```
        (operation)  Mode  Cnt    Score   Error  Units
round_to_4_via_case  avgt    7  138.124 ± 0.738  ns/op
         round_to_4  avgt    7    0.805 ± 0.011  ns/op
         round_to_3  avgt    7    0.739 ± 0.011  ns/op
         round_to_2  avgt    7    0.651 ± 0.009  ns/op
         date_trunc  avgt    7    2.425 ± 0.018  ns/op
```

I've included a comparison to `DATE_TRUNC` above because we should be
able to rewrite `DATE_TRUNC` into `ROUND_TO` when we know the date range
of the index. This doesn't do it now, but it should be possible.
2025-05-23 10:14:30 -04:00
Nik Everett
b8e2fce60a
ESQL: Document VALUES uniques (#128157)
Documents that the VALUES aggregate function returns unique documents
and points folks to the TOP aggregate function if they want to keep
dupes.

Closes #128091


---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-05-22 15:50:29 +02:00
shmuelhanoch
db644e20c8
Added esql scalb function. (#127696)
Co-authored-by: Shmuel Hanoch <shmuel.hanoch@elastic.co>
2025-05-22 10:47:44 +03:00
Liam Thompson
960222e0dc
[DOCS] Make ESQL functions/operators/commands overview accordions open by default (#128197) 2025-05-21 12:08:04 +02:00
Fabrizio Ferri-Benedetti
d10ef76ba3
[DOCS] Replace irregular whitespaces in docs (#128199)
* Replace irregular whitespaces

* More chars
2025-05-20 16:20:22 +02:00
Ian Wagner
d4b387c015
Minor subject/verb agreement fix (#127955)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-05-13 12:59:42 +01:00
Craig Taverner
7d06f815f3
Initial kibana definition files for command, currently only providing License information (#127829)
Initial Kibana definition files for commands, currently only providing License information. We leave the license field out if it works with BASIC, so the only two files that actually have a license line are:

* CHANGE_POINT: PLATINUM
* RRF: ENTERPRISE
2025-05-08 09:39:34 +02:00
Jan Kuipers
9cf2a64067
ES|QL SAMPLE aggregation function (#127629)
* ES|QL SAMPLE aggregation function

* [CI] Auto commit changes from spotless

* ThreadLocalRandom -> SplittableRandom

* Update docs/changelog/127629.yaml

* fix yaml test

* Add SampleTests

* docs + example

* polish code

* mark generated imports

* comment with algorith description

* use Randomness.get()

* close properly

* type checks

* reuse hash

* regen some files

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-05-08 08:01:53 +02:00
Alexander Spies
9e3ae5b224
ESQL: Document LU JOIN/MV_EXPAND not respecting SORT (#127718) 2025-05-07 10:59:48 +02:00
Craig Taverner
543aeb8c19
Output function signature license requirements to Kibana definitions (#127717)
Output function signature license requirements to Kibana definition files, and also test that this matches the actual licensing behaviour of the functions.

ES|QL functions that enforce license checks do so with the `LicenseAware` interface. This does not expose what that functions license level is, but only whether the current active license will be sufficient for that function and its current signature (data types passed in as fields). Rather than add to this interface, we've made the license level information test-only information. This means if a function implements LicenseAware, it also needs to add a method to its test class to specify the license level for the signature being called. All functions will be tested for compliance, so failing to add this will result in test failure. Also if the test license level does not match the enforced license, that will also cause a failure.
2025-05-07 10:02:17 +02:00
Arianna Laudazzi
1df4a90943
[Reference] Revisit query language landing page (#127632)
* Update query languauge landing page

* Update index.md

* Update docs/reference/query-languages/index.md

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-05-07 08:44:49 +02:00
Nik Everett
85027384f1
ESQL: Claim transport version to backport #124913 (#127616)
Claims a transport version in main that we will use to backport #124913
to 8.19.
2025-05-01 23:27:42 +02:00
Lisa Cawley
465ef17cba
[DOCS] Remove poor link in sql-index-frozen.md (#127543) 2025-04-30 07:59:35 -07:00
Liam Thompson
ba95390895
[DOCS][9.x] Fix tip placement in lookup-join.md (#127552)
h/t @alex-spies
2025-04-30 12:15:14 +02:00
Liam Thompson
32a4462dfe
[DOCS][9.x] Improve ESQL reference docs information architecture (#127248)
* [DOCS][9.0]  Improve ESQL reference docs IA

- reorganized es|ql reference documentation from flat list to logical hierarchy
- created three main sections: syntax reference , special fields, advanced operations
- renamed pages with more consistent and task-oriented titles
- aligned navigation titles with page content
- improved introductory text for each section
- used parallel phrasing for similar concepts
- clarified the relationship between reference docs and conceptual docs


Co-authored-by: Alexander Spies <alexander.spies@elastic.co>
2025-04-25 09:54:45 +02:00
Colleen McGinnis
08552f1c2e
[docs] Fix various syntax and rendering errors (#127062)
* fix syntax and rendering errors

* clean up

* fix versions

* more clean up

* more fixes

* more fixes

* more fixes
2025-04-24 17:57:03 +02:00
Liam Thompson
c4cba5a545
[DOCS] Update esql-lookup-join.md (#127306)
- I trimmed the KEEP query in my final iteration in https://github.com/elastic/elasticsearch/pull/127215 but neglected to update the query itself, only the response. This fixes that so the query matches the response.

- 🚘 I also updated the table response to match other ESQL response tables
2025-04-24 12:32:17 +02:00
Liam Thompson
2c2e9a5266
[DOCS][ESQL] Cleanup and cross-reference LOOKUP JOIN reference and landing pages (#127215)
* [DOCS][ESQL] Cleanup and cross-reference LOOKUP JOIN reference and landing pages

**lookup-join.md (syntax reference)**:
- removed tip formatting for simpler direct link to landing page
- improved parameter formatting and descriptions
- fixed template variable from `{esql}` to `{{esql}}`

**esql-lookup-join.md (landing page)**:
- added "compare with enrich" section header
- simplified "how the command works" with clearer parameter explanation
- added code example in how it works section
- improved image alt text for accessibility
- organized example section with better context and SQL comparison
- added dropdown for sample tables to reduce visual clutter
- added "query" subheading for clearer organization
- included reference to additional examples in command reference
- removed excessive whitespace

* Improve example, add setup code

replaced abstract employee/language example with security monitoring use case
added setup instructions for creating test indices
included sample data loading via bulk api
new practical query example joining firewall logs with threat data
simplified results output showing threat detection scenario
added note about left-join behavior
improved code comments and structure
added required index.mode: lookup setting info
2025-04-23 13:22:42 +02:00
Charlotte Hoblik
838bb0bbd7
fix superscript (#127147) 2025-04-22 18:48:15 +02:00