Package Exports
- @ecomplus/search-engine
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ecomplus/search-engine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
E-Com Plus Search Engine
UMD JS lib to handle products search for E-Com Plus stores
Usage
The @ecomplus/search-engine package is a wrapper for E-Com Plus Search API, can be used to handle a full featured products search system, from simple items search to applying multiple filters and aggregations.
It's available for both Node.js and browser environments.
Example
import EcomSearch from '@ecomplus/search-engine'
const search = new EcomSearch()
search.setSearchTerm('smartphone').fetch()
.then(result => {
search.getItems().forEach(item => {
console.log(item.name)
})
})
.catch(error => {
console.error(error)
if (error.response) {
console.log(error.response)
}
})Installation
It may require and doesn't include core-js (optional) and @ecomplus/utils (peer dependency).
Webpack
npm i --save core-js @ecomplus/utils @ecomplus/search-engineNode.js
npm i --save @ecomplus/utils @ecomplus/search-engineCDN
<script src="https://cdn.jsdelivr.net/npm/@ecomplus/search-engine/dist/ecom-search.var.min.js"></script>When importing from CDN, _.cloneDeep, _.merge, ecomUtils and ecomClient libraries must be included separately and available on window scope.