vuestorefront / storefront-query-builder

ElasticSearch Query builder from the abstract "SearchQuery" object used by storefront-api, vue-storefront-api and vue-storefront projects
MIT License
7 stars 21 forks source link

Refactor `elasticsearch` module for modular and extensible filter handling #6

Closed cewald closed 4 years ago

cewald commented 4 years ago

In order to the PR https://github.com/DivanteLtd/storefront-query-builder/pull/4#issuecomment-609625727 and #3, we decided to give a more extensible approach in adding features to the storefront-query-builder by doing some refactoring.

I refactored the src/elasticsearch/index.ts and put the logic into a class to make it more read- and extendable. I also added the following features:

There are some pitfalls and thoughts about backwards compatibility to do yet:

So it would be a good idea to manage this changes under a new version number to support older systems by the current version and just use this version from the current VSF/API develop branches on as a new version.

This is currently in progress and not much tested – but please give me some feedback if I don't head in a completely wrong direction.

cewald commented 4 years ago

I have tested it a bit now and it seems to work fine. I needed to make some changes at the API and VSF to make it work.

Changes for vue-storefront - https://github.com/DivanteLtd/vue-storefront/pull/4234:

Changes for vue-storefront-api - https://github.com/DivanteLtd/vue-storefront-api/pull/429:

Changes for storefront-api - https://github.com/DivanteLtd/storefront-api/pull/51

I will open up two PR's in the repos and connect this ticket.

gibkigonzo commented 4 years ago

Thanks, this looks great! :)