Commit graph

14168 commits

Author SHA1 Message Date
Ignacio Vera
d39cc88bc2
Fix test configuration for merge policy in LatLonShapeDocValuesQueryTests and CartesianShapeDocValuesQueryTests (#112425) (#112428)
# Conflicts:
#	muted-tests.yml

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-03 00:40:10 +10:00
Simon Cooper
c867f6caf6
[8.15] Fix toReleaseVersion() when called on the current version id (#112242) (#112280)
Also includes fixes in #112284
2024-08-30 09:21:08 +01:00
Oleksandr Kolomiiets
dcba83954a
[8.15] Hide new test behind a feature (#112301) (#112317)
* Hide new test behind a feature (#112301)

(cherry picked from commit 0fe220a075)

# Conflicts:
#	muted-tests.yml
#	server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

* Update MapperFeatures.java
2024-08-29 07:37:22 -07:00
Armin Braun
d9f6887b44
Fix DLS over Runtime Fields (#112260) (#112318)
There is a DLS query referencing a runtime field loaded from _source, when we create the collector manager we retrieve the numDocs which triggers going through all segments and executing the script for each document. StoredFieldSourceProvider relies on leaf ordinals to build an array, but those ordinals are not populated when computing the numDocs via BaseCompositeReader, as that goes through the subreaders contexts, and not the context leaves (there is a subtle difference that bites us there).

Fixes #111637
2024-08-29 07:19:51 +02:00
Oleksandr Kolomiiets
00722864ef
Prevent synthetic field loaders accessing stored fields from using stale data (#112173) (#112257)
(cherry picked from commit 38adbb0724)

# Conflicts:
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.create/20_synthetic_source.yml
2024-08-28 09:16:28 +10:00
Lee Hinman
6fc00ad71e
Fix template alias parsing livelock (#112217) (#112245)
* Fix template alias parsing livelock

This commit fixes an issue with templates parsing alias definitions that can cause the ES thread to
hang indefinitely. Due to the malformed alias definition, the parsing gets into a loop which never
exits. In this commit a null check in both the component template and alias parsing code is added,
which prevents the looping.
2024-08-28 02:12:47 +10:00
Panagiotis Bailis
5255222d75
Updating retriever documentation to better explain how filters are applied (#112201) (#112207) 2024-08-27 00:07:43 +10:00
Ignacio Vera
b9eeebd582
Fix NPE when executing doc value queries over shape geometries with empty segments (#112139) (#112198)
Return empty scorer instead of null.
2024-08-26 20:47:42 +10:00
Kathleen DeRusso
dcd2462428
Semantic reranking should fail whenever inference ID does not exist (#112038) (#112153)
* Semantic reranking should fail whenever inference ID does not exist

* Short circuit text similarity reranking on empty result set

* Update tests

* Remove test - it doesn't do anything useful

* Update docs/changelog/112038.yaml
2024-08-24 01:52:02 +10:00
Oleksandr Kolomiiets
d626197d1a
Merge multiple ignored source entires for the same field (#111994) (#112116)
(cherry picked from commit a35da247fd)

# Conflicts:
#	modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/logsdb/qa/StandardVersusLogsIndexModeRandomDataChallengeRestIT.java
#	test/framework/src/main/java/org/elasticsearch/logsdb/datageneration/datasource/DefaultMappingParametersHandler.java
2024-08-23 07:53:21 -07:00
Nhat Nguyen
21bdf4dd0d
Fix DocValuesCodecDuelTests testDuel (#112084) (#112113)
We need to check the returned doc id from advance() before accessing the
values of the current document.

Closes #112082
2024-08-22 10:29:45 -07:00
Oleksandr Kolomiiets
63a3bd9396
Fix calculation of parent offset for ignored source in some cases (#112046) (#112064) 2024-08-21 10:26:17 -07:00
Oleksandr Kolomiiets
26bab001dc
Fix synthetic source for empty nested objects (#111943) (#111982)
(cherry picked from commit 19dc8841d4)
2024-08-20 07:47:32 -07:00
Kostas Krikellas
2f55a7fc8b
No error when store_array_source is used without synthetic source (#111966) (#112018)
* No error for store_array_source in standard mode

* Update docs/changelog/111966.yaml

* nested object test

* restore noop tests

* spotless fix

(cherry picked from commit 9ab8665235)
2024-08-20 22:08:49 +10:00
Kostas Krikellas
3cb4fc800b
Check for valid parentDoc before retrieving its previous (#112005) (#112007)
#111943 unveiled a bug in `collectChilder` where we attempt to collect
the previous doc of the parent, even when the parent doc has no previous
doc.

Fixes #111990, #111991, #111992, #111993
2024-08-20 19:32:47 +10:00
john-wagster
8ab481c71c
Explain Function Score Query 8.15 Backport (#111864)
* Explain Function Score Query (#111807)

allowing for a custom explanation to be passed through as part of supporting building a plugin with a custom script score; previously threw an npe

* updated test for 8.15.1
2024-08-15 08:49:08 -05:00
Keith Massey
51ea1d9772
[8.15] Fixing incorrect bulk request took time (#111863) (#111899) 2024-08-14 11:53:41 -05:00
Jim Ferenczi
7a31a4dbdd
Speed up dense/sparse vector stats (#111729) (#111787)
This change ensures that we don't try to compute stats on mappings that don't have dense or sparse vector fields. We don't need to go through all the fields on every segment, instead we can extract the vector fields upfront and limit the work to only indices that define these types.

Closes #111715
2024-08-12 10:58:26 +10:00
Kathleen DeRusso
3a4af4b3c7
[8.15] Fix NullPointerException when doing knn search on empty index without dims (#111756) (#111763)
* Fix NullPointerException when doing knn search on empty index without dims (#111756)

* Fix NullPointerException when doing knn search on empty index without dims

* Update docs/changelog/111756.yaml

* Fix typo in yaml test

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 4e26114764)

# Conflicts:
#	rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/40_knn_search.yml

* Update 40_knn_search.yml

* Yaml
2024-08-09 16:35:02 -04:00
Nik Everett
801e1b9f2a
Revert "Avoid bucket copies in Aggs (#110261)" (#111758) (#111761)
This reverts #110261 which we can't land until #111757 - we need to be
sure that the `equals` implementations on subclasses of
`InternalAggregations` is correct before this optimization is safe.

Closes #111679
2024-08-10 04:36:00 +10:00
elasticsearchmachine
4b8a1db810 Bump versions after 8.15.0 release 2024-08-09 15:32:55 +00:00
David Turner
4a6bcd8cde Fix testElectionSchedulingAfterDiscoveryOutage (#111629)
We need to wait a little longer to deal with the case that closing the
`PeerFinder` on the master triggers a disconnect, removing the third
node from the cluster, and requiring another round of discovery to
recover.

Closes #111155
2024-08-06 16:27:10 +01:00
Nhat Nguyen
1c02690ec9
Fix DocValuesCodecDuelTests (#111503) (#111515)
We should not access any docValues attribute of the current document if 
advance() is exhausted or if advanceExact() returns false.

Closes #111470
2024-08-02 00:40:41 +10:00
elasticsearchmachine
3e8c713c68 Bump versions after 7.17.23 release 2024-08-01 14:25:01 +00:00
Benjamin Trent
155eee6822
[8.15] Ensure vector similarity correctly limits inner_hits returned for nested kNN (#111363) (#111426)
* Ensure vector similarity correctly limits inner_hits returned for nested kNN (#111363)

For nested kNN we support not only similarity thresholds, but also
multi-passage search while retrieving more than one nearest passage.

However, the inner_hits retrieved for the kNN search would ignore the
restricted similarity. Meaning, the inner hits would return all
passages, not just the ones within the limited similarity and this is
confusing.

closes: https://github.com/elastic/elasticsearch/issues/111093
(cherry picked from commit 69c96974de)

* fixing for backport

* adj for backport

* fix compilation for tests
2024-07-29 18:25:45 -04:00
James Baiera
3f30e388fc
Fix enrich policy runner exception handling on empty segments response (#111290) (#111371)
* Fix enrich segment action listener exception logic

* Update docs/changelog/111290.yaml

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-30 07:27:37 +10:00
Max Hniebergall
fc352bd210
[Inference API] Replace model_id with inference_id in inference API except when stored (#111366) (#111417)
* Replace model_id with inference_id in inference API except when storing ModelConfigs

* Update docs/changelog/111366.yaml

* replace missed literals in tests
2024-07-29 13:35:48 -04:00
Pooya Salehi
7d8fe4a6cc
Update get snapshot status API doc (#111240) (#111295)
Make it clear that this API should be used only if the detailed shard
info is needed and only on ongoing snapshots. Remove incorrectly
mentioned `STATE` value.
2024-07-26 03:26:31 +10:00
Salvatore Campagna
aecc6e2cd8
[8.15] Rename logs index mode to logsdb (#111054) (#111098) 2024-07-19 16:26:13 +02:00
Joe Gallo
ff9a8eb705
[8.15] Directly download commercial ip geolocation databases from providers (#110844) (#111077)
Co-authored-by: Keith Massey <keith.massey@elastic.co>
2024-07-18 20:19:11 -04:00
Ignacio Vera
5846c231f1
Speed up collecting zero document string terms (#110922) (#111057)
Use segment ordinals when possible to collect zero document buckets
2024-07-19 01:18:54 +10:00
Salvatore Campagna
858440dd4b
[8.15] Inject host.name field without relying on (component) templates (#110938) (#111031)
* Inject `host.name` field without relying on (component) templates (#110938)

We do not want to rely on templates or component templates to include
the host.name field in indices using LogsDB. The host.name field is a field
we sort on by default when LogsDB is used. As a result, we just inject it
by default, the same way we do for the @timestamp field. This prevents
sorting errors due to missing host.name field in mappings.

The host.name is a keyword field and depending on the value of subobjects it will
be mapped as a name keyword nested inside a host or as a flat host.name keyword.
We also include ignore_above as we normally do for keywords in observability mappings.

* Enable missing hostname test
2024-07-18 13:52:49 +02:00
Armin Braun
47cdc55dce
Fix leak in collapsing search results (#110927) (#110939)
Fixing this case for now by enforcing unpooled to plug the leak, this
needs a little more work to function well pooled.
2024-07-17 03:32:53 +10:00
Simon Cooper
ef93c95227
Add a cluster listener to fix missing cluster features after upgrade (#110710) (#110924)
Non-master-eligible nodes that are already part of a cluster when the master is upgraded don't re-join the cluster, so their cluster features never get updated. This adds a cluster listener that spots this occurring, and manually gets the node's features with a new transport action and updates the cluster state after the fact.
2024-07-17 00:39:20 +10:00
Ryan Ernst
07c35b186a
Fix native preallocate to actually run (#110851)
Native preallocation has several issues, introduced in a refactoring for
8.13. First, the native allocator is never even tried, it always decides
to fall back to the Java setLength method. Second, the stat method did
not work correctly on all systems, see #110807. This commit fixes
native preallocate to properly execute on Linux, as well as MacOS. It
also adds direct tests of preallocation.

Note that this is meant as a bugfix for 8.15, so as minimal a change as
possible is made here. The code has completely changed in main. Some
things like the new test and fixes for macos will be forward ported to
main, but I did not want to make larger changes in a bugfix.
2024-07-15 15:57:40 -07:00
Michael Peterson
eb36da88f5
Revert "Search coordinator uses event.ingested in cluster state to do rewrites (#110352) (#110782)" (#110883)
This reverts commit 9092394b19.
2024-07-15 14:22:15 -04:00
Iraklis Psaroudakis
0fbde2c3fb
Do not write dangling indices in a test (#110867) (#110869)
So that the only expected disk write at the point of the assertion is from the bulk request. And not from the asynchronous runnable of updateDanglingIndicesInfo().

Fixes #110551
2024-07-15 22:55:07 +10:00
Michael Peterson
9092394b19
Search coordinator uses event.ingested in cluster state to do rewrites (#110352) (#110782)
Min/max range for the event.ingested timestamp field (part of Elastic Common
Schema) was added to IndexMetadata in cluster state for searchable snapshots
in #106252.

This commit modifies the search coordinator to rewrite searches to MatchNone
if the query searches a range of event.ingested that, from the min/max range
in cluster state, is known to not overlap. This is the same behavior we currently
have for the @timestamp field.
2024-07-11 12:01:08 -04:00
Ioana Tagirta
3ed5cd7dac
Fix issue with returning incomplete fragment for plain highlighter. (#110707) (#110756)
* Fix issue with noMatchSize for plain highlighter

* Update docs/changelog/110707.yaml
2024-07-12 00:28:59 +10:00
elasticsearchmachine
c683f6c4e9 Bump versions after 8.14.3 release 2024-07-11 14:17:00 +00:00
Keith Massey
eaa85b2702 Updating CloseIndexRequestTests to account for master term (#110611) 2024-07-11 08:36:38 +01:00
Chris Hegarty
a90ca3f10e
Implement xorBitCount in Elasticsearch (#110599) (#110626)
Backport of:  * #110599
2024-07-09 20:27:29 +10:00
Benjamin Trent
d0859d5902
Fix ExactKnnQueryBuilderTests testToQuery (#110357) (#110589) (#110608)
closes https://github.com/elastic/elasticsearch/issues/110357

With the loosening of what is considered a unit vector, we need to
ensure we only normalize for equality checking if the query vector is
indeed not a unit vector.

(cherry picked from commit fd790ff351)
2024-07-09 07:20:26 +10:00
David Turner
7b51ff6ba3 AwaitsFix for #110551 2024-07-08 08:20:11 +01:00
Mark J. Hoy
e24b0c9b5b
[Inference API] Add Amazon Bedrock support to Inference API (#110248) (#110545)
* Initial commit; setup Gradle; start service

* initial commit

* minor cleanups, builds green; needs tests

* bug fixes; tested working embeddings & completion

* use custom json builder for embeddings request

* Ensure auto-close; fix forbidden API

* start of adding unit tests; abstraction layers

* adding additional tests; cleanups

* add requests unit tests

* all tests created

* fix cohere embeddings response

* fix cohere embeddings response

* fix lint

* better test coverage for secrets; inference client

* update thread-safe syncs; make dims/tokens + int

* add tests for dims and max tokens positive integer

* use requireNonNull;override settings type;cleanups

* use r/w lock for client cache

* remove client reference counting

* update locking in cache; client errors; noop doc

* remove extra block in internalGetOrCreateClient

* remove duplicate dependencies; cleanup

* add fxn to get default embeddings similarity

* use async calls to Amazon Bedrock; cleanups

* use Clock in cache; simplify locking; cleanups

* cleanups around executor; remove some instanceof

* cleanups; use EmbeddingRequestChunker

* move max chunk size to constants

* oof - swapped transport vers w/ master node req

* use XContent instead of Jackson JsonFactory

* remove gradle versions; do not allow dimensions
2024-07-06 08:18:53 +10:00
elasticsearchmachine
23f4834faa Bump versions after 8.14.2 release 2024-07-04 09:46:59 +00:00
Simon Cooper
87d51181c9
Add some specific unit tests for ReservedClusterState methods (#110436) 2024-07-04 08:52:38 +01:00
Nick Tindall
7a8a7c0628
Improve mechanism for extracting the result of a PlainActionFuture (#110019)
Closes #108125
2024-07-04 12:26:56 +10:00
Max Hniebergall
1be0f2b5ae
Revert "[Inference API] Prevent inference endpoints from being deleted if the…" (#110446)
This reverts commit 89a1bd9c2d.
2024-07-03 17:27:12 -04:00
Max Hniebergall
89a1bd9c2d
[Inference API] Prevent inference endpoints from being deleted if they are referenced by semantic text (#110399)
Following on https://github.com/elastic/elasticsearch/pull/109123
2024-07-04 06:39:39 +10:00