Skip to content

Commit

Permalink
Merge pull request #285 from nspcc-dev/feature/265-search-match-num
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Feb 1, 2024
2 parents 090f9bf + 0588aca commit d5e1aad
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

### Added
- Numeric operands for object search queries (#265)

### Changed

Expand Down
3 changes: 3 additions & 0 deletions object/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ message SearchRequest {
// objects. Most human users expect to get only object they can directly
// work with. In that case, `$Object:ROOT` filter should be used.
//
// If `match_type` field is numerical, both `value` field and object
// attribute MUST be base-10 integers.
//
// By default `key` field refers to the corresponding object's `Attribute`.
// Some Object's header fields can also be accessed by adding `$Object:`
// prefix to the name. Here is the list of fields available via this prefix:
Expand Down
12 changes: 12 additions & 0 deletions object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ enum MatchType {

// String prefix match
COMMON_PREFIX = 4;

// Numerical 'greater than'
NUM_GT = 5;

// Numerical 'greater or equal than'
NUM_GE = 6;

// Numerical 'less than'
NUM_LT = 7;

// Numerical 'less or equal than'
NUM_LE = 8;
}

// Short header fields
Expand Down
7 changes: 7 additions & 0 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,9 @@ container, including Regular object, Tombstones and Storage Group
objects. Most human users expect to get only object they can directly
work with. In that case, `$Object:ROOT` filter should be used.

If `match_type` field is numerical, both `value` field and object
attribute MUST be base-10 integers.

By default `key` field refers to the corresponding object's `Attribute`.
Some Object's header fields can also be accessed by adding `$Object:`
prefix to the name. Here is the list of fields available via this prefix:
Expand Down Expand Up @@ -1021,6 +1024,10 @@ Type of match expression
| STRING_NOT_EQUAL | 2 | Full string mismatch |
| NOT_PRESENT | 3 | Lack of key |
| COMMON_PREFIX | 4 | String prefix match |
| NUM_GT | 5 | Numerical 'greater than' |
| NUM_GE | 6 | Numerical 'greater or equal than' |
| NUM_LT | 7 | Numerical 'less than' |
| NUM_LE | 8 | Numerical 'less or equal than' |



Expand Down

0 comments on commit d5e1aad

Please sign in to comment.