- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Inverted Index and Forward Index
Inverted Index and Forward Index are data structures used to search text in a document or set of documents.
Inverted Index
Inverted Index stores the words as index and document name(s) as mapped reference(s).
Forward Index
Forward Index stores the document name as index and word(s) as mapped reference(s).
The following are some of the important differences between the Inverted Index and Forward Index.
Sr. No. | Key | Inverted Index | Forward Index |
---|---|---|---|
1 | Mapping Pattern | Inverted Index stores the words as index and document name(s) as mapped reference(s). | Forward Index stores the document name as index and word(s) as mapped reference(s). |
2 | Index Building Process |
|
|
3 | Indexing | In the Inverted index, indexing is slow as each word has to be checked before preparing the index. | In the forward index, indexing is fast as keywords are appended when found. |
4 | Searching | In the Inverted index, the search is quite fast. | In the forward index, the search is slow. |
5 | Example | Word Documents ------------------------- Welcome doc1 Hello doc1, doc3 Hi doc2 ------------------------- | Word Documents ------------------------- doc1 Welcome, Hello doc2 Hi doc3 Hello ------------------------- |
6 | Duplicity | In the Inverted index, no duplicate keyword is stored in an index. | In the forward index, duplicate keywords can be present in an index like 'Hello'. |
7 | Real-Life Examples | A glossary at end of the index, Reverse Lookup. | Table of Content at the start of the book, DNS lookup. |
- Related Articles
- Difference between Housing Prices Index and Consumer Price Index
- Difference between clustered index and non-clustered index in SQL server
- Difference between Cost Performance Index (CPI) and Schedule Performance Index (SPI)
- Difference between Consumer Price Index and Inflation
- Difference Between Clustered and Non-clustered index
- Difference between Hedge Funds and Index Funds
- Difference between Net Present Value (NPV) and Profitability Index (PI)
- Difference between Forward and Future Contract
- Python Pandas - Calculate TimedeltaArray of difference between index values and index converted to PeriodArray at specified freq
- Difference between SHOW INDEX, SHOW INDEXES and SHOW KEYS in MySQL?
- Difference between Forward Engineering and Reverse Engineering
- Difference Between Forward and Backward Reasoning in AI
- Relation Between Critical Angle and Refractive Index
- Odd even index difference - JavaScript
- Greatest sum and smallest index difference in JavaScript

Advertisements