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

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

问题描述

我正在阅读倒排索引(由 Solr、Elastic Search 等文本搜索引擎使用),据我了解(如果我们以Person"为例):

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.

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

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