Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @ecomplus/search-engine with all npm packages installed. Try it out:

require("@ecomplus/utils/package.json"); // @ecomplus/utils is a peer dependency. var searchEngine = require("@ecomplus/search-engine")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@ecomplus/search-engine v2.4.1

JS lib to handle products search with E-Com Plus stores

E-Com Plus Search Engine

Publish CodeFactor npm version License MIT

UMD JS lib to handle products search for E-Com Plus stores

CHANGELOG

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-engine

Node.js

npm i --save @ecomplus/utils @ecomplus/search-engine

CDN

<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.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free