前向索引vs反向索引为什么

前向索引vs反向索引为什么

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

问题描述

我正在阅读有关倒排索引(由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.

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

08-01 14:52