pylucene 3.5.0-3
[pylucene.git] / lucene-java-3.5.0 / lucene / src / java / org / apache / lucene / document / package.html
1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2 <!--
3  Licensed to the Apache Software Foundation (ASF) under one or more
4  contributor license agreements.  See the NOTICE file distributed with
5  this work for additional information regarding copyright ownership.
6  The ASF licenses this file to You under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with
8  the License.  You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 -->
18 <html>
19 <head>
20    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
21 </head>
22 <body>
23 <p>The logical representation of a {@link org.apache.lucene.document.Document} for indexing and searching.</p>
24 <p>The document package provides the user level logical representation of content to be indexed and searched.  The
25 package also provides utilities for working with {@link org.apache.lucene.document.Document}s and {@link org.apache.lucene.document.Fieldable}s.</p>
26 <h2>Document and Fieldable</h2>
27 <p>A {@link org.apache.lucene.document.Document} is a collection of {@link org.apache.lucene.document.Fieldable}s.  A
28   {@link org.apache.lucene.document.Fieldable} is a logical representation of a user's content that needs to be indexed or stored.
29   {@link org.apache.lucene.document.Fieldable}s have a number of properties that tell Lucene how to treat the content (like indexed, tokenized,
30   stored, etc.)  See the {@link org.apache.lucene.document.Field} implementation of {@link org.apache.lucene.document.Fieldable}
31   for specifics on these properties.
32 </p>
33 <p>Note: it is common to refer to {@link org.apache.lucene.document.Document}s having {@link org.apache.lucene.document.Field}s, even though technically they have
34 {@link org.apache.lucene.document.Fieldable}s.</p>
35 <h2>Working with Documents</h2>
36 <p>First and foremost, a {@link org.apache.lucene.document.Document} is something created by the user application.  It is your job
37   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.)
38   How this is done is completely up to you.  That being said, there are many tools available in other projects that can make
39   the process of taking a file and converting it into a Lucene {@link org.apache.lucene.document.Document}.  To see an example of this,
40   take a look at the Lucene <a href="../../../../../../gettingstarted.html" target="top">demo</a> and the associated source code
41   for extracting content from HTML.
42 </p>
43 <p>The {@link org.apache.lucene.document.DateTools} is a utility class to make dates and times searchable
44 (remember, Lucene only searches text). {@link org.apache.lucene.document.NumericField} is a special helper class
45 to simplify indexing of numeric values (and also dates) for fast range range queries with {@link org.apache.lucene.search.NumericRangeQuery}
46 (using a special sortable string representation of numeric values).</p>
47 <p>The {@link org.apache.lucene.document.FieldSelector} class provides a mechanism to tell Lucene how to load Documents from
48 storage.  If no FieldSelector is used, all Fieldables on a Document will be loaded.  As an example of the FieldSelector usage, consider
49   the common use case of
50 displaying search results on a web page and then having users click through to see the full document.  In this scenario, it is often
51   the case that there are many small fields and one or two large fields (containing the contents of the original file). Before the FieldSelector,
52 the full Document had to be loaded, including the large fields, in order to display the results.  Now, using the FieldSelector, one
53 can {@link org.apache.lucene.document.FieldSelectorResult#LAZY_LOAD} the large fields, thus only loading the large fields
54 when a user clicks on the actual link to view the original content.</p>
55 </body>
56 </html>