jurismarches / luqum

A lucene query parser generating ElasticSearch queries and more !
Other
188 stars 40 forks source link

Allow to override `E` elements #73

Closed qcoumes closed 2 years ago

qcoumes commented 2 years ago

I need to customize the behavior of some elements inside ElasticsearchQueryBuilder. Sadly it is not currently possible to just change these element without overriding every method to use my custom element.

Could you consider making these elements an attribute of the class so that we can override them more easily, i.e. something like :

class ElasticsearchQueryBuilder(LuceneTreeVisitorV2):

    E_MUST = EMust
    E_SHOULD = Eshould
    [...]

I can make a PR if you agree with the idea.

alexgarel commented 2 years ago

Sounds good to me @qcoumes

alexgarel commented 2 years ago

Resolved by @qcoumes PR #75 !