Commit graph

3763 commits

Author SHA1 Message Date
Benjamin Trent
a1ee3c9291
Have create index return a bad request on poor formatting (#123761)
closes: https://github.com/elastic/elasticsearch/issues/123661
2025-03-07 04:24:54 +11:00
Jonathan Buttner
2a006ec1f4
Updating description of stream API (#124209) 2025-03-06 15:34:21 +01:00
Jonathan Buttner
3a472ebae9
[ML] Update inference api rest spec (#124151)
* Pulling api spec changes

* Fixing test and updating code javadoc
2025-03-06 08:26:49 -05:00
Benjamin Trent
a92b1d6892
Adjust exception thrown when unable to load hunspell dict (#123743)
On index creation, its possible to configure an hunspell analyzer, but
reference a locale file that actually doesn't exist or isn't accessible.

This error, like our other user dictionary errors, should be an IAE not
an ISE.

closes: https://github.com/elastic/elasticsearch/issues/123729
2025-03-06 06:19:21 +11:00
David Kyle
c3e7493d7a
[ML] Remove deprecated routes for ml trained models APIs (#124019)
The 7.x routes for ml trained models _ml/inference/ have been deprecated
since 8 and replaced with _ml/trained_models. Also removes query 
parameters that are no longer supported.
2025-03-05 16:09:37 +00:00
Martijn van Groningen
26de5343a2
Remove synthetic recovery source feature flag. (#122615)
This feature flag controls whether synthetic recovery source is enabled by default when the source mode is synthetic.

The synthetic recovery source feature itself is already available via the index.recovery.use_synthetic_source index setting and can be enabled by anyone using synthetic source.

The default value of index.recovery.use_synthetic_source setting defaults to true when index.mapping.source.mode is enabled. The index.mapping.source.mode default to true if index.mode is logsdb or time_series.

In other words, with this change synthetic recovery source will be enabled by default for logsdb and tsdb.

Closes #116726
2025-03-05 15:43:33 +01:00
Rene Groeschke
496c38e5a5
Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896)
This reverts commit 36660f2e5f.
2025-03-05 08:02:13 +01:00
Rene Groeschke
36660f2e5f
Revert "Update Gradle wrapper to 8.13 (#122421)" (#123889)
This reverts commit e19b2264af.
2025-03-03 15:51:07 +01:00
Rene Groeschke
e19b2264af
Update Gradle wrapper to 8.13 (#122421)
* Fix Gradle Deprecation warning as declaring an is- property with a Boolean type has been deprecated.
* Make use of new layout.settingsFolder api to address some cross project references
* Fix buildParams snapshot check for multiprojet projects
2025-03-03 14:10:00 +01:00
Kathleen DeRusso
ae6474db63
Deprecate Behavioral Analytics CRUD apis (#122960)
* Deprecate Behavioral Analytics CRUD APIs

* Add allowed warning for REST Compatibility tests

* Update docs/changelog/122960.yaml

* Update changelog

* Update docs to add deprecation flags and fix failing tests

* Update changelog

* Update changelog again

* Update docs formatting

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

* Skip asciidoc test

---------

Co-authored-by: Efe Gürkan YALAMAN <efeyalaman@gmail.com>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
2025-02-25 16:02:50 +01:00
Samiul Monir
5664f4f2ba
Improved error message when index field type is unknown (#122860)
* Updating error message when index field type is unknown

* Fix style issue

* Add yaml test for invalid field type error message

* Update docs/changelog/122860.yaml

* Updating error message for runtime and multi field type parser

* add and fix yaml tests

* Fix code styles by running spotlessApply

* Update changelog

* Updatig the test in yml

* Updating error message for runtime

* Fix failing yaml tests

* Update error message to Fix unit tests

* fix serverless qa test

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-24 13:16:22 -05:00
Quentin Pradet
17ed01471b
Add missing body to ML rest-api-spec API (#123235) 2025-02-24 19:56:01 +04:00
Quentin Pradet
d8284fba1a
Fix cat APIs query parameters (#123020) 2025-02-21 14:46:05 +04:00
Martijn van Groningen
43665f0a35
Store arrays offsets for keyword fields natively with synthetic source (#113757)
The keyword doc values field gets an extra sorted doc values field, that encodes the order of how array values were specified at index time. This also captures duplicate values. This is stored in an offset to ordinal array that gets zigzag vint encoded into a sorted doc values field.

For example, in case of the following string array for a keyword field: ["c", "b", "a", "c"].
Sorted set doc values: ["a", "b", "c"] with ordinals: 0, 1 and 2. The offset array will be: [2, 1, 0, 2]

Null values are also supported. For example ["c", "b", null, "c"] results into sorted set doc values: ["b", "c"] with ordinals: 0 and 1. The offset array will be: [1, 0, -1, 1]

Empty arrays are also supported by encoding a zigzag vint array of zero elements.

Limitations:

currently only doc values based array support for keyword field mapper.
multi level leaf arrays are flattened. For example: [[b], [c]] -> [b, c]
arrays are always synthesized as one type. In case of keyword field, [1, 2] gets synthesized as ["1", "2"].
These limitations can be addressed, but some require more complexity and or additional storage.

With this PR, keyword field array will no longer be stored in ignored source, but array offsets are kept track of in an adjacent sorted doc value field. This only applies if index.mapping.synthetic_source_keep is set to arrays (default for logsdb).
2025-02-20 09:20:49 +01:00
Niels Bauman
618de4855d
Remove local param from field mapping API spec (#122922)
The `local` param for the `GetFieldMapping` API was deprecated in #55014
and I think #57265 aimed to propogate that deprecation to the REST API
spec, but it changed `get_mapping.json` instead of
`get_field_mapping.json`. #55100 removed the `local` param for the
_field_ mapping API so we can safely remove the field from the spec and
remove the YAML test.
2025-02-19 22:51:11 +01:00
David Turner
cd15d09adf
Fork post-snapshot-delete cleanup off master thread (#122731)
We shouldn't run the post-snapshot-delete cleanup work on the master
thread, since it can be quite expensive and need not block subsequent
cluster state updates. This commit forks it onto a `SNAPSHOT` thread.
2025-02-19 21:02:27 +11:00
Salvatore Campagna
780cac5a6d
Enable a sparse doc values index for @timestamp in LogsDB (#122161)
This PR extends the work done in #121751 by enabling a sparse doc values index for the @timestamp field in LogsDB.

Similar to the previous PR, the setting index.mapping.use_doc_values_skipper will override the index mapping parameter when all of the following conditions are met:

* The index mode is LogsDB.
* The field name is @timestamp.
* Index sorting is configured on @timestamp (regardless of whether it is a primary sort field or not).
* Doc values are enabled.

This ensures that only one index structure is defined on the @timestamp field:
* If the conditions above are met, the inverted index is replaced with a sparse doc values index.
* This prevents both the inverted index and sparse doc values index from being enabled together, reducing unnecessary storage overhead.

This change aligns with our goal of optimizing LogsDB for storage efficiency while possibly maintaining reasonable query latency performance. It will enable us to run benchmarks and evaluate the impact of sparse indexing on the @timestamp field as well.
2025-02-17 13:31:26 +01:00
Jordan Powers
53150881e9
Enable the use of nested field type with index.mode=time_series (#122224)
This patch removes the check that fails requests that attempt to use fields of type: nested within indices with mode time_series.

This patch also updates TimeSeriesIdFieldMapper#postParse to set the _id field on child documents once it's calculated.

Closes #120874
2025-02-13 09:33:04 -08:00
Benjamin Trent
f5c901e68c
Fix synthetic source bug that would mishandle nested dense_vector fields (#122425)
When utilizing synthetic source with nested fields, we attempt to
rebuild the child values in addition to all the parent values.

While this generally works well, its potential that certain values might
be missing from various child docs. Consequently, we will attempt to
iterate the vector values strangely, resulting in seemingly missing
values or potentially exceptions indicating EOFs.

closes: #122383
2025-02-13 08:20:13 +11:00
Martijn van Groningen
d93f9c4d58
Address synthetic recovery source release test failures. (#122035) 2025-02-07 13:02:27 -08:00
Artem Prigoda
885a5510e1
Don't return or accept node_version in the Desired Nodes API (#119049)
Re-submission of #114580

>  node_version was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0

Resolve ES-9443
2025-02-05 15:41:47 +01:00
Salvatore Campagna
6a526755de
Use synthetic recovery source by default if synthetic source is enabled (#119110)
We experimented with using synthetic source for recovery and observed quite positive impact
on indexing throughput by means of our nightly Rally benchmarks. As a result, here we enable
it by default when synthetic source is used. To be more precise, if `index.mapping.source.mode`
setting is `synthetic` we enable recovery source by means of synthetic source.

Moreover, enabling synthetic source recovery is done behind a feature flag. That would allow us 
to enable it in snapshot builds which in turn will allow us to see performance results in Rally nightly
benchmarks.
2025-02-05 13:55:51 +01:00
Benjamin Trent
2de1a3defe
Addressing int4 flat flakiness (#121437)
This simplifies the setup and relaxes the similarity check. 

We can restrict the similarity check once we evolve the quantization
algorithm in the future.
2025-02-05 09:34:26 +11:00
Niels Bauman
e27a50dead
Run TransportEnrichStatsAction on local node (#121256)
This action solely needs the cluster state, it can run on any node.
Additionally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.
2025-02-04 09:30:44 +10:00
Andrei Dan
44e5104af1
[TEST] wait for all active shards when indexing data (#121442)
This attempts to fix a flay test where the term_freq returned by the
multiple terms vectors API was `null`. I was not able to reproduce this
test but this proposes a fix based on the following running theory: - an
Elasticsearch cluster comprised of at least 2 nodes - we create a couple
of indices with 1 primary and 1 replica - we index a document that was
acknowledged only by the primary (because `wait_for_active_shards`
defaults to `1`) - the test executes the multiple terms vectors API and
it hits the node hosting the replica shard, which hasn't yet received
the document we ingested in the primary shard.

This race condition between the document replication and the test
running the terms vectors API on the replica shard could yield a `null`
value for the the term's `term_freq` (as the replica shard contains 0
documents).

This PR proposes we change the `wait_for_active_shards` value to `all`
so each write is acknowledged by all replicas before the client receives
the response.

Fixes #113325
2025-02-04 05:57:05 +11:00
Mayya Sharipova
f7901f0795
Support duplicate suggestions in completion field (#121324)
Currently if a document has duplicate suggestions across different
contexts, only the first gets indexed, and when a user tries to
search using the second context, she will get 0 results.

This PR addresses this, but adding support for duplicate suggestions
across different contexts, so documents like below with duplicate inputs
can be searched across all provided contexts.

```json
{
  "my_suggest": [
    {
      "input": [
        "foox",
        "boo"
      ],
      "weight" : 2,
      "contexts": {
        "color": [
          "red"
        ]
      }
    },
    {
      "input": [
        "foox"
      ],
      "weight" : 3,
      "contexts": {
        "color": [
         "blue"
        ]
      }
    }
  ]
}
```

Closes #82432
2025-01-31 13:58:14 -05:00
Carlos Delgado
67c2f41724
Fix serverless test - wait for index green just after first insertion (#121180) 2025-01-31 17:45:52 +01:00
Michael Peterson
3fafb5f161
Improve resolve/cluster yaml test (#121315)
Updated indices.resolve_cluster.json to match new resolve/cluster spec.

Added new test for the no-index-expression endpoint.

Adjust syntax in 10_basic_resolve_cluster.yml syntax fix so that the elasticsearch-specification validation tests pass.
2025-01-31 10:20:04 -05:00
Oleksandr Kolomiiets
1225b0720a
Fix propagation of dynamic mapping parameter when applying copy_to (#121109) 2025-01-31 00:26:58 +01:00
Kostas Krikellas
d32583cd80
[TEST] Clean up skipped tests in rest-compat mode (#121298)
* Skip tests in rest-compat that fail due to versioning issues

* Clean up skipped tests in rest-compat mode

* restore some

* restore some
2025-01-30 19:02:37 +02:00
Kostas Krikellas
329651a84c
Skip tests in rest-compat that fail due to versioning issues (#121282) 2025-01-30 16:48:40 +02:00
Chris Hegarty
4baffe4de1
Upgrade to Lucene 10.1.0 (#119308)
This commit upgrades to Lucene 10.1.0.
2025-01-30 13:41:02 +00:00
Svilen Mihaylov
748801eb57
Make test setup more reliable #121110
Make test setup more reliable
Resolves #119197
2025-01-29 18:29:42 -05:00
Niels Bauman
afdd45364a
Run TransportGetEnrichPolicyAction on local node (#121124)
This action solely needs the cluster state, it can run on any node.
Additionally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.
2025-01-29 23:58:14 +01:00
Oleksandr Kolomiiets
74f91780e0
Fix check for sort fields being in nested objects (#121084) 2025-01-29 21:03:47 +01:00
Parker Timmins
635a4c21de
Add docs for reindex data stream REST endpoints (#120653)
Add documentation for new REST endpoints related to data stream upgrade. 
Endpoints:
- /_migration/reindex
- /_migration/reindex/{index}/_status
- /_migration/reindex/{index}/_cancel
- /_create_from/{source}/{dest}
2025-01-28 19:44:56 -06:00
David Kyle
847b8ea2f4
[ML] Update Inference Update API documentation to use the correct PUT method (#121048) 2025-01-28 21:16:01 +00:00
Oleksandr Kolomiiets
8d057d89d7
Tweak copy_to handling in synthetic _source to account for nested objects (#120974) 2025-01-28 12:42:48 -08:00
David Turner
8f70713dd7
Add ?master_timeout to POST /_ilm/migrate_to_data_tiers (#120883)
Relates #107984
2025-01-28 22:14:57 +11:00
Moritz Mack
a608f0626e
Added query param ?include_source_on_error for ingest requests (#120725)
A new query parameter `?include_source_on_error` was added for create / index, update and bulk REST APIs to control
if to include the document source in the error response in case of parsing errors. The default value is `true`.
2025-01-28 09:33:22 +01:00
Mike Pellegrini
be8f51a370
Use new semantic text format by default (#120813) 2025-01-27 12:19:16 -05:00
Luigi Dell'Aquila
a0840a0463
EQL: set allow_partial_search_results=true by default (#120267) 2025-01-27 10:23:34 +00:00
Quentin Pradet
39c4eda6ce
Add back keep_alive to async_search.submit rest-api-spec (#120781) 2025-01-24 16:31:30 +04:00
Martijn van Groningen
cd10b05162
Turn _source meta fieldmapper's mode attribute into a no-op. (#119072)
Closes #118596
2025-01-24 09:25:55 +01:00
Carlos Delgado
8fc5a507c5
Simplify synonyms YAML tests after auto expand replicas changed (#120700) 2025-01-24 07:47:43 +01:00
Stanislav Malyshev
f27f74666f
ES|QL async queries: Partial result on demand (#118122)
Add capability to stop async query on demand
The theory:

- User initiates async search request
- User sends the stop request (POST _query/async/<ID>/stop)
- If the async is finished by that time, it's like regular async get
- If it's not finished, the sinks are closed and the request is forcefully finished
2025-01-23 10:21:52 -07:00
Quentin Pradet
455e0627f6
Move migrate APIs to rest-api-spec indices namespace (#120580) 2025-01-22 19:48:20 +04:00
Parker Timmins
f404da0f62
Add remove_index_block arg to _create_from api (#120548)
Add a new boolean parameter remove_index_blocks from the _create_from API.
If this parameter is set to true, all index block will be filtered out when creating the destination index.
2025-01-21 15:50:20 -06:00
Quentin Pradet
04358fa28b
Add rest-api-spec for unified inference API (#120447) 2025-01-21 16:30:57 +04:00
Kostas Krikellas
0a5d2e76a0
Merge field mappers when updating mappings with [subobjects:false] (#120370)
* Merge field mappers when updating mappings with [subobjects:false]

* Update docs/changelog/120370.yaml

* fix and add tests

* node feature guarding
2025-01-21 13:30:08 +02:00