Shahryar
Shahryar

Reputation: 1474

Inverted index in Lucene

I want to know which class in Lucene generates the inverted index?

Thanks

Upvotes: 4

Views: 5270

Answers (3)

Shahryar
Shahryar

Reputation: 1474

The inverted index is created in a class named FreqProxTermsWriter, based on information retrieved from documents, such as term frequency, document frequency, term position etc.

Upvotes: 3

Narayan
Narayan

Reputation: 6241

Lets break down some lucene fundamentals

An index contains a sequence of documents.

  • A document is a sequence of fields.
  • A field is a named sequence of terms.
  • A term is a string

so Field when added to documents, if they are inverted they are indexed, note that fields can be both indexed and stored

So invert(indexed) operation happens at the field level and yeah Field is a class which is where i think inversion happens

Upvotes: 0

WhiteFang34
WhiteFang34

Reputation: 72039

An inverted index is the structure of the data files that Lucene uses. There's not really any particular class that makes it inverted. The classes in the org.apache.lucene.index package manage the files that ultimately make the data structure an inverted index.

Upvotes: 1

Related Questions