Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

ElasticSearch Query builder from the abstract "SearchQuery" object used by storefront-api, vue-storefront-api and vue-storefront projects

License

Notifications You must be signed in to change notification settings

vuestorefront/storefront-query-builder

Repository files navigation

storefront-query-builder

Stay connected

GitHub Repo stars Twitter Follow YouTube Channel Subscribers Discord

ElasticSearch Query builder from the abstract "SearchQuery" object used by storefront-api, alokai-api and alokai projects.

The idea is, that the user can create the query in a pretty abstract way and get the ElasticSearch or potentially different query in return. Some nice extension ideas could be to add mongodb support or SQL support as well.

Example usage:

import { SearchQuery, elasticsearch } from 'storefront-query-builder'
import bodybuilder from 'bodybuilder'
const searchQuery = new SearchQuery()
searchQuery = searchQuery.applyFilter({key: 'parent_id', value: {'eq': 125 }})
const elasticSearchQuery = await elasticsearch.buildQueryBodyFromSearchQuery({ config, queryChain: bodybuilder(), searchQuery })
// send the `elasticSearchQuery` to ElasticSearch instance

More on storefront-api More on alokai

About

ElasticSearch Query builder from the abstract "SearchQuery" object used by storefront-api, vue-storefront-api and vue-storefront projects

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published