danpaz / bodybuilder

An elasticsearch query body builder :muscle:

Home Page:http://bodybuilder.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add support of suggestions

georgyfarniev opened this issue · comments

Hi. Thanks for working on bodybuilder, it is very useful module. Can you please add support of suggestions feature for consistency? Thanks.

I don't have the bandwidth to work on new features like this at the moment, unfortunately. If you are willing to contribute a PR I would be happy to review it.

@danpaz thanks for reply. I’ll try to make it when I have time and PR. Glad that you approve this idea, because I saw your comment which made me confused about it.

@georgyfarniev how much of the Suggesters API are you looking to support? Simple usage of suggest clauses could make sense to include in this library since they are meant to complement query results. The structure is even similar to queries for simple cases.

But I am concerned that supporting the entire Suggesters API could add a lot of surface area to this simple library. I would suggest trying to follow the pattern of query-builder, filter-builder and aggregation-builder which all make use of the same buildClause utility to construct query clause objects. Let me know how that goes and we can evaluate if bodybuilder is still the best place for this functionality.

@danpaz thanks for pointing me out. I'll work on it and let you know, but I also bit overwhelmed now due to current situation in my life. Hope to get it done soon.

@georgyfarniev @danpaz I have some available bandwidth to put this together, I'll work on a draft PR over the next week!