阅读笔记(仅供自己备忘)
1 . 索引前缀 , 存放id, 按照rank排序 (对于标签)
Every time an user enters a query, like "news", we compute all the prefixes: "n", "ne", "new", "news". We use every prefix as the key name for a sorted set, executing the a ZINCRBY <prefix> 1 news for each key.
In order to complete a given prefix, we just need to perform a ZRANGE <prefix> 0 4, to show the first 5 items.
2 . 索引词 - id list
3 . 查找前缀 , 如果前缀找不到 , 那么就查找词
4 . 如果有空格 或者 找不到 分词 然后再处理
5 . 取得多个 id list 按照分数做合并
6 . 通过id list和hash取实体
7 . 不同类型用不同的key 比如 ask:news ; tag:news ; ...