mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
fix: [2.4] Fix bug for Search fails with filter expression contains underscore (#38302)
Enhance the matching for elements within the UnaryRangeArray https://github.com/milvus-io/milvus/issues/38068 --------- Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
parent
989c66c7eb
commit
c24f666f1b
@ -315,6 +315,11 @@ PhyUnaryRangeFilterExpr::ExecRangeVisitorImplArray() {
|
||||
func(data, size, val, index, res);
|
||||
break;
|
||||
}
|
||||
case proto::plan::Match: {
|
||||
UnaryElementFuncForArray<ValueType, proto::plan::Match> func;
|
||||
func(data, size, val, index, res);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
PanicInfo(
|
||||
OpTypeInvalid,
|
||||
|
||||
@ -184,6 +184,20 @@ struct UnaryElementFuncForArray {
|
||||
UnaryArrayCompare(array_data <= val);
|
||||
} else if constexpr (op == proto::plan::OpType::PrefixMatch) {
|
||||
UnaryArrayCompare(milvus::query::Match(array_data, val, op));
|
||||
} else if constexpr (op == proto::plan::OpType::Match) {
|
||||
if constexpr (std::is_same_v<GetType, proto::plan::Array>) {
|
||||
res[i] = false;
|
||||
} else {
|
||||
if (index >= src[i].length()) {
|
||||
res[i] = false;
|
||||
continue;
|
||||
}
|
||||
PatternMatchTranslator translator;
|
||||
auto regex_pattern = translator(val);
|
||||
RegexMatcher matcher(regex_pattern);
|
||||
auto array_data = src[i].template get_data<GetType>(index);
|
||||
res[i] = matcher(array_data);
|
||||
}
|
||||
} else {
|
||||
PanicInfo(OpTypeInvalid,
|
||||
"unsupported op_type:{} for "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user