Open fulmicoton opened 1 year ago
@guilload @evanxg852000 I'd like to have your thought on this?
Just passing by, but it would be cool. Almost in every place I was working with search engines, there were kind of Query DSL. In Summa, I also have proto-based query tree: https://github.com/izihawa/summa/blob/master/summa-proto/proto/query.proto#L14
This would make some optimizations easier, e.g. for
(Field1:Term1 OR Field1:Term2) AND (Field2: Term1 OR Field2:Term2)
, it would be better to use a simple union-algorithm that supports fast skips instead of the current one.
For that we would need to know that above the union is an intersection that triggers the skips. In the current generic API it's possible, but strange to pass down that information.
Currently tantivy's query are based on the following traits.
They do not expose the structure of the query, and make it easy to extend queries.
It might be interesting however to introduce a QueryAST
And the equivalent for weight...
Such an AST could help debug, optimization operations, and could be a natural target for different query DSL.