I have a problem right now, Algolia does provide a rich documentation regarding node.js but my problem right now are
1) how do i import mongodb database to algolia server? seems like they are showing how to use MySql database instead of Mongodb with node.js
2) Im using ejs to render the html, so do i need to query the value of a search using node.js or just let the clientside html handle it?
because with ejs I have to use
app.get("/testingSearch", function(req, res) {
res.render('testing', { message: value});
})
app.post("/postSearch", function(req, res) {
// some searching
var name = req.body.name;
// algolia
});
Anyone who has an experience with algolia + node.js + mongodb , please lend me your advise. Thank you
MongoDB
If you just want to have a complete replica of a collection, you can use the Algolia's MongoDB connector.
However, if you want to do a more advanced indexing, you should add algolia indexing calls alongside the calls to your database.
Rendering
Algolia has been designed to be used in your front-end. See this FAQ entry. However, for SEO purposes, a back-end search might make sense to you. Since the JS client is isomorphic, you can mix the two pretty easily.
来源:https://stackoverflow.com/questions/33169228/algolia-for-node-js-and-mongodb