Extract the float-array from a `vector_distance(col, ARRAY[...])` expression.
(expr: &ast::Expr)
| 168 | |
| 169 | /// Extract the float-array from a `vector_distance(col, ARRAY[...])` expression. |
| 170 | fn extract_vector_arg(expr: &ast::Expr) -> Result<Vec<f32>> { |
| 171 | Ok(match expr { |
| 172 | ast::Expr::Function(f) => { |
| 173 | let inner_args = extract_func_args(f)?; |
| 174 | if inner_args.len() >= 2 { |
| 175 | extract_float_array(&inner_args[1]).unwrap_or_default() |
| 176 | } else { |
| 177 | Vec::new() |
| 178 | } |
| 179 | } |
| 180 | _ => Vec::new(), |
| 181 | }) |
| 182 | } |
| 183 | |
| 184 | /// Extract the query string from a `bm25_score(col, 'query')` expression. |
| 185 | fn extract_text_arg(expr: &ast::Expr) -> Result<String> { |
no test coverage detected