update regex to support space separated range label

This commit is contained in:
krunal 2023-10-25 19:06:02 +05:30
parent f704a1ebbb
commit e035aa0848

View File

@ -4870,7 +4870,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-zA-Z]+:\\[([+-]?([0-9]*[.])?[0-9]*)\\,\\s*([+-]?([0-9]*[.])?[0-9]*)\\]");
const std::regex range_pattern("[[a-z A-Z]+:\\[([+-]?([0-9]*[.])?[0-9]*)\\,\\s*([+-]?([0-9]*[.])?[0-9]*)\\]");
if(facet_field.find(":") != std::string::npos) { //range based facet
if(!std::regex_match(facet_field, base_pattern)){