diff --git a/CHANGELOG.md b/CHANGELOG.md index 121518180..6f0ed0364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Added support for custom key to IpRange and GeoDistance `addRange` using a common trait [#2227](https://github.com/ruflin/Elastica/pull/2227) * Added bucket sort aggregation [#2229](https://github.com/ruflin/Elastica/pull/2229) +### Changed +* Add support for Search Option "seq_no_primary_term" and Index Options "if_primary_term" and "if_seq_no" [#2234](https://github.com/ruflin/Elastica/pull/2234) + ### Fixed * Fixed Pipeline Processor handling to allow for multiple processors of the same type [#2218](https://github.com/ruflin/Elastica/pull/2218) diff --git a/src/Index.php b/src/Index.php index fc7584e3c..395bcde03 100644 --- a/src/Index.php +++ b/src/Index.php @@ -217,6 +217,8 @@ public function addDocument(Document $doc): Response 'retry_on_conflict', 'routing', 'timeout', + 'if_primary_term', + 'if_seq_no', ] ); diff --git a/src/Search.php b/src/Search.php index 03911aea5..79ccaf6af 100644 --- a/src/Search.php +++ b/src/Search.php @@ -41,6 +41,7 @@ class Search public const OPTION_SHARD_REQUEST_CACHE = 'request_cache'; public const OPTION_FILTER_PATH = 'filter_path'; public const OPTION_TYPED_KEYS = 'typed_keys'; + public const OPTION_SEQ_NO_PRIMARY_TERM = 'seq_no_primary_term'; /* * Search types @@ -419,6 +420,7 @@ protected function validateOption(string $key): void case self::OPTION_SHARD_REQUEST_CACHE: case self::OPTION_FILTER_PATH: case self::OPTION_TYPED_KEYS: + case self::OPTION_SEQ_NO_PRIMARY_TERM: return; }