mirror of
https://github.com/typesense/typesense.git
synced 2025-05-19 05:08:43 +08:00
Don't require facet index for not equals.
This commit is contained in:
parent
5f244bc588
commit
254abbfdbc
@ -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] == ' ');
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user