[#137] metabase: Do not select objects if there is no filterable attribute

In previous metabase implementation the absence of an attribute presented in
the search filter did not exclude the object from the result. Change this
behavior to exclude the object from the result.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2020-11-02 11:07:53 +03:00 committed by Alex Vanin
parent d9a5007c72
commit 3bbf1d6a60
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ func (db *DB) Select(fs object.SearchFilters) ([]*object.Address, error) {
// get bucket with values
keyBucket := indexBucket.Bucket([]byte(key))
if keyBucket == nil {
continue
// no object has this attribute => empty result
return nil
}
fVal := f.Value()