Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ideal-world/bios
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Dec 31, 2024
2 parents 55a82a2 + 063da7b commit ad5d481
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ WHERE
if sql_adv_query.is_empty() {
"".to_string()
} else {
format!(" {} ( 1=1 {})", if search_req.adv_by_or.unwrap_or(false) { " OR " } else { " AND " }, sql_adv_query.join(" "))
format!(
" {} ( 1=1 {})",
if search_req.adv_by_or.unwrap_or(false) { " OR " } else { " AND " },
sql_adv_query.join(" ")
)
},
if order_fragments.is_empty() {
"".to_string()
Expand Down Expand Up @@ -694,6 +698,13 @@ fn package_ext(
"({}.ext ->> '{}' is null or {}.ext ->> '{}' = '' or {}.ext ->> '{}' = '[]')",
table_alias_name, ext_item.field, table_alias_name, ext_item.field, table_alias_name, ext_item.field
));
} else if ext_item.op == BasicQueryOpKind::Len {
if let Some(first_value) = value.pop() {
sql_and_where.push(format!("(length(ext->>'{}') = ${})", ext_item.field, sql_vals.len() + 1));
sql_vals.push(first_value);
} else {
return err_not_found(ext_item);
};
} else {
if value.len() > 1 {
return err_not_found(&ext_item.clone().into());
Expand Down

0 comments on commit ad5d481

Please sign in to comment.