Export Query in index.js to allow extensions for special query types that may not be part of the official ES DSL.
We are using this query builder for OpenSearch, where a new plugin adds the neural query. I foresee that the type of queries used in OpenSearch and Elasticsearch will diverge in the future, so it would be nice that we can still use this module as a base to create queries for both.
There are also other query types used in ES in later versions, which are not commonly used, but can be useful to add yourself like the
Export
Query
in index.js to allow extensions for special query types that may not be part of the official ES DSL.We are using this query builder for OpenSearch, where a new plugin adds the
neural
query. I foresee that the type of queries used in OpenSearch and Elasticsearch will diverge in the future, so it would be nice that we can still use this module as a base to create queries for both.There are also other query types used in ES in later versions, which are not commonly used, but can be useful to add yourself like the
By making the
Query
class public, it is easier to add extensions in TS.Note that I have shared a workaround here to still allow extensions, but with this PR, we can skip that.
@sudo-suhas , can you please check this PR?