Fixed an edge case in filtering int64 values.

This commit is contained in:
kishorenc 2020-06-13 11:12:46 +05:30
parent ae66d6a8d0
commit 50dba3ec43
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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");