Commit Graph

229 Commits

Author SHA1 Message Date
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
Ievgen Degtiarenko d9b6c5ae29
Wire IndicesService to plugins (#97081)
This change exposes IndicesService to the plugins via Plugin#createComponents
2023-06-27 18:02:23 +02:00
Mayya Sharipova 11a3104a8c
Auto-reload analyzers for specific resource (#96986)
This PR adds a new optional parameter "resource" for ReloadAnalyzersRequest.
If used, only analyzers that use this specific "resource" will be reload.
This parameter is not documented, for internal use only.

PR #96886 introduced auto-reload of analyzers on synonyms index change. The problem
was that reloading was applied broadly for all indices that contained reloadable
analyzers. This PR improves this, so when a particular synonyms set changes,
only analyzers that use this synonyms set  will auto-reloaded. Note that shard
requests will still be sent to all indices shards, as only on a shard we can
decide if analyzers need to be reloaded.
2023-06-22 13:09:45 -04:00
Carlos Delgado 75729363e2
Synonyms API - PUT Synonym Rule request (#96865) 2023-06-20 18:45:41 +02:00
Armin Braun 3f8ee82ef8
Use indices admin client shortcut in most integration tests (#96946)
Replacing the remaining usages that I could automatically replace
and a couple that I did by hand in this PR.
Also, added the same shortcut to the single node tests to save some
duplication there.
2023-06-20 13:32:59 +02:00
Mayya Sharipova b508ee7886
Auto-reload synonym analyzers on synonyms updates (#96886)
Synonym Management API project

On changes of synonyms in a synonym set, auto-reload analyzers.
Note that currently all updateable analyzers will be reloaded, even
those that are not relevant for a synonyms set being updated.
2023-06-19 10:50:02 -04:00
Mayya Sharipova 353f357f0b
Move reload analyzers to server (#96846)
This is need for Synonyms Management API project to be able
to auto-reload analyzers with synonyms on synonms change.
2023-06-14 18:09:24 -04:00
Simon Cooper 71c12262fb
Migrate index created version to IndexVersion (#96066) 2023-06-14 09:43:31 +01:00
Alan Woodward d927d1a9a7
Upgrade to new lucene snapshot 9.7.0-snapshot-41cd1f7a88c (#96741)
Notable changes:

* more efficient backwards reads in NIOFSDirectory
* faster merging when using soft deletes
* workaround security manager when using vector API
2023-06-12 09:13:58 +01:00
Marantidis Kiriakos a8cf4d6006
Add support for pattern replace filter in normalizers (#96588)
This change adds support for `pattern_replace` token filters use in custom normalizers. 

Closes #83005
2023-06-10 00:32:39 +02:00
Mayya Sharipova 8b628517a9
Load synonyms from system index for analyzers (#96674)
- Create a new option of "synonyms_set" for synonym set filter that
specifies which synonyms set to be loaded from the system ".synonyms" index
- On index creation for this option load synonyms set  from index
- If synonyms set doesn't exist, index creation request still succeeds, but
shards are not allocated, so the cluster state will be read.

Note: this is a temporary solution, as:
- No check is done on master node, as fake synonyms are provided
- On shard on index creation we use a blocking operation in the cluster applier thread
2023-06-08 11:07:47 -04:00
Carlos Delgado 39b7b5eb56
Synonym Mgmnt API: PUT request (#95895) 2023-05-31 10:48:56 +02:00
Christoph Büscher 222fc79e8b
Fix failing CommonAnalysisPluginTests testSystemSynonymsIndexName test (#96098)
The test should only run when the "synonyms_api" feature flag is set. This is
the case in snapshot build, but in release builds the flag is disabled, so we
need to skip checking for the existence of the synonyms system index then.

Closes #95840
2023-05-16 10:38:42 +02:00
Mayya Sharipova 07adeb0901
Create .synonyms system index (#95548)
Create .synonyms system index that is exposed
under es.synonyms_api_feature_flag.

This is the first task for creating Synonyms API management,
where synonyms will be stored in the .synonyms system index.

Relates to #38523
2023-04-27 14:11:08 -04:00
Mark Vieira ecd5f9e82c
Undo temporary local changes 2023-04-06 17:22:40 -07:00
Mark Vieira c75729ab76
Mute ScheduledEventsIT.testScheduledEvents 2023-04-06 17:16:06 -07:00
Rory Hunter fe1083f6c5
Upgrade spotless plugin to 6.17.0 (#94994)
Fixes #82794. Upgrade the spotless plugin, which addresses the issue
around formatting `instanceof` expressions. Formatting of statements
including lambdas seems to have improved too.
2023-04-04 10:03:32 +01:00
Armin Braun 49898d4a60
Remove most of o.e.c.i.Requests (#94266)
We don't have the transport client anymore and this was a questionable
class to begin with. Removing the pointless constructor wrappers and
deprecating it for removal. Mostly to save hundreds of LoC and make
tests a little more homogeneous.
2023-03-02 16:14:49 +01:00
Luca Cavanna 7b98f79efd
Move remaining analyzers to common analysis module (#93713)
This commit moves all the remaining analyzers except the standard analyzer from server to the common analysis module.

Relates to #23658
2023-02-13 10:02:25 +01:00
Christoph Büscher 6efa31fa5a
Add origin of synonym rules to exception message (#93702)
Currently, most failures to load a synonym file are wrapped into an IAE 
that doesn't contain much information about which origin the failure originates 
from (either the analyzer setting or the file name that contains the synonym
definition responsible for the error).
This change improves that situation by adding wither the analyzer or the file
name we try to load from to the exception message.
2023-02-10 16:19:57 +01:00
Ievgen Degtiarenko ad229dd70e
Update createComponents to supply AllocationService instead of AllocationDeciders (#92785) 2023-01-10 14:18:33 +01:00
Mark Vieira c2eda511de
Add JUnit rule based integration test cluster orchestration framework (#92379)
This commit adds a new test framework for configuring and orchestrating
test clusters for both Java and YAML REST testing. This will eventually
replace the existing "test-clusters" Gradle plugin and the build-time
cluster orchestration.
2022-12-21 15:33:46 -08:00
Przemyslaw Gomulka e1d897f00b
Register stable plugins in ActionModule (#90067)
Stable plugins are using @Extensible and @NamedComponents annotations
to mark components to be loaded.
This commit is loading extensible classNames from extensibles.json and
named components from named_components.json

relates #88980
2022-09-21 11:48:25 +02:00
Nikola Grcevski fc819609a1
Add allocation deciders in createComponents (#89836)
With this change we are adding the allocation deciders
in create components we can simplify the use in the
Autoscaling plugin and implement reserved state handler
in the future.
2022-09-07 09:28:07 -04:00
Rory Hunter 5c5981d27d
Introduce tracing interfaces (#87921)
Part of #84369. Split out from #87696. Introduce tracing interfaces in
advance of adding APM support to Elasticsearch. The only implementation
at this point is a no-op class.
2022-07-26 05:31:41 +09:30
Armin Braun 9d024bd981
Cleanup needless anonymous classes where lambdas suffice (#88154)
Cleaning up a couple more spots of these, saving some verbosity
and in some cases also some allocations.
2022-06-29 20:18:33 +02:00
Armin Braun eda1c511dd
Don't extend AbstractIndexComponent in AbstractCharFilterFactory (#88125)
Same as #88113 but for AbstractCharFilterFactory.
2022-06-28 14:51:51 +02:00
Armin Braun 02568210ba
Don't extend AbstractIndexComponent in AbstractTokenFilter (#88113)
No need for this extension, we don't make use of the settings or deprecation logger
in production any more. Also, this slows down CS operations that require a
temporary index service which builds quite a bit slower when the loggers
need to be set up via reflective calls.
2022-06-28 12:13:36 +02:00
Chris Hegarty 2b0b8af076
Modularize analysis-common (#87005)
This is change modularizes analysis-common, by adding a module-info.java
2022-05-22 15:13:36 +01:00
Armin Braun 7b916f2678
AbstractAnalyzerProvider does not need to extend AbstractIndexComponent (#86537)
Remove the inheritance here to make instances smaller and speed up many-shards benchmarks a little.
Did not remove the dead arguments from the constructors in this PR as that would have been a
very noisy change.
2022-05-08 22:34:52 +02:00
Rene Groeschke 50c0798b3b
Cleaning up some buildscripts (#85394)
Just some housekeeping on build scripts
2022-03-31 10:48:48 +02:00
Armin Braun 898d84998b
Make classes+methods that can be static static in many spots (#85370)
Just some quick static analysis+fixing here. Not much in terms of code changes
besides adding the `static` keywords with the exception of some simplifications
to some of the search objects that don't need the search controller instance
passed down in many spots.
This was done mostly automatically by the IDE but some quick manual inspection shows
quite a few spots where this should make things behave better via things like making lambdas
non-capturing.
2022-03-30 00:21:56 +02:00