diff --git a/cozo-core/src/cozoscript.pest b/cozo-core/src/cozoscript.pest index aa7b602d..1dddee1c 100644 --- a/cozo-core/src/cozoscript.pest +++ b/cozo-core/src/cozoscript.pest @@ -244,7 +244,7 @@ temp_swap = {"%swap" ~ underscore_ident ~ underscore_ident} debug_stmt = {"%debug" ~ (ident | underscore_ident)} fts_doc = {SOI ~ fts_expr+ ~ EOI} -fts_phrase_simple = @{!("AND" | "OR" | "NOT" | "NEAR") ~ (XID_CONTINUE+)} +fts_phrase_simple = @{!("AND" | "OR" | "NOT" | "NEAR" | "," | ";") ~ (XID_CONTINUE+)} fts_phrase_group = {fts_phrase_simple+} fts_prefix_marker = @{"*"} fts_booster = {"^" ~ (dot_float | pos_int)} @@ -255,5 +255,5 @@ fts_grouped = {"(" ~ fts_expr+ ~ ")"} fts_expr = {fts_term ~ (fts_op ~ fts_term)*} fts_op = _{fts_and | fts_or | fts_not} fts_and = {"AND"} -fts_or = {"OR"} +fts_or = {"OR" | "," | ";"} fts_not = {"NOT"} \ No newline at end of file diff --git a/cozo-core/src/query/ra.rs b/cozo-core/src/query/ra.rs index 28fe61a4..aa5882d5 100644 --- a/cozo-core/src/query/ra.rs +++ b/cozo-core/src/query/ra.rs @@ -1026,6 +1026,21 @@ impl FtsSearchRA { .map_ok(move |tuple| -> Result<_> { let q = match tuple[bind_idx].clone() { DataValue::Str(s) => s, + DataValue::List(l) => { + let mut coll = String::new(); + for d in l { + match d { + DataValue::Str(s) => { + if !coll.is_empty() { + coll += " OR "; + } + coll += &s + }, + d => bail!("Expected string for FTS search, got {:?}", d), + } + } + coll + } d => bail!("Expected string for FTS search, got {:?}", d), };