Skip to content

Commit

Permalink
Merge pull request #637 from solariumphp/modifiers
Browse files Browse the repository at this point in the history
add add-distinct and removeregex modifiers
  • Loading branch information
Markus Kalkbrenner committed Nov 13, 2018
2 parents 8db7d13 + feb3f4a commit 681a4fa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
16 changes: 4 additions & 12 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
27 changes: 23 additions & 4 deletions src/QueryType/Update/Query/Document/Document.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit 681a4fa

Please sign in to comment.