Hi all! I've came across Tantivy and it looks very promising. I had a small question, however: Is it possible to combine multiple queries together? In our application, tokenization and weighting are done on the client so we'd like to be able to pass a list of tokens (and possibly an edit distance) and search for those without any processing done by the search library. Forgive me if I have overlooked this, but there doesn't seem to be an obvious way to use multiple queries (such as searching for multiple terms in a
FuzzyTermQuery) without using a
impl Queryobject, something like https://github.com/tantivy-search/tantivy/blob/main/src/query/boolean_query/mod.rs#L284
impl From<Vec<(Occur, Box<Query>)>>is the one you want to use.
bbigrasI have another question. For one of my "problem" a solution was to use RegexQuery. It seems that I have to do the query myself, but can I still allow my users to search for something like "client:Bob.* and color:green". I mean that if I do the query myself, I have no idea if I can handle the logic stuff like "and".
With this work will some of the query parser functions become public? If i understand the query parser right I think i want to change this line in convert literal to query https://github.com/tantivy-search/tantivy/blob/main/src/query/query_parser/query_parser.rs#L533 to check to see if it looks like it could be a regex and use RegexQuery::from_pattern? Or am i very wrong about how this should work?
There is no plan to put regex into the query parser, I am afraid. You need to implement your own query parser.