倒排索引解题思路
来源:互联网 发布:扎克拉文体测数据 编辑:程序博客网 时间:2024/05/18 18:55
应用背景:对网页,文档进行合理的存储。构建合理的索引
数据源:
"mapreduce is simple , this is test case" (来自1.html)
"hello mapreduce ,hello world, hello mapreduce of inversedIndex,the athor is daidai"(来自2.html)
期望结果:某个单词在某个文档中出现的次数
(mapreduce,1.html:1;2.html:2)
(is,1.html:2;2.html:1)
map任务:统计某个单词在某个文档中出现的了一次,通过combine任务来统计某个单词在某个文档中出现的总次数
所以我们期望的map结果如下:、
(mapreduce:1.html,1)
(is:1.html,1)
(is:1.html,1)
(mapreduce:2.html,1)
(mapreduce:2.html,1)
(is:2.html,1)
通过combine程序我们完成词频统计部分,得到结果
(mapreduce,1.html:1)
(is,1.html:2)
(mapreduce,2.html:2)
(is,2.html:1)
通过洗牌后,得到结果、
(mapreduce,(1.html:1),(2.html:2))
(is,(1.html:2);(2.html:1))
reduce任务无需特别处理直接统计结果:
(mapreduce,1.html:1;2.html:2)
(is,1.html:2;2.html:1)
数据源:
"mapreduce is simple , this is test case" (来自1.html)
"hello mapreduce ,hello world, hello mapreduce of inversedIndex,the athor is daidai"(来自2.html)
期望结果:某个单词在某个文档中出现的次数
(mapreduce,1.html:1;2.html:2)
(is,1.html:2;2.html:1)
map任务:统计某个单词在某个文档中出现的了一次,通过combine任务来统计某个单词在某个文档中出现的总次数
所以我们期望的map结果如下:、
(mapreduce:1.html,1)
(is:1.html,1)
(is:1.html,1)
(mapreduce:2.html,1)
(mapreduce:2.html,1)
(is:2.html,1)
通过combine程序我们完成词频统计部分,得到结果
(mapreduce,1.html:1)
(is,1.html:2)
(mapreduce,2.html:2)
(is,2.html:1)
通过洗牌后,得到结果、
(mapreduce,(1.html:1),(2.html:2))
(is,(1.html:2);(2.html:1))
reduce任务无需特别处理直接统计结果:
(mapreduce,1.html:1;2.html:2)
(is,1.html:2;2.html:1)
0 0
- 倒排索引解题思路
- 倒排索引原理
- 倒排索引
- 倒排索引
- 倒排索引
- 索引 倒排
- 倒排索引
- 倒排索引
- hadoop 倒排索引
- 倒排索引技术
- 什么是倒排索引?
- 倒排索引求子串
- 倒排索引
- 倒排索引
- 倒排索引
- 倒排索引
- 倒排索引
- 倒排索引
- Parcelable vs Serializable
- C#线程同步(2)- 临界区&Monitor
- 图书管理系统开发--问题解决
- Oracle操作及卸载
- TOJ 3886 Simplifying the Farm / 最小生成树+计数
- 倒排索引解题思路
- keil报错与解决方法
- 【数据结构】平衡二叉树[AVL树](一)——插入
- 新手操作PS技巧 - photoshop切片导出格式默认为gif的修改方法
- android 中dp px之间的关系
- struts2-(2)---通过login示例解析几个struts.xml配置
- memcache VS memcached
- 形参和实参
- 视频建站系统Pocle v2.6 简体中文 GBK