mirror of
https://github.com/typesense/typesense.git
synced 2025-05-18 04:32:38 +08:00
Fixed an edge case in filtering int64 values.
This commit is contained in:
parent
ae66d6a8d0
commit
50dba3ec43
@ -951,8 +951,8 @@ Option<uint32_t> Index::do_filtering(uint32_t** filter_ids_out, const std::vecto
|
||||
if(f.type == field_types::INT32 || f.type == field_types::INT32_ARRAY) {
|
||||
int32_t value = (int32_t) std::stoi(filter_value);
|
||||
art_int32_search(t, value, a_filter.compare_operator, leaves);
|
||||
} else {
|
||||
int64_t value = (int64_t) std::stoi(filter_value);
|
||||
} else { // int64
|
||||
int64_t value = (int64_t) std::stol(filter_value);
|
||||
art_int64_search(t, value, a_filter.compare_operator, leaves);
|
||||
}
|
||||
|
||||
|
@ -1095,7 +1095,7 @@ TEST_F(CollectionTest, FilterOnNumericFields) {
|
||||
}
|
||||
|
||||
// when filters don't match any record, no results should be returned
|
||||
results = coll_array_fields->search("Jeremy", query_fields, "timestamps:<1", facets, sort_fields, 0, 10, 1, FREQUENCY, false).get();
|
||||
results = coll_array_fields->search("Jeremy", query_fields, "timestamps:>1591091288061", facets, sort_fields, 0, 10, 1, FREQUENCY, false).get();
|
||||
ASSERT_EQ(0, results["hits"].size());
|
||||
|
||||
collectionManager.drop_collection("coll_array_fields");
|
||||
|
Loading…
x
Reference in New Issue
Block a user