正向指数 vs 反向指数 为什么? [英] Forward Index vs Inverted index Why?

查看:24
本文介绍了正向指数 vs 反向指数 为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读有关倒排索引(由 Solr、Elastic Search 等文本搜索引擎使用)以及据我所知(如果我们以人"为例):

I was reading about inverted index (used by the text search engines like Solr, Elastic Search etc) and as I understand (if we take "Person" as an example):

Person 关系的属性反转:

The attribute to Person relationship is inverted:

John -> PersonId(1), PersonId(2), PersonId(3)
London -> PersonId(1), PersonId(2), PersonId(5)

我现在可以搜索住在伦敦的约翰"的人员记录

I can now search the person records for 'John who lives in London'

这不是解决了所有问题吗?为什么我们有前向(或常规数据库索引)?或者换句话说,在什么情况下常规索引是有用的?请解释.谢谢.

Doesn't this solve all the problems? Why do we have the forward (or regular database index) at all? Or in other words, in what cases the regular indexing is useful? Please explain. Thanks.

推荐答案

您忽略的一点是正向索引和反向索引之间没有真正的技术区别.在这种情况下,正向"和反向"只是用来区分的描述性术语:

The point that you're missing is that there is no real technical distinction between a forward index and an inverted index. "Forward" and "inverted" in this case are just descriptive terms to distinguish between:

  • 文档中包含的单词列表.
  • 包含单词的文档列表.

倒排索引的概念只有在常规(正向)索引的概念已经存在时才有意义.在搜索引擎的上下文中,前向索引将是术语向量;包含在特定文档中的术语列表.倒排索引将是包含给定术语的文档列表.

The concept of an inverted index only makes sense if the concept of a regular (forward) index already exists. In the context of a search engine, a forward index would be the term vector; a list of terms contained within a particular document. The inverted index would be a list of documents containing a given term.

当您了解术语正向"和反向"实际上只是用于描述您所谈论的索引的性质的相对术语时 - 并且索引实际上只是一个索引 - 您的问题不会真的更有意义了.

When you understand that the terms "forward" and "inverted" are really just relative terms used to describe the nature of the index you're talking about - and that really an index is just an index - your question doesn't really make sense any more.

这篇关于正向指数 vs 反向指数 为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆