Open lucasbbb opened 2 years ago
@lucasbbb your syntax is incorrect.
Here's the query string equivalent for name:foo AND age:1024
:
+name:foo +age:1024
Here's the query string equivalent for name:foo OR age:1024
:
name:foo age:1024
Here's the query string equivalent for not name:foo
:
-name:foo
No plans for supporting the AND/OR/NOT operators for the query string queries at the moment.
@lucasbbb your syntax is incorrect.
Here's the query string equivalent for
name:foo AND age:1024
:+name:foo +age:1024
Here's the query string equivalent for
name:foo OR age:1024
:name:foo age:1024
Here's the query string equivalent for
not name:foo
:-name:foo
Thanks for the reply. But how could I combine multiple query statements, for example:
name:foo AND (age:1024 OR age:64)
The query string syntax support that we have at the moment is a bit limited. I'd recommend using the conjuncts and disjuncts constructs for your case:
{"conjuncts": [{"query": "name:foo"}, {"disjuncts": [{"query": "age:1024"}, {"query": "age:64"}]}]}
Thanks. I see. I notice that the QueryStringQuery is still parsed through goyacc which has been deprecated long long ago. How about refactor it with ANTLR4? Do you have this plan? If not, is it welcomed to submit a PR?
We don't have a plan there for the moment. However, we'd welcome a PR if you're willing to make a contribution. We'll review it and consider it if it aligns with our roadmap.
It seems like the AND/OR/NOT operators are useless in the Query String Query, which is different from Lucene. Will these operators be supported in the future?