From aaa513215da22741ee7ef39076ea4d945f7715de Mon Sep 17 00:00:00 2001 From: ljl <17743125563@163.com> Date: Wed, 6 Mar 2024 18:35:12 +0800 Subject: [PATCH] spi-search:fix in. --- spi/spi-search/src/serv/pg/search_pg_item_serv.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spi/spi-search/src/serv/pg/search_pg_item_serv.rs b/spi/spi-search/src/serv/pg/search_pg_item_serv.rs index a9a37dd99..70288c295 100644 --- a/spi/spi-search/src/serv/pg/search_pg_item_serv.rs +++ b/spi/spi-search/src/serv/pg/search_pg_item_serv.rs @@ -1124,23 +1124,23 @@ pub async fn query_metrics(query_req: &SearchQueryMetricsReq, funs: &TardisFunsI if ext_item.op == BasicQueryOpKind::In { if !value.is_empty() { sql_and_where.push(format!( - "fact.{} LIKE ANY (ARRAY[{}])", + "fact.{} IN ({})", ext_item.field, (0..value.len()).map(|idx| format!("${}", params.len() + idx + 1)).collect::>().join(",") )); for val in value { - params.push(Value::from(format!("{val}%"))); + params.push(val); } } } else if ext_item.op == BasicQueryOpKind::NotIn { if !value.is_empty() { sql_and_where.push(format!( - "fact.{} NOT LIKE ANY (ARRAY[{}])", + "fact.{} NOT IN ({})", ext_item.field, (0..value.len()).map(|idx| format!("${}", params.len() + idx + 1)).collect::>().join(",") )); for val in value { - params.push(Value::from(format!("{val}%"))); + params.push(val); } } } else if ext_item.op == BasicQueryOpKind::IsNull {