Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context as parameter to every EAbstractNode created in elasticsearch/visitor.py #104

Open
alexgarel opened this issue Aug 27, 2024 · 0 comments

Comments

@alexgarel
Copy link
Member

I have a use case in search-a-licious where I wanted to add some parameter to EAbstractNode.

Note also, that as those parameters are query dependent and creating an ElasticsearchQueryBuilder instance is a bit time consuming, I want to do this at query generation time and not at class instantiation time.

It's currently difficult to do that without re-implementing part of the methods of the visitor.

It would be easier if:

  1. we enable adding an initial context in __call__ and visit methods
  2. we pass along this context each time we build an EAbstractNode

That way specific classes of EAbstractNode can tweak their result as much as they want with a minimal changes to ElasticsearchQueryBuilder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant