Web / Apache Lucene Interview questions
What is a Lucene Document?
A Document is Lucene's basic unit of indexing and retrieval - roughly analogous to a row in a database table, except it's schema-flexible. Each Document is simply a container holding one or more named Field objects.
You don't index raw files or objects directly; you construct a Document, add Fields to it (title, body, price, tags, and so on), and hand that Document to the IndexWriter. When a search matches, Lucene returns the matching Documents, from which you can pull back whichever fields were marked as stored.
Because Documents aren't tied to a fixed schema, different Documents in the same index can carry different sets of fields, which is useful for heterogeneous content like a mixed product-and-article catalog.
More Related questions...