Skip to content
Permalink
Browse files

Added script to search blog

  • Loading branch information
davidmerfield committed Nov 11, 2019
1 parent 87e4bc6 commit 1fcde736ac784b1a6e26c97ff65934f5ab24e38f
Showing with 17 additions and 0 deletions.
  1. +17 −0 scripts/blog/search.js
@@ -0,0 +1,17 @@
var Entry = require("entry");
var reds = require("reds");
var transliterate = require("transliteration");
var get = require("../get/blog");

get(process.argv[2], function(err, user, blog) {
if (err) throw err;
var string = process.argv[3];
var search = reds.createSearch("blog:" + blog.id + ":search");

search.query(transliterate(string)).end(function(err, ids) {
console.log(ids);
Entry.get(blog.id, ids, function(entries) {
console.log("found", entries.length, "entries");
});
});
});

0 comments on commit 1fcde73

Please sign in to comment.
You can’t perform that action at this time.