You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.
I have made a small change to the article.js to allow for searching for normal couchdb setups via elasticsearch and the couchdb river
https://github.com/elasticsearch/elasticsearch-river-couchdb
Once the river plugin is installed setup the river for articles:
curl -XPUT 'http://elasticsearch_host:9200/_river/articles/_meta' -d '{
"type" : "couchdb",
"couchdb" : {
"host" : "couchdb_host",
"port" : 5984,
"db" : "articles"
}
Install elasticsearch node client
npm install --save elasticsearch
Changes to: includes/article.js
var articles = require('./cloudant.js').articles;
var moment = require('moment');
var async = require('async');
var mc = require('./mc.js');
var elasticsearch = require('elasticsearch');
Replace the search part from line 322
var search = function (keywords, callback) {
var client = new elasticsearch.Client( { host: 'elasticsearch_host:9200', log: 'info' } );
client.search({
q: keywords, index: "articles", size: 99
}).then(function (body) {
retval = [];
for (i = 0; i < body.hits.hits.length; i++) {
retval.push(body.hits.hits[i]._source);
}
callback(false, retval);
}, function (error) {
console.trace(error.message);
});
};
The text was updated successfully, but these errors were encountered: