Commit graph

181 commits

Author SHA1 Message Date
Panagiotis Bailis
b855266bd1
Make bbq_hnsw the default index option for dense-vector fields with more than 384 dimensions (#129825) 2025-06-24 12:20:16 +03:00
Carlos Delgado
968bddc462
Non existing synonyms sets do not fail shard recovery (#125659) 2025-03-27 18:04:20 +02:00
Luca Cavanna
05c8453b2b
Remove search throttled index setting and thread pool (#124519)
Frozen indices, the freeze index API and the private index.frozen setting have been removed with #120539.

There is also a search throttled thread pool that can now be removed, as well as a private search.throttled index settings that is no longer used as it could only be set internally by freezing an index.

While the index setting is private and can be removed, as it should no longer be present in any index on 9.0+ indices, the thread pool settings associated to the removed pool are still accepted as no-op in case users have customized them and are upgrading without removing these. These will also trigger a deprecating warning.

This change also removes the search.throttled related output from the thread pool section of the cluster info API.
2025-03-14 12:04:35 +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
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
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
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
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
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
Nhat Nguyen
7750cf5b94
Remove default auto_expand_replicas of lookup indices (#120073)
This change disables auto_expand_replicas on lookup indices to enhance 
the lookup join user experience. Users can, however, enable this setting
at any time to optimize performance.
2025-01-14 07:15:24 -08:00
Kostas Krikellas
5baf5af757
Configure index sorting through index settings for logsdb (#118968)
* Skip injecting `host.name` for incompatible mappings in logsdb mode

* spotless

* Update docs/changelog/118856.yaml

* fix tsdb

* Configure index sorting through index settings for logsdb

* fix synthetic source usage

* skip injecting host.name

* fix test

* fix compat

* more tests

* add index versioning

* add index versioning

* add index versioning

* minor refactoring

* Update docs/changelog/118968.yaml

* address comments

* inject host.name when possible

* check subobjects

* private settings
2025-01-10 13:22:54 +02:00
Benjamin Trent
c18b48dbd4
Apply default k for knn query eagerly (#118774)
When originally added, the knn query didn't apply `top-k` restrictions
to the query. Instead it would allow the resulting `num_candidate` to be
combined with sibling queries without restricting to `top-size` results
ahead of time.

This honestly is confusing behavior and leads to some bugs in understand
how it all works.

This commit addresses this by eagerly gathering only `size` results when
`k==null` before combining with other queries. 

To achieve the previous behavior, this can be done directly by setting
`k==num_candidates` in the query.
2025-01-08 07:40:34 +11:00
Svilen Mihaylov
93c349cc76
Add ability to set "max_analyzed_offset" implicitly to "index.highlight (#118895)
Add ability to set "max_analyzed_offet" implicitly to "index.highlight
.max_analyzed_offset", by setting it excplicitly to "-1".

Closes #112822
2025-01-07 11:19:07 -05:00
Kostas Krikellas
a7d344ee10
[TEST] Clean up skipped tests in rest compat (#119627) 2025-01-07 21:06:56 +11:00
Rene Groeschke
5278159987
Reapply "[Build] Do not invalidate configuration cache when branch is switched (#118894)" (#119300) (#119325)
* Reapply "[Build] Do not invalidate configuration cache when branch is switched (#118894)" (#119300)

The original PR (#118894) has broken serverless.

* Fix gitinfo plugin for serverless usage

* Update buildscan git revision reference
2024-12-30 08:54:42 +01:00
Mark Vieira
9d0f08bedf
Revert "[Build] Do not invalidate configuration cache when branch is switched (#118894)" (#119300)
This reverts commit f9c6a6c0b2.
2024-12-27 10:05:53 +11:00
Rene Groeschke
f9c6a6c0b2
[Build] Do not invalidate configuration cache when branch is switched (#118894)
* [Build] Do not invalidate configuration cache when branch is switched
* Update build tools tests
* Update GitInfoValueSource.java
2024-12-23 14:51:33 +00:00
Kostas Krikellas
d80cbddc53
Add LogsDB option to route on sort fields (#116687)
* Add LogsDB option to route on sort fields

* fix encoding

* Update docs/changelog/116687.yaml

* tests

* tests

* tests

* fix mode

* tests

* tests

* tests

* add test

* fix test

* sync

* updates from review

* test fixes

* test fixes

* test fixes

* Move logic to SyntheticSourceIndexSettingsProvider

* fix test

* sync

* merge, no fallback

* comments

* fix test

* address comments

* address comments

* address comments

* Update x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/LogsdbIndexModeSettingsProvider.java

Co-authored-by: Martijn van Groningen <martijn.v.groningen@gmail.com>

* [CI] Auto commit changes from spotless

* update tests

* [CI] Auto commit changes from spotless

* update tests

* fix rest compat tests

---------

Co-authored-by: Martijn van Groningen <martijn.v.groningen@gmail.com>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2024-12-19 13:51:15 +02:00
Jim Ferenczi
6f261067f2
Add a generic rescorer retriever based on the search request's rescore functionality (#118585)
This pull request introduces a new retriever called `rescorer`, which leverages the `rescore` functionality of the search request.  
The `rescorer` retriever re-scores only the top documents retrieved by its child retriever, offering fine-tuned scoring capabilities.  

All rescorers supported in the `rescore` section of a search request are available in this retriever, and the same format is used to define the rescore configuration.  

<details>
<summary>Example:</summary>

```yaml
  - do:
      search:
        index: test
        body:
          retriever:
            rescorer:
              rescore:
                window_size: 10
                query:
                  rescore_query:
                    rank_feature:
                      field: "features.second_stage"
                      linear: { }
                  query_weight: 0
              retriever:
                standard:
                  query:
                    rank_feature:
                      field: "features.first_stage"
                      linear: { }
          size: 2
```

</details>

Closes #118327

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2024-12-18 19:47:12 +00:00
Carlos Delgado
d09d57db80
Fix BwC synonyms tests (#118691) 2024-12-17 09:14:50 +01:00
Benjamin Trent
5e859d9301
Even better(er) binary quantization (#117994)
This measurably improves BBQ by adjusting the underlying algorithm to an
optimized per vector scalar quantization.

This is a brand new way to quantize vectors. Instead of there being a
global set of upper and lower quantile bands, these are optimized and
calculated per individual vector. Additionally, vectors are centered on
a common centroid. 

This allows for an almost 32x reduction in memory, and even better
recall than before at the cost of slightly increasing indexing time.

Additionally, this new approach is easily generalizable to various other
bit sizes (e.g. 2 bits, etc.). While not taken advantage of yet, we may
update our scalar quantized indices in the future to use this new
algorithm, giving significant boosts in recall.

The recall gains spread from 2% to almost 10% for certain datasets with
an additional 5-10% indexing cost when indexing with HNSW when compared
with current BBQ.
2024-12-10 03:06:27 +11:00
Dimitris Rempapis
a514aad3c2
Fix/meta fields bad request (#117229)
400 rather a 5xx error is returned when _source / _seq_no / _feature / _nested_path / _field_names is requested, via fields
2024-12-03 10:58:20 +02:00
Nhat Nguyen
fe7818af04
Deprecate _source.mode in mappings (#117172)
Re-introduce #116689
2024-11-20 10:27:44 -08:00
Martijn van Groningen
ac06a84e0a
Revert "Deprecate _source.mode in mappings (#116689)" (#117150)
This reverts commit 0d7b90e22a, because of bwc testing failures.
2024-11-20 13:38:26 +01:00
Nhat Nguyen
0d7b90e22a
Deprecate _source.mode in mappings (#116689)
This change deprecates _source.mode in mappings, replacing it with the 
index.mapping.source.mode index setting.
2024-11-19 17:53:52 -08:00
Mayya Sharipova
f9c5bc0b06
Remove legacy params from range query (#116970)
Remove to, from, include_lower, include_upper range query params.
These params have been removed from our documentation in v. 0.90.4 (d6ecdec),
and got deprecated in 8.16 in #113286.
2024-11-19 15:18:31 -05:00
Kostas Krikellas
89bd58e04b
[TEST] Restore rest compat tests (#116229)
* 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

* Restore rest compat tests
2024-11-05 12:30:42 +02:00
Kostas Krikellas
6cf45366d5
Track source for objects and fields with [synthetic_source_keep:arrays] in arrays as ignored (#116065)
* 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
2024-11-04 11:32:43 +01:00
Artem Prigoda
d93d333141
Remove checking of sync commit ids (#114246)
A Lucene commit doesn't contain sync ids `SegmentInfos` anymore, so we can't rely on them during recovery. The fields was marked as deprecated in #102343.
2024-11-01 16:18:12 +01:00
Kostas Krikellas
06eb0727c2
Use flattened names in ignored source (#115822)
* Use flattened names in ignored source

* spotless

* fix rest compat

* fix unittests

* expand dots
2024-10-29 20:12:43 +01:00
Artem Prigoda
ef2cf37a6d
Revert "Don't return or accept node_version in the Desired Nodes API (#114580)" (#115829)
This reverts commit c64226c350.
2024-10-29 12:03:19 +01:00
Artem Prigoda
c64226c350
Don't return or accept node_version in the Desired Nodes API (#114580)
It was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0

The Desired Nodes API is an internal API, and users shouldn't depend on its backward compatibility.
2024-10-24 18:19:14 +02:00
Pete Gillin
d7a9575d03
Remove deprecated local parameter from alias APIs (#115393)
This removes the `local` parameter from the `GET /_alias`, `HEAD /_alias`, and `GET /_cat/aliases` APIs. This option became a no-op and was deprecated in 8.12 by https://github.com/elastic/elasticsearch/pull/101815.

We continue to accept the parameter (deprecated, with no other effect) in v8 compatibility mode for `GET /_alias` and `HEAD /_alias`. We don't do this for `GET /_cat/aliases` where the [compatibility policy does not apply](https://github.com/elastic/elasticsearch/blob/main/REST_API_COMPATIBILITY.md#when-not-to-apply).
2024-10-24 15:58:24 +01:00
Oleksandr Kolomiiets
f04bf5c356
Apply workaround for synthetic source of object arrays inside nested objects (#115275) 2024-10-23 13:22:26 -07:00
Luca Cavanna
8efd08b019
Upgrade to Lucene 10 (#114741)
The most relevant ES changes that upgrading to Lucene 10 requires are:

- use the appropriate IOContext
- Scorer / ScorerSupplier breaking changes
- Regex automaton are no longer determinized by default
- minimize moved to test classes
- introduce Elasticsearch900Codec
- adjust slicing code according to the added support for intra-segment concurrency
- disable intra-segment concurrency in tests
- adjust accessor methods for many Lucene classes that became a record
- adapt to breaking changes in the analysis area

Co-authored-by: Christoph Büscher <christophbuescher@posteo.de>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: ChrisHegarty <chegar999@gmail.com>
Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Panagiotis Bailis <pmpailis@gmail.com>
Co-authored-by: Benjamin Trent <4357155+benwtrent@users.noreply.github.com>
2024-10-21 13:38:23 +02:00
Oleksandr Kolomiiets
16b86a61b1
Remove temporary mutes of compatibility tests (#115140) 2024-10-18 13:37:31 -07:00
Oleksandr Kolomiiets
a62228a744
Allow stored source in logsdb and tsdb (#114454) 2024-10-11 11:16:55 -07:00
Oleksandr Kolomiiets
353ab06655
Remove temporary compatibility test mutes (#114083) 2024-10-04 10:00:55 +10:00
Oleksandr Kolomiiets
7facc94be6
Do not expand dots when storing objects in ignored source (#113910) 2024-10-03 13:13:19 -07:00
Kostas Krikellas
dd2024881d
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
2024-10-03 21:19:04 +03:00
john-wagster
fbf62321ae
Updated Date Range to Follow Documentation When Assuming Missing Values - Remove Skip Tests After Backport (#113951)
* removed skip tests now that backports are in place

* removed skip tests now that backports are in place
2024-10-03 01:17:03 +10:00
john-wagster
0fbb3bcb45
Updated Date Range to Follow Documentation When Assuming Missing Values (#112258)
* 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
2024-10-01 09:21:47 -05:00
Jake Landis
888188695a
Bump compatible rest api version to 9/8 (#113151)
This commit bumps the REST API version from 8 to 9. This effectively removes all support for REST API 
compatibility with version 7 (though earlier commits already chipped away at some v7 support).

This also enables REST API compatibility support for version 8, providing support for v8 compatibility headers, 
i.e. "application/vnd.elasticsearch+json;compatible-with=8" and no-op support (no errors) to accept v9 
compatibility headers i.e. "application/vnd.elasticsearch+json;compatible-with=9".

see additional context in the GH PR #113151
2024-09-26 14:52:05 -05:00
Kostas Krikellas
b344493298
Rest skipped tests after backporting (#113591)
The skip test entries were added in
https://github.com/elastic/elasticsearch/pull/113584, no longer needed
after backporting it.
2024-09-26 21:57:31 +10:00
Kostas Krikellas
fffe8844e9
Apply auto-flattening to subobjects: auto (#112092)
* Introduce mode `subobjects=auto` for objects

* Update docs/changelog/110524.yaml

* compilation error

* tests and fixes

* refactor

* spotless

* more tests

* fix nested objects

* fix test

* update fetch test

* add QA coverage

* update tests

* update tests

* update tests

* Apply auto-flattening to `subobjects: auto`

* Update docs/changelog/112092.yaml

* sync

* dont flatten subobjects auto

* refine test

* fix path for nested flattened objects and dynamic

* document `subobjects: auto`

* Apply suggestions from code review

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>

* comment updates

* restore indentation in comment

* update comment

* update comment

* update comment

* update comment

* rename isFlattenable

* add test for dynamic template

* fix copy_to and noop dynamic updates

* tests

* update comment

* fix tests

* update cluster feature in yaml test

* address comments

---------

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>
2024-09-26 11:42:40 +03:00