diff --git a/tests/unit/array/mixins/test_find.py b/tests/unit/array/mixins/test_find.py index b77c2122b7c..dbcf9f64ac3 100644 --- a/tests/unit/array/mixins/test_find.py +++ b/tests/unit/array/mixins/test_find.py @@ -257,19 +257,26 @@ def test_find_by_tag(storage, config, start_storage): ) for operator in ['gte', 'gt', 'lte', 'lt'] ], - *[ - tuple( - [ - 'qdrant', - lambda operator, threshold: { - 'must': [{'key': 'price', 'value': {operator: threshold}}] - }, - numeric_operators_qdrant, - operator, - ] - ) - for operator in ['eq', 'neq'] - ], + tuple( + [ + 'qdrant', + lambda operator, threshold: { + 'must': [{'key': 'price', 'match': {'value': threshold}}] + }, + numeric_operators_qdrant, + 'eq', + ] + ), + tuple( + [ + 'qdrant', + lambda operator, threshold: { + 'must_not': [{'key': 'price', 'match': {'value': threshold}}] + }, + numeric_operators_qdrant, + 'neq', + ] + ), *[ tuple( [ @@ -305,6 +312,8 @@ def test_search_pre_filtering( results = da.find(np.random.rand(n_dim), filter=filter) + assert len(results) > 0 + assert all( [numeric_operators[operator](r.tags['price'], threshold) for r in results] ) diff --git a/tests/unit/array/mixins/test_match.py b/tests/unit/array/mixins/test_match.py index 5408b8ab35e..24b5f360240 100644 --- a/tests/unit/array/mixins/test_match.py +++ b/tests/unit/array/mixins/test_match.py @@ -639,19 +639,26 @@ def test_match_ensure_scores_unique(): ) for operator in ['gte', 'gt', 'lte', 'lt'] ], - *[ - tuple( - [ - 'qdrant', - lambda operator, threshold: { - 'must': [{'key': 'price', 'value': {operator: threshold}}] - }, - numeric_operators_qdrant, - operator, - ] - ) - for operator in ['eq', 'neq'] - ], + tuple( + [ + 'qdrant', + lambda operator, threshold: { + 'must': [{'key': 'price', 'match': {'value': threshold}}] + }, + numeric_operators_qdrant, + 'eq', + ] + ), + tuple( + [ + 'qdrant', + lambda operator, threshold: { + 'must_not': [{'key': 'price', 'match': {'value': threshold}}] + }, + numeric_operators_qdrant, + 'neq', + ] + ), *[ tuple( [ @@ -688,6 +695,8 @@ def test_match_pre_filtering( doc = Document(embedding=np.random.rand(n_dim)) doc.match(da, filter=filter) + assert len(doc.matches) > 0 + assert all( [ numeric_operators[operator](r.tags['price'], threshold)