* [Upgrade] Lucene 9.1.0-snapshot-ea989fe8f30
Upgrades from Lucene 9.0.0 to 9.1.0-snapshot-ea989fe8f30 in preparation for
9.1.0 GA.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Add spanishplural token filter
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix KNOWN_TOKENIZERS
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Unmutes IndexPrimaryRelocationIT.testPrimaryRelocationWhileIndexing which was
fixed by LuceneChangesSnapshot using accurate ops history.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Adds default implementation for getEngineFactory in EnginePlugin. The
default just returns Optional.empty(), allowing plugin developers to
implement this plugin without implementing this method.
Signed-off-by: John Mazanec <jmazane@amazon.com>
This commit upgrades the core codebase from Lucene 8.10.1 to
lucene 9.0.0. It includes all necessary refactoring of features and
API changes when upgrading to a new major Lucene release.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Co-authored-by: Andriy Redko <drreta@gmail.com>
Improves the LuceneChangesSnapshot to get an accurate count of recovery
operations using sort by sequence number optimization.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes the obsolete types based .addMapping method from CreateIndexRequest and
CreateIndexRequestBuilder. Tests are refactored to use the new source only
setMapping method.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes types from the TaskResults internal index along with the getMappings
method from IndexMetadata. This is needed to further remove types from
CreateIndexRequest.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* [Remove] Type from TermsLookUp
Signed-off-by: Suraj Singh <surajrider@gmail.com>
* Fix unit test failure
Signed-off-by: Suraj Singh <surajrider@gmail.com>
* Discrepancy in result from _validate/query API and actual query validity
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
* Moved the validate() check later into the flow to allow range validation to trigger first
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Removes types from UID class along with cleaning up all obsolete MapperService
dependendices. This includes removing UID from the Translog Delete operation
which is no longer needed due to type dependency removal.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes multi-type support from IndexTemplateMetadata so that instead of holding
a map of multiple types to mappings, it only returns a single mapping for a
single type. Also removes type from documentMapper() method to avoid any
accidental NullPointerExceptions in the internal mapping retrieval.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
This inner class is no longer required because its functionality has been moved to the generic GatedCloseable class.
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* Reducing duplication in plugins around ref-counted releasable classes
Both AmazonEc2Reference and AmazonS3Reference duplicate the same logic - a subclass of AbstractRefCounted that also implements Releasable. This change centralizes this paradigm into a AbstractRefCountedReleasable class and supports both clients via generics. It also updates all fetching implementations to use the get() method instead of client()
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* Introduce Reference classes for the Closeable and AutoCloseable interfaces
These classes allow you to wrap a reference instance with an onClose runnable that is executed when close() is invoked. Two separate classes are needed because the close() signatures for the two interfaces are different. This change takes the first step to have implementing classes extend from these generic superclasses, before attempting to remove the subclasses entirely. The get() method is also replaced throughout the code base.
Note that there is also a separate Releasable interface that has a similar access pattern, but is implemented separately. This is used in AbstractRefCountedReleasable introduced in a prior commit
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* More improvements and refactoring
* Functionality around one-way gating is now moved to a dedicated class - OneWayGate. This replaces duplicate functionality throughout the code.
* The two *Reference classes have been renamed to Gated* since that better represents their functionality
* The AbstractRefCountedReleasable has been improved to no longer be abstract by accepting the shutdown hook. This removes the need for the inner class in ReleasableBytesReference, and further simplifies the plugin subclasses (these could probably be removed entirely).
* Finally, unit tests have been added for some classes
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* Added tests for GatedCloseable
Also updated the license information in GatedAutoCloseableTests
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* Fixing license information in new files
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* Added unit tests for RefCountedReleasable
Signed-off-by: Kartik Ganesh <gkart@amazon.com>
* [Remove] TrimUnsafeCommit logic for legacy 6.x indexes
Multiple txlog commits was introduced in legacy 7.x. Legacy 6.x indexes could
therefore not have a safe commit. Since OpenSearch 2.0 is no longer compatible
with legacy 6.x indexes, the logic to trim these unsafe commits is safely
removed.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix assertion typo
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* rebase and incorporate pr feedback
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* MapperService has to be passed in as null for EnginePlugins CodecService constructor
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
* Addressing code review comments
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
* Delayed CodecService instantiation up to the shard initialization
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
* Added logger (associated with shard) to CodecServiceConfig
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
* Refactored the EngineConfigFactory / IndexShard instantiation of the CodecService
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Removes include_type_name from the high level reset client along with relevant
deprecated methods in IndicesClient. All tests are updated to remove the
parameter from the rest requests along with various toXContent methods that are
no longer required.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Replace the exclusionary word whitelist with allowlist, and blacklist with denylist, in code commet and internal variable/method/class/package name.
Signed-off-by: Andreas <apre@gmx.at>
* Add '_name' field support to score functions and provide it back in explanation response
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
* Address code review comments
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Removes the deprecated types based get, getMapping, getAsync, and
getMappingAsync methods from IndicesClient. It also removes extra nesting of
mappings belong the deprecated type named object and removes the types based
methods from the affected request classes.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Reintroduce negative epoch_millis #1991
Fixes a regression introduced with Elasticsearch 7 regarding the date
field type that removed support for negative timestamps with sub-second
granularity.
Thanks to Ryan Kophs (https://github.com/rkophs) for allowing me to use
his previous work.
Signed-off-by: Breno Faria <breno.faria@intrafind.de>
* applying spotless fix
Signed-off-by: Breno Faria <breno.faria@intrafind.de>
* more conservative implementation of isSupportedBy
Signed-off-by: Breno Faria <breno.faria@intrafind.de>
* adding braces to control flow statement
Signed-off-by: Breno Faria <breno.faria@intrafind.de>
* spotless fix...
Signed-off-by: Breno Faria <breno.faria@intrafind.de>
Co-authored-by: Breno Faria <breno.faria@intrafind.de>
Removes the type parameter from Client.prepare(Index,Delete,Update) and
everywhere it's used throughout the codebase except for prepareIndex(index,
type, id) which is removed in a follow up.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Removes type support from DocWrite Request and Response, all derived classes,
and all places used.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* [Remove] types from SearchHit and Explain API
Removes type support from SearchHit and Explain API.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix failing tests
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* move TYPES_DEPRECATION_MESSAGE from RestExplainAction to FullClusterRestartIT
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix FullClusterRestartIT
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix failing tests
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* fix testSoftDelete
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
With soft deletes no longer optional, peer recovery is switched to always use the
lucene index instead of replaying operations from the translog.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
* Remove type param from yml and integ test files
Signed-off-by: Suraj Singh <surajrider@gmail.com>
* Remove type mapping specific update API
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Removes type support from the get and mget transport and rest actions along
with removal from ShardGetService.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Default mappings were deprecated in Legacy version 6x and cannot be added to
indexes created in legacy 7+ or any version of OpenSearch. All support for
default mappings are removed for OpenSearch 2+.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
With types deprecation the type support is removed from internal search API
(SearchRequest and QueryShardContext).
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>