Learn some of the learning records of Hadoop

Source: Internet
Author: User
Keywords Hadoop
Tags archive data data structure different document file full-text search group

Inverted index

Introduction

Inverted index (English: Inverted index), also often referred to as a reverse index, place file, or reverse file, is an indexing method that is used to store the mapping of a word's storage location in a document or group of documents under a Full-text search. It is the most commonly used data structure in document retrieval system.

There are two different types of reverse indexing:

· The horizontal reverse index (or Reverse archive index) of a record contains a list of each document that references the word.

· The horizontal inverted index of a word (or a fully inverted index) also contains the position of each word in a document.

Example

In English, for example, here is the text to be indexed:

· "It is what it is"

· "What Is It"

· "It is a banana"

We can get the following reverse file index:

' A ': {2}

' Banana ': {2}

' is ': {0, 1, 2}

"It": {0, 1, 2}

"What": {0, 1}

The retrieved condition "what", "is" and "it" will correspond to this collection:.

For the same text, we get these completely inverted indices, with the number of documents and the results of the words in the current query. Similarly, the number of documents and the word results for the current query start at zero. So, "banana": {(2, 3)} means "banana" in the third document (), and the fourth word (address 3) at the third document location.

"A": {(2, 2)}

' Banana ': {(2, 3)}

' Is ': {(0, 1), (0, 4), (1, 1), (2, 1)}

"It": {(0, 0), (0, 3), (1, 2), (2, 0)}

"What": {(0, 2), (1, 0)}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.