我准备用nodejs结合Mongoose还有elasticsearch来搭建一个博客站内搜索引擎,支持字段筛选搜索(分类搜索,标签搜索)等功能,看了一些mongo和es的文章,下面是我对mongo和es的理解和问题。
问题一:
它的大概思路应该就是安装elasticsearch之后安装一个head插件,和river插件,用river插件将mongo中的数据导入搜索引擎,然后利用elasticsearch的客户端对数据进行搜索,搜索出来的应该是一堆排序后的ids,然后在通过mongo的$in筛选器查询出真实的文档列表,是这样的流程吗?
问题二:
建立索引结构,和设计索引映射表,这该如何设计,对于这个部分思路实在不太清晰,可能需要大牛给一点科普链接来强化补脑一下
Hey, I waited for so long and no one answered, but I crawled and crawled and finally found a complete process address http://stackoverflow.com/questions/23846971/how-to-use-elasticsearch-with- mongodb
This is the authoritative guide to es. It took me a long time to find it. Now I can learn es in a more systematic way. After reading it, I feel it is very easy to understand.
http://looly.gitbooks.io/elasticsearch-the-definitive -guide-cn/
I hope it is useful to everyone, so that you can have a cool enough search engine for your blog
What should be searched should be a bunch of sorted ids, and then the real document list can be queried through mongo’s $in filter
Doesn’t this affect performance? I don't think it's advisable.
Try to follow the anti-paradigm
http://blog.csdn.net/dm_vincent/article/details/47710367