Now that quickwit-oss/tantivy#2129 has landed, it'd be nice to start thinking about lenient parsing support in the bindings. Obviously, a new version of the crate has to be released but starting to think about this.
I've started working on this, but there are a few points I'd like to iron out how we'd expose the QueryParserError enum. It'd be nice to have types for the errors, but QueryParserError is currently a Rust enum.
An (strawman) idea I had was to have separate classes for each error type. Then, optionally, organize them in a submodule underneath tantivy, i.e. tantivy.query_parser_error or something. Then, the interface could look something like this from the Python side:
@dataclass
class ParseQueryLenientResult:
query: Query
errors: List[Union[query_parser_error.SyntaxError, query_parser_error.UnsupportedQuery, ...]]
def parse_query_lenient(query: str, default_field_names: Optional[List[str]]) -> ParseQueryLenientResult:
...
cc @adamreichold @cjrh if y'all have thoughts
Now that quickwit-oss/tantivy#2129 has landed, it'd be nice to start thinking about lenient parsing support in the bindings. Obviously, a new version of the crate has to be released but starting to think about this.
I've started working on this, but there are a few points I'd like to iron out how we'd expose the
QueryParserErrorenum. It'd be nice to have types for the errors, butQueryParserErroris currently a Rust enum.An (strawman) idea I had was to have separate classes for each error type. Then, optionally, organize them in a submodule underneath
tantivy, i.e.tantivy.query_parser_erroror something. Then, the interface could look something like this from the Python side:cc @adamreichold @cjrh if y'all have thoughts