I'm writing a high level query parser to go from something like a AND (b OR c) to a DSL object. My implementation would flatten a AND (b OR c) to (a AND b) OR (a and c). From here, the translation to query DSL would be fairly straightforward. Its just ORing ANDs together.
In the above example, if the a term is complex like a geoquery, i'm assuming elasticsearch will run the geoquery twice. Is this true? If so, I will need to rethink my parsers implementation.
I'm using a boolean parser module that flattens it to this structure. I could maintain the original structure, however that would mean i would have to write my own boolean parser. By using this module, I only have to write the validation for each boolean term (ie if the path/operator/value work together).
Anyways, thanks for the confirmation that this would be expensive. Going forward I'm just going to restrict the types of queries that would be within this string to simple term/range/equality comparisons. I'll leave the more complex terms like geo in their own separate clauses.
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.