storefront-query-builder
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

storefront-query-builder

ElasticSearch Query builder from the abstract "SearchQuery" object used by storefront-api, vue-storefront-api and vue-storefront 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 vue-storefront

/storefront-query-builder/

    Package Sidebar

    Install

    npm i storefront-query-builder

    Weekly Downloads

    59

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    161 kB

    Total Files

    50

    Last publish

    Collaborators

    • andrzejewsky
    • filrak
    • patzick
    • pkarw
    • resubaka