Commit graph

3635 commits

Author SHA1 Message Date
Kostas Krikellas
417f3bb768
Parse the contents of dynamic objects for [subobjects:false] (#117762) (#117921)
* Parse the contents of dynamic objects for [subobjects:false]

* Update docs/changelog/117762.yaml

* add tests

* tests

* test dynamic field

* test dynamic field

* fix tests

(cherry picked from commit f2addbc69a)

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java
2024-12-04 06:27:21 +11:00
Quentin Pradet
1daa2731a3
Remove unsupported async_search parameters from rest-api-spec (#117626) (#117764) 2024-11-30 01:32:08 +11:00
Martijn van Groningen
7ed32c29a6
[8.17] Add source mode stats to MappingStats (#117697)
* Add source mode stats to MappingStats (#117463)

* update bwc logic for 8.17
2024-11-28 22:37:46 +11:00
Carlos Delgado
a9f4bf8b00
Fix and unmute synonyms tests using timeout (#117486) (#117517) 2024-11-26 07:41:13 +01:00
Nhat Nguyen
952df62bc2
Deprecate source mode in mappings (#117177) (#117527)
Backport of #116689 to 8.17

This change deprecates _source.mode in mappings, replacing it with
the index.mapping.source.mode index setting.
2024-11-25 20:26:52 -08:00
Quentin Pradet
9f2b8c6119
Add missing async_search query parameters to rest-api-spec (#117312) (#117477)
(cherry picked from commit 2f8bb0b23c)
2024-11-26 01:33:10 +11:00
Panagiotis Bailis
47c944977d
Adding missing json spec for allow_partial_search_results in point-in-time (#117242) 2024-11-21 16:58:35 +02:00
Martijn van Groningen
1bc60acdef
Revert "Deprecate _source.mode in mappings (#117106)" (#117151)
This reverts #117106. Bwc tests fail, because older nodes are killed with the following error:

```
[2024-11-20T10:54:58,600][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [v8.17.0-0] fatal error in thread [elasticsearch[v8.17.0-0
][clusterApplierService#updateTask][T#1]], exiting java.lang.AssertionError: provided source [{"_doc":{"_data_stream_timestamp":{"enabled":true},"_source":{},"properties":{"@timestamp":{"type":"date"},"k8s":{"properties":{"pod":{"properties":{"ip":{"type":"ip"},"name":{"type":"keyword"},"network":{"properties":{"rx":{"type":"long"},"tx":{"type":"long"}}},"uid":{"type":"keyword","time_series_dimension":true}}}}},"metricset":{"type":"keyword","time_series_dimension":true}}}}] differs from mapping [{"_doc":{"_data_stream_timestamp":{"enabled":true},"_source":{"mode":"synthetic"},"properties":{"@timestamp":{"type":"date"},"k8s":{"properties":{"pod":{"properties":{"ip":{"type":"ip"},"name":{"type":"keyword"},"network":{"properties":{"rx":{"type":"long"},"tx":{"type":"long"}}},"uid":{"type":"keyword","time_series_dimension":true}}}}},"metricset":{"type":"keyword","time_series_dimension":true}}}}]
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.index.mapper.DocumentMapper.<init>(DocumentMapper.java:66)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.index.mapper.MapperService.newDocumentMapper(MapperService.java:588)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.index.mapper.MapperService.updateMapping(MapperService.java:346)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.index.IndexService.updateMapping(IndexService.java:840)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.indices.cluster.IndicesClusterStateService.createIndicesAndUpdateShards(IndicesClusterStateService.java:583)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.indices.cluster.IndicesClusterStateService.doApplyClusterState(IndicesClusterStateService.java:306)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.indices.cluster.IndicesClusterStateService.applyClusterState(IndicesClusterStateService.java:260)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:544)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:530)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:503)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:432)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:157)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:956)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:218)
        at org.elasticsearch.server@9.0.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:184)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1575)
```

The `mode` parameter no longer gets serialized for new indices. However on the older nodes still serialize the `mode` parameter, which caused the menioned assertion to fail. Reverting for now and see how best to address this bwc serialization issue.

We can only stop serializing mode, when all nodes are on the same version.  Unfortunately we can't invoke `c.clusterTransportVersion().get()` from parser or builder, because that calling thread isn't allowed to call `clusterService.state()`.
2024-11-20 13:39:07 +01:00
Nhat Nguyen
e63367eaec
Deprecate _source.mode in mappings (#116689) (#117106)
This change deprecates _source.mode in mappings, replacing it with the
index.mapping.source.mode index setting.
2024-11-20 17:51:22 +11:00
Kostas Krikellas
f2178e24f4
Rename tsdb integration test (#116909) (#116913)
The current name doesn't allow skipping it to workaround compatibility
test failures:

```
> Task :rest-api-spec:yamlRestCompatTestTransform FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rest-api-spec:yamlRestCompatTestTransform'.
> class com.fasterxml.jackson.databind.node.ObjectNode cannot be cast to class com.fasterxml.jackson.databind.node.ArrayNode (com.fasterxml.jackson.databind.node.ObjectNode and com.fasterxml.jackson.databind.node.ArrayNode are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @15eaac09)
```
2024-11-18 20:46:22 +11:00
Carlos Delgado
1c299fd7e9
Synonyms test fix - update number of shards (#116224) (#116609)
(cherry picked from commit e59407251b)
2024-11-11 18:58:47 +01:00
Benjamin Trent
f14c8bd306
Add new multi_dense_vector field for brute-force search (#116275) (#116526)
This adds a new `multi_dense_vector` field that focuses on the maxSim
usecase provided by Col[BERT|Pali].

Indexing vectors in HNSW as it stands makes no sense. Performance wise
or for cost. However, we should totally support rescoring and
brute-force search over vectors with maxSim.

This is step one of many. Behind a feature flag, this adds support for
indexing any number of vectors of the same dimension.

Supports bit/byte/float.

Scripting support will be a follow up.

Marking as non-issue as its behind a flag and unusable currently.

(cherry picked from commit 7369c0818d)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-12 01:02:39 +11:00
Benjamin Trent
308ad0c05f
[8.x] Add docvalue_fields Support for dense_vector Fields (#114484) (#116491)
* Add `docvalue_fields` Support for `dense_vector` Fields (#114484)

Currently dense_vector field don't support docvalue_fields.

This add this support for debugging purposes. Users can inspect
row values of their vectors even if the source is disabled.

Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
(cherry picked from commit c8a8d4d931)

* fixing for backport

---------

Co-authored-by: Rassyan <yjkhngds@gmail.com>
2024-11-09 08:15:13 +11:00
Quentin Pradet
e76f73ba5f
Add missing header in put_data_lifecycle rest-api-spec (#116292) (#116370) 2024-11-07 14:50:00 +11:00
Kostas Krikellas
01d92b5f31
Track source for objects and fields with [synthetic_source_keep:arrays] in arrays as ignored (#116065) (#116225)
* Track source for objects and fields with [synthetic_source_keep:arrays] in arrays as ignored

* Update TransportResumeFollowActionTests.java

* rest compat fixes

* rest compat fixes

* update test

(cherry picked from commit 6cf45366d5)

# Conflicts:
#	rest-api-spec/build.gradle
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.create/21_synthetic_source_stored.yml
#	server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java
2024-11-05 19:58:25 +11:00
Kostas Krikellas
2439869034
[8.x] [TEST] Replace _source.mode with index.mapping.source.mode in integration tests - take 2 (#116072) (#116161)
* [TEST] Replace _source.mode with index.mapping.source.mode in integration tests - take 2 (#116072)

* Reapply "[TEST] Replace _source.mode with index.mapping.source.mode in integra…" (#116069)

This reverts commit e8bf344a28.

* [TEST] Replace _source.mode with index.mapping.source.mode in integration tests

* add reason

* add reason

* spotless

* revert unneeded

(cherry picked from commit 4573ab8ec1)

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

* Update MapperFeatures.java
2024-11-04 19:45:47 +11:00
Oleksandr Kolomiiets
06d003bee3
ignore_above default to 8191 for logsdb (#113442) (#116122)
(cherry picked from commit 521e4341d7)
2024-11-02 10:03:16 -07:00
Salvatore Campagna
0ad1a4a631
Default LogsDB value for ignore_dynamic_beyond_limit (#115921)
When ingesting logs, it's important to ensure that documents are not dropped due to mapping issues, also when dealing with dynamically mapped fields. Elasticsearch provides two key settings that help manage the total number of field mappings and handle situations where this limit might be exceeded:

1. **`index.mapping.total_fields.limit`**: This setting defines the maximum number of fields allowed in an index. If this limit is reached, any further mapped fields would cause indexing to fail.

2. **`index.mapping.total_fields.ignore_dynamic_beyond_limit`**: This setting determines whether Elasticsearch should ignore any dynamically mapped fields that exceed the limit defined by `index.mapping.total_fields.limit`. If set to `false`, indexing will fail once the limit is surpassed. However, if set to `true`, Elasticsearch will continue indexing the document but will silently ignore any additional dynamically mapped fields beyond the limit.

To prevent indexing failures due to dynamic mapping issues, especially in logs where the schema might change frequently, we change the default value of **`index.mapping.total_fields.ignore_dynamic_beyond_limit` from `false` to `true` in LogsDB**. This change ensures that even when the number of dynamically mapped fields exceeds the set limit, documents will still be indexed, and additional fields will simply be ignored rather than causing an indexing failure.

This adjustment is important for LogsDB, where dynamically mapped fields may be common, and we want to make sure to avoid documents from being dropped.
2024-10-31 15:54:54 +01:00
Kostas Krikellas
1151ef42f4
Add missing required feature to yaml tests. (#116009)
Fixes #115910, #115911, #115912
2024-10-31 15:38:26 +02:00
Stanislav Malyshev
99196cb212
Fix CCS stats test (#115801) (#115965)
Set index stats to be refreshed immediately - cached 0 size may be the
reason why it fails.

Fixes #115600

(cherry picked from commit 5f4e681788)

# Conflicts:
#	muted-tests.yml
2024-10-31 05:01:15 +11:00
Kostas Krikellas
2aa7a0f5b6
[8.x] Use flattened names in ignored source (#115822) (#115898)
* Use flattened names in ignored source (#115822)

* Use flattened names in ignored source

* spotless

* fix rest compat

* fix unittests

* expand dots

(cherry picked from commit 06eb0727c2)

# Conflicts:
#	rest-api-spec/build.gradle

* Update 20_synthetic_source.yml

* Update 21_synthetic_source_stored.yml
2024-10-30 19:30:05 +11:00
John Wagster
f2914e9a34
[CI] MixedClusterClientYamlTestSuiteIT test {p0=range/20_synthetic_source/Date range} failing - Removed Old Date range test because it's not longer validating useful code - 8x (#115671)
* removing vestigial 'Date range' test

* removing vestigial 'Date range' test

* removing vestigial 'Date range' test
2024-10-26 03:01:19 +11:00
Nhat Nguyen
6c884e7477
[8.x] Add lookup index mode (#115143) (#115596)
* Add lookup index mode (#115143)

This change introduces a new index mode, lookup, for indices intended 
for lookup operations in ES|QL. Lookup indices must have a single shard
and be replicated to all data nodes by default. Aside from these
requirements, they function as standard indices. Documentation will be
added later when the lookup operator in ES|QL is implemented.

* default shard

* minimal

* compile
2024-10-25 12:43:42 +11:00
Oleksandr Kolomiiets
86bcb99246
[8.x] Apply workaround for synthetic source of object arrays inside nested objects (#115275) (#115467)
* Apply workaround for synthetic source of object arrays inside nested objects (#115275)

(cherry picked from commit f04bf5c356)

# Conflicts:
#	rest-api-spec/build.gradle
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.create/21_synthetic_source_stored.yml

* Fix merge
2024-10-23 17:23:48 -07:00
Stanislav Malyshev
8678c6d6da
Fix test - times can be 0 sometimes (#115260) (#115268)
(cherry picked from commit ffcd62e32b)
2024-10-22 06:21:22 +11:00
Oleksandr Kolomiiets
682ed39b21
Remove IndexMode#isSyntheticSourceEnabled (#114963) (#115144)
(cherry picked from commit 16bde51891)

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java
2024-10-18 15:44:40 -07:00
Benjamin Trent
ffc4575d83
Adjust index creation for dense vector telemetry tests (#114857)
In 8.x we need to have bwc back to when before `element_type: byte`
existed. To prevent loss of coverage for past versions & telemetry, here
I move the index creation around so that we only create with `byte` when
we have the more recent telemetry changes (and thus also `byte`
elements).

closes: https://github.com/elastic/elasticsearch/issues/114556
2024-10-17 00:52:58 +11:00
Oleksandr Kolomiiets
17022fdefc
[8.x] Allow stored source in logsdb and tsdb (#114454) (#114648)
* Allow stored source in logsdb and tsdb (#114454)

(cherry picked from commit a62228a744)

# Conflicts:
#	modules/aggregations/build.gradle
#	modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/logsdb/LogsIndexModeCustomSettingsIT.java
#	rest-api-spec/build.gradle

* Fix tests

* Fix tests

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-15 12:07:27 -07:00
Niels Bauman
b96d3cbbf9
Mark Data Stream Lifecycle APIs to stable (#114780) (#114843)
Data Stream Lifecycle has GA'ed in 8.14, so we can safely mark these as
stable.
2024-10-16 03:19:28 +11:00
Benjamin Trent
64e8f2ac9c
[8.x] Adding new bbq index types behind a feature flag (#114439) (#114783)
* Adding new bbq index types behind a feature flag (#114439)

new index types of bbq_hnsw and bbq_flat which utilize the better binary quantization formats. A 32x reduction in memory, with nice recall properties.

(cherry picked from commit 6c752abc23)

* spotless
2024-10-15 07:04:19 -04:00
Kostas Krikellas
db9a125f39
[8.x] Guard second doc parsing pass with index setting (#114649) (#114799)
* Guard second doc parsing pass with index setting (#114649)

* Guard second doc parsing pass with index setting

* add test

* updates

* updates

* merge

(cherry picked from commit 98e0a4e953)

* Update 21_synthetic_source_stored.yml
2024-10-15 20:47:40 +11:00
Benjamin Trent
a5e0226836
Fix Synthetic Source Handling for bit Type in dense_vector Field (#114407) (#114756)
**Description:**

This PR addresses the issue described in [#114402](https://github.com/elastic/elasticsearch/issues/114402), where the `synthetic_source` feature does not correctly handle the `bit` type in `dense_vector` fields when `index` is set to `false`. The root cause of the issue was that the `bit` type was not properly accounted for, leading to an array that is 8 times the size of the actual `dims` value of docvalue. This mismatch will causes an array out-of-bounds exception when reconstructing the document.

**Changes:**

- Adjusted the `synthetic_source` logic to correctly handle the `bit` type by ensuring the array size accounts for the 8x difference in dimensions.
- Added yaml test to cover the `bit` type scenario in `dense_vector` fields with `index` set to `false`.

**Related Issues:**

- Closes [#114402](https://github.com/elastic/elasticsearch/issues/114402)
- Introduced in [#110059](https://github.com/elastic/elasticsearch/pull/110059)

Co-authored-by: Rassyan <yjkhngds@gmail.com>
2024-10-15 07:10:06 +11:00
Benjamin Trent
6a00e91b1c
Fixing test failure for #114556 (#114617) (#114632)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-15 07:06:06 +11:00
Kathleen DeRusso
df62bcfce1
Add a query rules tester API call (#114168) (#114747)
* Add a query rules tester API call

* Update docs/changelog/114168.yaml

* Wrap client call in async with origin

* Remove unused param

* PR feedback

* Remove redundant test

* CI workaround - add ent-search as ml dependency so it can find node features
2024-10-15 05:04:25 +11:00
Martijn van Groningen
9348d9fcb8
Add feature flag for subobjects auto (#114616) (#114678) 2024-10-13 05:08:41 +11:00
Joe Gallo
25ffc1526a
Support IPinfo database configurations (#114548) (#114663) 2024-10-12 09:15:57 +11:00
Pat Whelan
8da430bd6c
[ML] Add Streaming Inference spec (#113812) (#114262)
API for `/_inference/{task_type}/{inference_id}/_stream` and `/_inference/{inference_id}/_stream`

Request is `application/json`
Response is `text/event-stream`
2024-10-08 07:08:52 +11:00
Oleksandr Kolomiiets
bad8abebb6
Fix flattened ignore_above tests (#114155) (#114160)
This fixes tests so that they can work with multiple shards.
2024-10-05 04:30:09 +10:00
Oleksandr Kolomiiets
083a2bfb1e
[8.x] Fix features for synthetic source test (#114070) (#114082)
* Fix features for synthetic source test (#114070)

* Unmute test
2024-10-04 09:38:51 +10:00
Oleksandr Kolomiiets
4da7a0f338
Do not expand dots when storing objects in ignored source (#113910) (#114071)
(cherry picked from commit 7facc94be6)

# Conflicts:
#	rest-api-spec/build.gradle
2024-10-03 15:30:38 -07:00
Kostas Krikellas
faaf4ba7fd
[8.x] Add object param for keeping synthetic source (#113690) (#114058)
* Add object param for keeping synthetic source (#113690)

* Add object param for keeping synthetic source

* Update docs/changelog/113690.yaml

* fix merging

* add tests

* merge

* fix randomized tests

* add documentation

* dedup id in docs

* update documentation

* update documentation

* fix bwc

* fix bwc

* fix unintended

* Revert "fix bwc"

This reverts commit 18dc913eee.

* Revert "fix bwc"

This reverts commit f4ddb0e5e5.

* add missing test

* fix transform

* fix transform

* fix transform

* fix transform

* fix transform

(cherry picked from commit dd2024881d)

# Conflicts:
#	rest-api-spec/build.gradle

* Update build.gradle

* Update MapperFeatures.java

* Update 20_synthetic_source.yml

* Update 21_synthetic_source_stored.yml

* Update 21_synthetic_source_stored.yml

* Update 21_synthetic_source_stored.yml

* Update 21_synthetic_source_stored.yml
2024-10-04 08:08:44 +10:00
David Turner
b21b147bd0
Fix up test after backport of #113852 (#113883) (#113921)
This test skip is not needed any more.
2024-10-04 00:53:06 +10:00
Benjamin Trent
f057ff72c4
Add more dense_vector details for cluster stats field stats (#113607) (#113884)
This adds some more counts for dense_vector field mapping stats. This
allows for seeing the number of mappings with a given element type,
similarity, or index type.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-03 23:16:22 +10:00
Andrei Dan
4d7cd1335c
Skip compat test in 8.x (#113996)
Relates to https://github.com/elastic/elasticsearch/pull/112258
2024-10-03 19:19:13 +10:00
Kostas Krikellas
e5bebfe400
Remove special handling for objects and arrays with dynamic overrides (#113924) (#113959)
* Remove special handling for objects and arrays with `dynamic` overrides

* add test

* add test

(cherry picked from commit c840ea3812)
2024-10-02 19:28:01 +03:00
David Turner
b2d05e37e2
Reinstate support for GET _cluster/stats?timeout=... (#113852) (#113878)
Relates #112478
2024-10-02 02:38:45 +10:00
john-wagster
8a8ad1b815
updated rangetype to be more inline with the docs (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html) and added tests to reflect as much (#113872) 2024-10-02 01:40:55 +10:00
Chris Hegarty
45a08b94b3
Upgrade to Lucene 9.12.0 (#113333) (#113835)
This commit upgrades to Lucene 9.12.0.

Co-authored-by: Adrien Grand <jpountz@gmail.com>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
Co-authored-by: John Wagster <john.wagster@elastic.co>
Co-authored-by: Luca Cavanna <javanna@apache.org>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
2024-10-01 13:55:02 +01:00
Stanislav Malyshev
029cd94677
Implement remote cluster CCS telemetry (#112478) (#113814)
* Add remote cluster stats to _cluster/stats
* Implement remote cluster stats polling
* Add docs for the include_remotes part

(cherry picked from commit b26d81c713)
2024-10-01 04:52:59 +10:00
Kostas Krikellas
7b3d726eca
Revert "Apply auto-flattening to subobjects: auto (#112092)" (#113692) (#113760)
* Revert "Apply auto-flattening to `subobjects: auto` (#112092)"

This reverts commit fffe8844

* fix DataGenerationHelper

(cherry picked from commit c9f378da29)

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/DocumentParserContext.java
2024-09-30 18:19:26 +10:00