如何存储搜索历史
我正在构建一组“当前趋势”可视化,以展示我的系统中的趋势搜索/趋势文档。显示进入我的系统的热门查询/查看最多的结果等的想法。
我想知道什么是最有效和可扩展的基于 Java 的后端。如果它是一个数据库,架构应该是什么样的?或者在 Lucene 索引中维护这些信息是否明智?目前,对于原型,我将它们以非结构化格式存储在平面文件中。
I am building a set of 'Now-Trending' kind of visualizations to showcase the trending searches/ trending documents within my system. The idea to show the top queries that came to my system/ most viewed results etc.
I was wondering what would be the most effective and scalable Java based backend for this. If it's a database what should be the schema like? Or is it wise to maintain this info within a Lucene index? Presently for the prototype I store them in a flat file in an unstructured format.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您计划临时捕获数据或不确定将来的数据需求,则无模式后端可能更可取。此外,可扩展的解决方案(水平)将支持数据集的增长。关于您是否将这些数据存储在搜索引擎中的问题,这里有一篇很棒的文章通过一些示例讨论了这个概念。
http://www.elasticsearch .org/blog/2011/05/13/data-visualization-with-elasticsearch-and-protovis.html
A schema-less backend might be preferable if you plan on capturing data ad-hoc or are unsure of your data needs in the future. Additionally, a scalable solution (horizontally) would support growth in the dataset. With regards to your question about whether to store this data in a search engine, here's a great article going over that concept with some examples.
http://www.elasticsearch.org/blog/2011/05/13/data-visualization-with-elasticsearch-and-protovis.html
您可以尝试将此类数据存储在键值存储中,例如 Redis。 Redis 具有高效的原子方法来递增计数器,您可以使用这些方法来累积查询的投票。
You might try storing this kind of data in a key-value store such as Redis. Redis has efficient atomic methods for incrementing counters that you can use for accruing votes for queries.