【文件属性】:
文件名称:node-elasticsearch-cacheable:在 redis 中缓存 elasticsearch 搜索查询
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-24 12:55:05
JavaScript
节点弹性搜索缓存
修改官方elasticsearch-js客户端,在redis中添加缓存。 在我的测试中,elasticsearch 有 12% 到 4% 的响应。
##Getting 开始安装:
npm install elasticsearch-cacheable
创建一个 elasticsearch 客户端,用这个模块改变它并使用:
var esClient = require ( 'elasticsearch' ) . Client ( ) ;
require ( './elasticsearch-cacheable' ) ( esClient ) ;
esClient . search ( {
...
} , function ( err , results ) {
...
} ) ;
##Options 变异时,有一个默认配置:
{
redisPor
【文件预览】:
node-elasticsearch-cacheable-master
----.gitignore(13B)
----package.json(734B)
----index.js(1KB)
----README.md(1KB)
----example.js(452B)