Commit graph

260 commits

Author SHA1 Message Date
Carlos Delgado
51b715f2bc
[8.18] Non existing synonyms sets do not fail shard recovery (#125659) (#125796) 2025-03-28 07:39:43 +01:00
Lorenzo Dematté
6e8074ed6f
[Entitlements] Instrumentation of NIO Files and Channels (#122816 and #122591) (#122986) (#122993)
* [Entitlements] Add check functions for NIO Files (#122591)

* [Entitlements] Instrumentation of NIO file channels (#122816)

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-02-20 20:45:01 +11:00
Ryan Ernst
3537349096
Rename environment dir accessors (#121803) (#121836)
* Rename environment dir accessors (#121803)

The node environment has many paths. The accessors for these currently use a "file" suffix, but they are always directories. This commit renames the accessors to make it clear these paths are directories.

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-02-06 10:28:25 +11:00
Rene Groeschke
6b7cd0339e
Update Gradle wrapper to 8.12 (#118683) (#119363)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions

(cherry picked from commit ba61f8c7f7)
2024-12-31 08:36:31 +01:00
Rene Groeschke
617644f781
[8.x] [Gradle] Remove static use of BuildParams (#115122) (#117436)
* [Gradle] Remove static use of BuildParams (#115122)

Static fields dont do well in Gradle with configuration cache enabled.

- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
-  Tweak testing doc

(cherry picked from commit 13c8aaeffa)

# Conflicts:
#	TESTING.asciidoc
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build.gradle
#	modules/ingest-geoip/qa/full-cluster-restart/build.gradle
#	qa/mixed-cluster/build.gradle
#	x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/eql/qa/rest/build.gradle
#	x-pack/plugin/fleet/qa/rest/build.gradle
#	x-pack/plugin/kql/build.gradle
#	x-pack/plugin/mapper-unsigned-long/build.gradle
#	x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle
#	x-pack/plugin/security/qa/multi-cluster/build.gradle
#	x-pack/plugin/sql/qa/jdbc/build.gradle
#	x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle

* fix merge issue

* Fix more merge conflicts

* Fix merge conflicts

* Update TESTING.asciidoc
2024-11-25 18:28:51 +01:00
John Wagster
e241221368
Provide access to new settings for HyphenationCompoundWordTokenFilter (#115585) (#116968)
Allow the new flags added in Lucene in the HyphenationCompoundWordTokenFilter

Adds access to the two new flags no_sub_matches and no_overlapping_matches.

Lucene issue: https://github.com/apache/lucene/issues/9231

Co-authored-by: Peter Straßer <peter.str@hotmail.de>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-20 08:39:58 +11:00
Benjamin Trent
91b4b1e4e4
char_filter pattern_replace error requires at least java 21 (#116507)
This test requires at least java 21, skip it otherwise.

closes: https://github.com/elastic/elasticsearch/issues/116405 closes:
https://github.com/elastic/elasticsearch/issues/116134
2024-11-12 01:05:38 +11:00
Benjamin Trent
6902296282
Deprecate dutch_kp and lovins stemmer as they are removed in Lucene 10 (#113143) (#113815)
Lucene 10 has upgraded its Snowball stemming support, as part of those
upgrades, two no longer supported stemmers were removed, `KpStemmer` and
`LovinsStemmer`. These are `dutch_kp` and `lovins`, respectively.

We will deprecate in 8.16 and will remove support for these in a future
version.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-02 01:57:10 +10:00
Benjamin Trent
da102fcc7d
[8.x] Add assertWarnings capabilities to base token stream test case (#113619) (#113688)
* Add assertWarnings capabilities to base token stream test case (#113619)

We need to be able to assert various warnings and check for such in
typical token stream tests. This adds that capability.

* fixing test

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-01 23:49:30 +10:00
YeonghyeonKo
cbce0a63b9
fix exception message when validating the name of tokenizer(edgeNGram) (#113257) 2024-09-26 13:51:19 +02:00
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -07:00
Quentin Pradet
707187d220
Extract deprecated PathHierarchy to own YAML test (#112647) 2024-09-09 18:27:36 +04:00
Quentin Pradet
ba8590ba13
Add analysis-common YAML tests to rest-resources-zip (#111974) 2024-08-19 18:57:39 +04:00
Mike Pellegrini
e11fa74333
Gracefully handle invalid synonym rules in updateable synonyms (#110901)
Gracefully handle invalid synonym rules by setting lenient to true by default when synonyms are updateable

---------

Co-authored-by: carlosdelest <carlos.delgado@elastic.co>
2024-08-06 10:44:23 -04:00
Benjamin Trent
14bce355e5
Actually deprecate edge_ngram side parameter (#110829)
this parameter has been "deprecated" for a while, but no action was
actually taken. This actually deprecates the value for future removal.
2024-07-17 03:51:27 +10:00
Benjamin Trent
d97cb686a5
Correct positioning for unique token filter (#109395)
This is an extension of:
https://github.com/elastic/elasticsearch/pull/35420

closes: https://github.com/elastic/elasticsearch/issues/35411
2024-06-22 09:44:24 +10:00
Aurélien FOUCRET
c93862f1bd
Wrap "Pattern too complex" exception into an IllegalArgumentException (#109173) 2024-05-31 18:02:54 +02:00
Simon Cooper
177dc263b3
Block specific config files from being accessed after startup (#107481)
Some files should never be accessed by ES or plugin code once startup has completed. Use the security manager to block these files from being accessed by anything at all. The current blocked files are elasticsearch.yml, jvm.options, and the jvm.options.d directory.
2024-04-29 09:58:12 +01:00
Moritz Mack
1f5e04b721
Migrate YAML REST tests to synthetic cluster feature check (#107068)
To simplify the migration away from version based skip checks in YAML specs, 
this PR adds a synthetic version feature `gte_vX.Y.Z` for any version at or before 8.14.0.

New test specs for 8.14 or later are expected to use respective new cluster features,
or a test-only feature supplied via ESRestTestCase#createAdditionalFeatureSpecifications
if sufficient.
2024-04-11 18:22:38 +02:00
Daniel
412f2f5617
New Lucene spanish plural stemmer (#106952)
Add Lucene SpanishPluralStemFilter based on apache/lucene#11284
2024-04-02 15:53:19 -04:00
William Brafford
d07651f8b9
Checkstyle: require braces around do, for, and while clauses (#103217)
* Checkstyle requires braces after for, do, while
2024-01-09 16:03:45 -05:00
Armin Braun
e20821f13e
Remove some more ActionType subclasses (#103055)
Cleaned up a few more of these.
2023-12-07 22:05:45 +01:00
Armin Braun
cdc83ad29b
Add shorthand for prepareIndex to test infrastructure (#101187)
Same as #101175, shorten `client().prepareIndex(index)` and
`client().prepareIndex().setIndex(index)` via a test utility.
Saves lots of code now and sets up some follow-up simplifcations.
2023-11-23 15:47:36 +01:00
Armin Braun
a9c286b25c
Collapse verbose .execute().actionGet() calls in tests (#102502)
Cleaning this up a little even though it's still quite horrible.
`.get()` in this API actually means `actionGet()` so to speak.
I think a good first step to cleaning this up is to at least reduce
the duplication though and save 1k lines.
2023-11-23 10:10:10 +01:00
Veljko Potparic
5f30563d6c
Add support for Serbian Language Analyzer (#100921)
Starting with Lucene Version 8.6, an Analyzer for the Serbian language is available. 
This change adds support for this to the analysis-common module.
2023-11-15 23:46:55 +01:00
John Verwolf
5f089296aa
Update tests to decrement ref count (#102044)
Part of the broader work covered in
https://github.com/elastic/elasticsearch/issues/102030

Updates tests in: - HighlighterWithAnalyzersTests.java -
TokenCountFieldMapperIntegrationIT - GeoIpDownloaderIT.java -
DataStreamIT.java
2023-11-10 18:18:43 -05:00
David Turner
e8450706bd
Remove Releasable interface from clients (#101850)
No `Client` implementations hold any resources, so they don't need to be
`Releasable`. This commit removes the unnecessary interface. As well as
removing the dead code, this change means that IDEs no longer warn about
calling `ESIntegTestCase#client()` outside of a try-with-resources
block.
2023-11-07 07:34:51 -05:00
David Turner
4a37aef80b
Deprecate ExternalTestCluster (#101844)
`ExternalTestCluster` doesn't really make sense now that the transport
client is removed. We only use it in the ML integ test suite and it'd be
good to avoid expanding its usage further, so this commit deprecates it
and removes the functionality in `ESIntegTestCase` that might quietly
switch to using it in a new test suite if running with certain system
properties.

Relates #49582
2023-11-06 14:30:07 -05:00
Brian Seeders
eb39d6f276
Update analysis-common module to use new rest test framework (#100719) 2023-10-30 13:42:25 -04:00
Simon Cooper
22381fd6a7
Refactor overrides of old Plugin.createComponents method to new services method (#101381) 2023-10-26 16:58:14 +01:00
Simon Cooper
3e2f17fe84
Refactor uses of old Plugin.createComponents method to new services method (#101376) 2023-10-26 15:34:11 +01:00
David Turner
9794c6e205
Use ESIntegTestCase#prepareSearch more (#101179)
The refactoring in #101175 only covered all the one-arg call sites. This
PR does the rest.
2023-10-20 18:33:00 +01:00
David Turner
1eda6ac74b
Extract ESIntegTestCase#prepareSearch (#101175)
Relates #101172
2023-10-20 06:18:58 -04:00
Ryan Ernst
8a1db8c6c3
Move index version constants to IndexVersions (#101094)
Similar to the TransportVersions holder class, IndexVersions is the new
place to contain all constants for IndexVersion. This commit moves all
existing constants to the new class. It is purely mechanical.
2023-10-19 20:44:51 -04:00
Armin Braun
bae6991fb3
Remove ~600 references to SearchResponse in tests (#100966)
We'd like to make `SearchResponse` reference counted and pooled but there are around 6k
instances of tests that create a `SearchResponse` local variable that would need to be
released manually to avoid leaks in the tests.
This does away with about 10% of these spots by adding an override for `assertHitCount`
that handles the actual execution of the search request and its release automatically
and making use of it in all spots where the `.get()` on the request build could be inlined
semi-automatically and in a straight-forward fashion without other code changes.
2023-10-17 15:43:36 +02:00
Przemyslaw Gomulka
eca41871aa
Use TelemetryProvider in Plugin::createComponents (#99737)
in order to avoid adding yet anther parameter to createComponents
a Tracer interface is replaced with TelemetryProvider.
this allows to get both Tracer and Metric (in the future) interfaces
2023-09-22 14:48:11 +02:00
Przemyslaw Gomulka
b6747b48ba
Rename tracing to telemetry package (#99710)
This commit renames the tracing to telemetry.tracing in both xpack/APM and elasticserach's org.elasticsearch.tracing.Tracer (the api)
the xpack/APM is renamed as follows:
org.elasticsearch.telemetry.apm - the only exported package
org.elasticsearch.telemetry.apm.settings - APMSettings
org.elasticsearch.telemetry.apm.tracing - APMTracer

org.elasticsearch.tracing.Tracer is moved to org.elasticsearch.telemetry.tracing.Tracer (responsible for majority of the changes in this PR)
2023-09-20 16:58:02 +02:00
Reza Torabi
310af09b6a
Add persian language stemmer (#99106) 2023-09-05 12:13:27 +01:00
Simon Cooper
e1f353c2cf
Convert even more index created version to IndexVersion (#99088) 2023-08-31 13:08:26 +01:00
Simon Cooper
041e94d2b0
More migrations of Version for index created version to IndexVersion (#98495) 2023-08-21 16:47:58 +01:00
Simon Cooper
a830787b07
Bulk migration of Version.CURRENT for index created to IndexVersion.current() (#98490) 2023-08-15 13:47:27 +01:00
Jim Ferenczi
28a504d7a1
Use the Weight#matches mode for highlighting by default (#96068)
This PR adapts the unified highlighter to use the Weight#matches mode by default when possible.
This is the default mode in Lucene for some time now. For cases where the matches mode won't work (nested and parent-child queries),
 the matches mode is disabled automatically.
I didn't expose an  option to explicitly disable this mode because that should be seen as an internal implementation detail.
With this change, matches that span multiple terms are highlighted together (something that users asked for years) and the clauses that don't match the document are ignored.
2023-08-09 10:44:38 +09:00
Carlos Delgado
8e64359fb1
Change cluster stats synonyms keys (#98126) 2023-08-04 17:28:12 +02:00
Carlos Delgado
c0a99baef5
Add synonyms sets information to cluster stats (#97900) 2023-07-27 21:25:24 +02:00
Carlos Delgado
375991d974
Remove synonyms feature flag and related classes (#97962) 2023-07-26 18:13:06 +02:00
Carlos Delgado
a5a7525e48
Synonyms - Prevent Synonym Set Delete when indices are using it (#97622) 2023-07-14 20:35:13 +02:00
Mayya Sharipova
321110ef52
Add synonyms feature for test clusters (#97658)
Fix for #97334 where incorrect feature name was provided.


Correct more instances of synonyms_feature_flag_enabled for synonyms_api_feature_flag_enabled


Closes #96641, #97177
2023-07-13 11:34:25 -04:00
Carlos Delgado
2412adf0fa
Fix synonyms API analyzers reloading (#97621) 2023-07-13 14:28:28 +02:00
Jim Ferenczi
bccf4eeed2
Add the ability to reload search analyzers during shard recovery (#97421)
This change adds the ability for reloadable search analysers to adapt their loading based on
the index creation context. It is useful for reloadable search analysers that need to load
expensive resources from indices or disk. In such case they can defer the loading of the
resource during the shard recovery and avoid blocking a master or a create index thread.
---------

Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
2023-07-07 17:19:47 +01:00
Simon Cooper
b6a4a7cded
Migrate preconfigured components and analyzer caches to IndexVersion (#97319) 2023-07-04 13:45:07 +01:00