Package org.apache.lucene.document

The logical representation of a Document for indexing and searching.

See:
          Description

Class Summary
ByteDocValuesField This class provides a Field that enables storing of a per-document byte value for scoring, sorting or value retrieval.
CompressionTools Simple utility class providing static methods to compress and decompress binary data for stored fields.
DateTools Provides support for converting dates to strings and vice-versa.
DerefBytesDocValuesField This class provides a Field that enables storing of a per-document BytesRef value.
Document Documents are the unit of indexing and search.
DocumentStoredFieldVisitor A StoredFieldVisitor that creates a Document containing all stored fields, or only specific requested fields provided to DocumentStoredFieldVisitor.DocumentStoredFieldVisitor(Set) This is used by IndexReader.document(int) to load a document.
DoubleDocValuesField This class provides a Field that enables storing of a per-document double value for scoring, sorting or value retrieval.
DoubleField This class provides a Field that enables indexing of double values for efficient range filtering and sorting.
Field Expert: directly create a field for a document.
FieldType Describes the properties of a field.
FloatDocValuesField This class provides a Field that enables storing of a per-document float value for scoring, sorting or value retrieval.
FloatField This class provides a Field that enables indexing of float values for efficient range filtering and sorting.
IntDocValuesField This class provides a Field that enables storing of a per-document int value for scoring, sorting or value retrieval.
IntField This class provides a Field that enables indexing of integer values for efficient range filtering and sorting.
LongDocValuesField This class provides a Field that enables storing of a per-document long value for scoring, sorting or value retrieval.
LongField This class provides a Field that enables indexing of long values for efficient range filtering and sorting.
PackedLongDocValuesField This class provides a Field that enables storing of a per-document long value for scoring, sorting or value retrieval.
ShortDocValuesField This class provides a Field that enables storing of a per-document short value for scoring, sorting or value retrieval.
SortedBytesDocValuesField This class provides a Field that enables storing of a per-document BytesRef value, indexed for sorting.
StoredField A field whose value is stored so that IndexSearcher.doc(int) and IndexReader.document(int, org.apache.lucene.index.StoredFieldVisitor) will return the field and its value.
StraightBytesDocValuesField This class provides a Field that enables storing of a per-document BytesRef value.
StringField A field that is indexed but not tokenized: the entire String value is indexed as a single token.
TextField A field that is indexed and tokenized, without term vectors.
 

Enum Summary
DateTools.Resolution Specifies the time granularity.
Field.Index Deprecated. This is here only to ease transition from the pre-4.0 APIs.
Field.Store Specifies whether a field's value should be stored.
Field.TermVector Deprecated. This is here only to ease transition from the pre-4.0 APIs.
FieldType.NumericType Data type of the numeric value
 

Package org.apache.lucene.document Description

The logical representation of a Document for indexing and searching.

The document package provides the user level logical representation of content to be indexed and searched. The package also provides utilities for working with Documents and IndexableFields.

Document and IndexableField

A Document is a collection of IndexableFields. A IndexableField is a logical representation of a user's content that needs to be indexed or stored. IndexableFields have a number of properties that tell Lucene how to treat the content (like indexed, tokenized, stored, etc.) See the Field implementation of IndexableField for specifics on these properties.

Note: it is common to refer to Documents having Fields, even though technically they have IndexableFields.

Working with Documents

First and foremost, a Document is something created by the user application. It is your job to create Documents based on the content of the files you are working with in your application (Word, txt, PDF, Excel or any other format.) How this is done is completely up to you. That being said, there are many tools available in other projects that can make the process of taking a file and converting it into a Lucene Document.

The DateTools is a utility class to make dates and times searchable (remember, Lucene only searches text). IntField, LongField, FloatField and DoubleField are a special helper class to simplify indexing of numeric values (and also dates) for fast range range queries with NumericRangeQuery (using a special sortable string representation of numeric values).



Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.