Don't require facet index for not equals.

This commit is contained in:
Kishore Nallan 2022-03-19 20:30:38 +05:30
parent 5f244bc588
commit 254abbfdbc
2 changed files with 1 additions and 7 deletions

View File

@ -328,12 +328,6 @@ Option<bool> filter::parse_filter_query(const string& simple_filter_query,
str_comparator = EQUALS;
while(++filter_value_index < raw_value.size() && raw_value[filter_value_index] == ' ');
} else if(raw_value.size() >= 2 && raw_value[0] == '!' && raw_value[1] == '=') {
if(!_field.facet) {
// EXCLUDE filtering on string is possible only on facet fields
return Option<bool>(400, "To perform exclude filtering, filter field `" +
_field.name + "` must be a facet field.");
}
str_comparator = NOT_EQUALS;
filter_value_index++;
while(++filter_value_index < raw_value.size() && raw_value[filter_value_index] == ' ');

View File

@ -1735,7 +1735,7 @@ TEST_F(CollectionFilteringTest, NegationOperatorBasics) {
Collection *coll1;
std::vector<field> fields = {field("title", field_types::STRING, false),
field("artist", field_types::STRING, true),
field("artist", field_types::STRING, false),
field("points", field_types::INT32, false),};
coll1 = collectionManager.get_collection("coll1").get();