1.0.0 • Published 5 years ago

egg-sphinx v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

egg-sphinx

Sphinx plugin for egg

egg-sphinx

NPM version npm download

Install

$ npm i egg-sphinx --save

Usage

// {app_root}/config/plugin.js
exports.sphinx = {
  enable: true,
  package: 'egg-sphinx',
}

[sphinx-promise](https://www.npmjs.com/package/sphinx-promise) is required.

Configuration

// {app_root}/config/config.default.js
exports.sphinx = {
  clients: {
    sphinx1: {
      host: 'localhost',
      port: 9312
    },
    sphinx2: {
      host: 'localhost',
      port: 9312
    }
  }
}

see config/config.default.js for more details.

How

For more details, please refer to the following links.

sphinx-promise

sphinxapi

From the Sphinx official documentation : http://sphinxsearch.com/docs/current.html#api-reference

Example

const sphinx = app.sphinx.get('sphinxTest')
const result = await sphinx.query('hello world', {
    matchMode: sphinx.SPH_MATCH_EXTENDED2
})

Questions & Suggestions

Please open an issue here.

License

MIT