From cb87b94eaad68817dd2fe8997e50d4f778b0f70c Mon Sep 17 00:00:00 2001 From: Markus Kalkbrenner Date: Tue, 13 Nov 2018 11:40:52 +0100 Subject: [PATCH] fixes #634 --- CHANGELOG.md | 16 +++-------- .../Update/Query/Document/Document.php | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ba1f600f..f6540c6fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,11 @@ All notable changes to the solarium library will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [master] -### Added - -### Changed - -### Deprecated - -### Removed - -### Fixed - -### Security +## [4.2.0-rc.1] +### Added +- Support for managed resources +- Support for add-distinct and removeregex modifiers ## [4.2.0-beta.1] ### Added diff --git a/src/QueryType/Update/Query/Document/Document.php b/src/QueryType/Update/Query/Document/Document.php index 689faefd0..1269c5b56 100644 --- a/src/QueryType/Update/Query/Document/Document.php +++ b/src/QueryType/Update/Query/Document/Document.php @@ -24,33 +24,52 @@ class Document extends AbstractDocument implements DocumentInterface { /** - * Directive to set a value using atomic updates. + * Directive to set or replace the field value(s) with the specified value(s), or remove the values if 'null' or + * empty list is specified as the new value. May be specified as a single value, or as a list for multiValued + * fields. * * @var string */ const MODIFIER_SET = 'set'; /** - * Directive to increment an integer value using atomic updates. + * Directive to increment a numeric value by a specific amount. Must be specified as a single numeric value. * * @var string */ const MODIFIER_INC = 'inc'; /** - * Directive to append a value (e.g. multivalued fields) using atomic updates. + * Directive to add the specified values to a multiValued field. May be specified as a single value, or as a list. * * @var string */ const MODIFIER_ADD = 'add'; /** - * Directive to remove a value (e.g. multivalued fields) using atomic updates. + * Directive to add the specified values to a multiValued field, only if not already present. May be specified as a + * single value, or as a list. + * + * @var string + */ + const MODIFIER_ADD_DISTINCT = 'add-distinct'; + + /** + * Directive to remove (all occurrences of) the specified values from a multiValued field. May be specified as a + * single value, or as a list. * * @var string */ const MODIFIER_REMOVE = 'remove'; + /** + * Directive to remove all occurrences of the specified regex from a multiValued field. May be specified as a single + * value, or as a list. + * + * @var string + */ + const MODIFIER_REMOVEREGEX = 'removeregex'; + /** * This value has the same effect as not setting a version. *