Web / Apache Lucene Interview questions
What are the different types of Field in Lucene?
Lucene ships several ready-made Field subclasses so you don't have to hand-configure a FieldType for common cases:
| Field Type | Behavior |
| TextField | Analyzed and tokenized, optionally stored - for prose. |
| StringField | Indexed as a single un-tokenized term - for exact-match values like IDs. |
| StoredField | Stored only, not indexed - for data you only need to display. |
| IntPoint / LongPoint | Indexed for efficient numeric range queries. |
| SortedDocValuesField | Column-oriented storage for fast sorting and faceting. |
Picking the right subclass up front avoids a lot of manual FieldType wiring and keeps the intent of each field obvious to anyone reading the indexing code later.
More Related questions...