mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 22:33:27 +08:00
add alphanumeric range facet labels & minor bug fix
This commit is contained in:
parent
cf5d00dd4c
commit
058b8be621
@ -5850,7 +5850,7 @@ bool Collection::get_enable_nested_fields() {
|
||||
|
||||
Option<bool> Collection::parse_facet(const std::string& facet_field, std::vector<facet>& facets) const {
|
||||
const std::regex base_pattern(".+\\(.*\\)");
|
||||
const std::regex range_pattern("[[a-z A-Z]+:\\[([+-]?([0-9]*[.])?[0-9]*)\\,\\s*([+-]?([0-9]*[.])?[0-9]*)\\]");
|
||||
const std::regex range_pattern("[[0-9]*[a-z A-Z]+[0-9]*:\\[([+-]?([0-9]*[.])?[0-9]*)\\,\\s*([+-]?([0-9]*[.])?[0-9]*)\\]");
|
||||
const std::string _alpha = "_alpha";
|
||||
|
||||
if ((facet_field.find(":") != std::string::npos)
|
||||
|
@ -1389,7 +1389,7 @@ void Index::do_facets(std::vector<facet> & facets, facet_query_t & facet_query,
|
||||
if(a_facet.get_range(std::stoll(doc_val), range_pair)) {
|
||||
const auto& range_id = range_pair.first;
|
||||
facet_count_t& facet_count = a_facet.result_map[range_id];
|
||||
facet_count.count = kv.second.count;
|
||||
facet_count.count += kv.second.count;
|
||||
}
|
||||
} else {
|
||||
facet_count_t& facet_count = a_facet.value_result_map[kv.first];
|
||||
|
Loading…
x
Reference in New Issue
Block a user