egg-sphinx
v1.0.0
Published
Sphinx plugin for egg
Downloads
5
Readme
egg-sphinx
Sphinx plugin for egg
egg-sphinx
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] (https://github.com/IPRIT/sphinx-promise)
[sphinxapi] (https://github.com/Inist-CNRS/node-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.