Hey all,
I have a bit of an odd question, hopefully someone can give me an answer.
In usergrid, we have our own existing query language. We parse this
language into an AST, then visit each of the nodes and construct an ES
query with the java client. So far, very straight forward. However, we
have 1 wrench in the works. Some of our operations can only be implemented
as filters. As a result, visiting some of our nodes results in a
QueryBuilder operation, others in a FilterBuilder operation. To keep our
context so that we still evaluate AND, OR, and NOT correctly, I'm pushing
BoolQueryBuilder and BoolFilterBuilder on to our stacks as we traverse the
tree. Within these bool terms, I will have both query and filter
operations that represent a "no-op" operation. Is there such a build that
already exists in the client, or will I need to create my own that doesn't
append any content during the build phase?
match all query(QueryBuilders.matchAllQuery()) and match all filter(FilterBuilders.matchAllFilter())?
On April 7, 2015 at 08:13:29, Todd Nine (tnine@apigee.com) wrote:
Hey all,
I have a bit of an odd question, hopefully someone can give me an answer. In usergrid, we have our own existing query language. We parse this language into an AST, then visit each of the nodes and construct an ES query with the java client. So far, very straight forward. However, we have 1 wrench in the works. Some of our operations can only be implemented as filters. As a result, visiting some of our nodes results in a QueryBuilder operation, others in a FilterBuilder operation. To keep our context so that we still evaluate AND, OR, and NOT correctly, I'm pushing BoolQueryBuilder and BoolFilterBuilder on to our stacks as we traverse the tree. Within these bool terms, I will have both query and filter operations that represent a "no-op" operation. Is there such a build that already exists in the client, or will I need to create my own that doesn't append any content during the build phase?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.