使用Solr进行索引并使用Mongodb和nodejs进行搜索

Ale*_*Roe 9 lucene solr mongodb node.js

有没有人对这个特定的堆栈有任何经验?我正在开发一个最终将包含大量数据的Web项目,并试图让Solr与一些简单的Mongodb条目很好地配合,但我发现很少甚至没有关于它的信息.我发现了这个:http://blog.knuthaugen.no/2010/04/cooking-with-mongodb-and-solr.html这是mongodb + solr + php,但我很难看到我将如何使用节点类似.有人有任何见解吗?我非常感激.如果这是一个愚蠢的尝试实施,请随时告诉我!

找到了这个库:https://github.com/tjgillies/node-lucene

看起来不像那里有很多文档,但我会试一试.

更新:所以快速修复(不理想)是使用Perl模块用于lucene然后在Node.js中使用子进程功能,我能够在lucene中插入和搜索我的数据.因此,对于解决方法,它可以解决问题.

wpr*_*prl 3

这个项目看起来很有前途: https: //github.com/gsf/node-solr。文档不是很多,但测试很有希望具有描述性。

然后你可能会在你的猫鼬模式中做这样的事情:

schema.pre('save', function (next) {
  // this will be triggered when your mongoose schema object is saved
  // TODO add to a queue that sends the documents to SOLR in e.g. batches
  //      of 2000
});
Run Code Online (Sandbox Code Playgroud)

http://mongoosejs.com/docs/middleware.html

我一直想尝试 mongo + SOLR + Node 但还没有开始任何编码。