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)}