Lucene uses a well-known index structure called an inverted index. Quite simply, and probably unsurprisingly, an inverted index is an inside-out arrangement of documents such that terms take center stage. Each term refers to the documents that contain it. Let’s dissect our sample book data index to get adeeper glimpse at the files in an index Directory.
Regardless of whether you’re working with a RAMDirectory, an FSDirectory, or any otherDirectory implementation, the internal structure is a group of files. In a RAMDirectory, the files are
Figure B.3 Detailed look inside the Lucene index format
The following sections describe each of the files shown in figure B.3 in more detail.
FIELD NAMES (.FNM)
The .fnm file contains all the field names used by documents in the associated segment. Each field is
flagged to indicate options that were used while indexing: