You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ar...@apache.org on 2008/06/25 04:52:47 UTC
svn commit: r671405 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/
Author: aroush
Date: Tue Jun 24 19:52:46 2008
New Revision: 671405
URL: http://svn.apache.org/viewvc?rev=671405&view=rev
Log:
Release: Apache Lucene.Net.2.3.1 build 001 "Alpha"
Modified:
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/AbstractField.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Document.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Field.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelector.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelectorResult.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Fieldable.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/LoadFirstFieldSelector.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/MapFieldSelector.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Package.html
incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/SetBasedFieldSelector.cs
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/AbstractField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/AbstractField.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/AbstractField.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/AbstractField.cs Tue Jun 24 19:52:46 2008
@@ -346,7 +346,8 @@
return result.ToString();
}
public abstract byte[] BinaryValue();
- public abstract System.String StringValue();
public abstract System.IO.TextReader ReaderValue();
+ public abstract System.String StringValue();
+ public abstract Lucene.Net.Analysis.TokenStream TokenStreamValue();
}
}
\ No newline at end of file
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Document.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/Document.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Document.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Document.cs Tue Jun 24 19:52:46 2008
@@ -42,7 +42,60 @@
[Serializable]
public sealed class Document
{
- internal System.Collections.IList fields = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
+ private class AnonymousClassEnumeration : System.Collections.IEnumerator
+ {
+ public AnonymousClassEnumeration(Document enclosingInstance)
+ {
+ InitBlock(enclosingInstance);
+ }
+ private void InitBlock(Document enclosingInstance)
+ {
+ this.enclosingInstance = enclosingInstance;
+ iter = Enclosing_Instance.fields.GetEnumerator();
+ }
+ private System.Object tempAuxObj;
+ public bool MoveNext()
+ {
+ bool result = HasMoreElements();
+ if (result)
+ {
+ tempAuxObj = NextElement();
+ }
+ return result;
+ }
+ public void Reset()
+ {
+ tempAuxObj = null;
+ }
+ public System.Object Current
+ {
+ get
+ {
+ return tempAuxObj;
+ }
+
+ }
+ private Document enclosingInstance;
+ public Document Enclosing_Instance
+ {
+ get
+ {
+ return enclosingInstance;
+ }
+
+ }
+ internal System.Collections.IEnumerator iter;
+ public bool HasMoreElements()
+ {
+ return iter.MoveNext();
+ }
+ public System.Object NextElement()
+ {
+ return iter.Current;
+ }
+ }
+
+ internal System.Collections.IList fields = new System.Collections.ArrayList();
private float boost = 1.0f;
/// <summary>Constructs a new document with no fields. </summary>
@@ -61,29 +114,32 @@
/// <summary>Sets a boost factor for hits on any field of this document. This value
/// will be multiplied into the score of all hits on this document.
///
+ /// <p>The default value is 1.0.
+ ///
/// <p>Values are multiplied into the value of {@link Fieldable#GetBoost()} of
/// each field in this document. Thus, this method in effect sets a default
/// boost for the fields of this document.
///
/// </summary>
- /// <seealso cref="Fieldable#SetBoost(float)">
+ /// <seealso cref="Fieldable.SetBoost(float)">
/// </seealso>
public void SetBoost(float boost)
{
this.boost = boost;
}
- /// <summary>Returns the boost factor for hits on any field of this document.
+ /// <summary>Returns, at indexing time, the boost factor as set by {@link #SetBoost(float)}.
///
- /// <p>The default value is 1.0.
- ///
- /// <p>Note: This value is not stored directly with the document in the index.
- /// Documents returned from {@link IndexReader#Document(int)} and
- /// {@link Hits#Doc(int)} may thus not have the same value present as when
- /// this document was indexed.
+ /// <p>Note that once a document is indexed this value is no longer available
+ /// from the index. At search time, for retrieved documents, this method always
+ /// returns 1. This however does not mean that the boost value set at indexing
+ /// time was ignored - it was just combined with other indexing time factors and
+ /// stored elsewhere, for better indexing and search performance. (For more
+ /// information see the "norm(t,d)" part of the scoring formula in
+ /// {@link Lucene.Net.Search.Similarity Similarity}.)
///
/// </summary>
- /// <seealso cref="#SetBoost(float)">
+ /// <seealso cref="SetBoost(float)">
/// </seealso>
public float GetBoost()
{
@@ -198,9 +254,9 @@
/// <summary>Returns an Enumeration of all the fields in a document.</summary>
/// <deprecated> use {@link #GetFields()} instead
/// </deprecated>
- public System.Collections.IEnumerable Fields()
+ public System.Collections.IEnumerator Fields()
{
- return fields;
+ return new AnonymousClassEnumeration(this); // {{Aroush-2.3.1}} will "return fields;" do it?
}
/// <summary>Returns a List of all the fields in a document.
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Field.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/Field.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Field.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Field.cs Tue Jun 24 19:52:46 2008
@@ -16,7 +16,10 @@
*/
using System;
+
+using IndexWriter = Lucene.Net.Index.IndexWriter;
using Parameter = Lucene.Net.Util.Parameter;
+using TokenStream = Lucene.Net.Analysis.TokenStream;
namespace Lucene.Net.Documents
{
@@ -37,7 +40,7 @@
public sealed class Store : Parameter
{
- internal Store(System.String name):base(name)
+ internal Store(System.String name) : base(name)
{
}
@@ -141,33 +144,81 @@
}
- /// <summary>The value of the field as a String, or null. If null, the Reader value
- /// or binary value is used. Exactly one of stringValue(), readerValue(), and
- /// binaryValue() must be set.
+ /// <summary>The value of the field as a String, or null. If null, the Reader value,
+ /// binary value, or TokenStream value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
/// </summary>
public override System.String StringValue()
{
return fieldsData is System.String ? (System.String) fieldsData : null;
}
- /// <summary>The value of the field as a Reader, or null. If null, the String value
- /// or binary value is used. Exactly one of stringValue(), readerValue(),
- /// and binaryValue() must be set.
+ /// <summary>The value of the field as a Reader, or null. If null, the String value,
+ /// binary value, or TokenStream value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
/// </summary>
public override System.IO.TextReader ReaderValue()
{
return fieldsData is System.IO.TextReader ? (System.IO.TextReader) fieldsData : null;
}
- /// <summary>The value of the field in Binary, or null. If null, the Reader or
- /// String value is used. Exactly one of stringValue(), readerValue() and
- /// binaryValue() must be set.
+ /// <summary>The value of the field in Binary, or null. If null, the Reader value,
+ /// String value, or TokenStream value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
/// </summary>
public override byte[] BinaryValue()
{
return fieldsData is byte[] ? (byte[]) fieldsData : null;
}
+ /// <summary>The value of the field as a TokesStream, or null. If null, the Reader value,
+ /// String value, or binary value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
+ /// </summary>
+ public override TokenStream TokenStreamValue()
+ {
+ return fieldsData is TokenStream ? (TokenStream) fieldsData : null;
+ }
+
+
+ /// <summary><p>Expert: change the value of this field. This can
+ /// be used during indexing to re-use a single Field
+ /// instance to improve indexing speed by avoiding GC cost
+ /// of new'ing and reclaiming Field instances. Typically
+ /// a single {@link Document} instance is re-used as
+ /// well. This helps most on small documents.</p>
+ ///
+ /// <p>Note that you should only use this method after the
+ /// Field has been consumed (ie, the {@link Document}
+ /// containing this Field has been added to the index).
+ /// Also, each Field instance should only be used once
+ /// within a single {@link Document} instance. See <a
+ /// href="http://wiki.apache.org/lucene-java/ImproveIndexingSpeed">ImproveIndexingSpeed</a>
+ /// for details.</p>
+ /// </summary>
+ public void SetValue(System.String value_Renamed)
+ {
+ fieldsData = value_Renamed;
+ }
+
+ /// <summary>Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>. </summary>
+ public void SetValue(System.IO.TextReader value_Renamed)
+ {
+ fieldsData = value_Renamed;
+ }
+
+ /// <summary>Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>. </summary>
+ public void SetValue(byte[] value_Renamed)
+ {
+ fieldsData = value_Renamed;
+ }
+
+ /// <summary>Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>. </summary>
+ public void SetValue(TokenStream value_Renamed)
+ {
+ fieldsData = value_Renamed;
+ }
+
/// <summary> Create a field by specifying its name, value and how it will
/// be saved in the index. Term vectors will not be stored in the index.
///
@@ -277,7 +328,9 @@
}
/// <summary> Create a tokenized and indexed field that is not stored. Term vectors will
- /// not be stored. The Reader is read only when the Document is added to the index.
+ /// not be stored. The Reader is read only when the Document is added to the index,
+ /// i.e. you may not close the Reader until {@link IndexWriter#AddDocument(Document)}
+ /// has been called.
///
/// </summary>
/// <param name="name">The name of the field
@@ -290,7 +343,9 @@
}
/// <summary> Create a tokenized and indexed field that is not stored, optionally with
- /// storing term vectors. The Reader is read only when the Document is added to the index.
+ /// storing term vectors. The Reader is read only when the Document is added to the index,
+ /// i.e. you may not close the Reader until {@link IndexWriter#AddDocument(Document)}
+ /// has been called.
///
/// </summary>
/// <param name="name">The name of the field
@@ -321,6 +376,58 @@
SetStoreTermVector(termVector);
}
+ /// <summary> Create a tokenized and indexed field that is not stored. Term vectors will
+ /// not be stored. This is useful for pre-analyzed fields.
+ /// The TokenStream is read only when the Document is added to the index,
+ /// i.e. you may not close the TokenStream until {@link IndexWriter#AddDocument(Document)}
+ /// has been called.
+ ///
+ /// </summary>
+ /// <param name="name">The name of the field
+ /// </param>
+ /// <param name="tokenStream">The TokenStream with the content
+ /// </param>
+ /// <throws> NullPointerException if name or tokenStream is <code>null</code> </throws>
+ public Field(System.String name, TokenStream tokenStream):this(name, tokenStream, TermVector.NO)
+ {
+ }
+
+ /// <summary> Create a tokenized and indexed field that is not stored, optionally with
+ /// storing term vectors. This is useful for pre-analyzed fields.
+ /// The TokenStream is read only when the Document is added to the index,
+ /// i.e. you may not close the TokenStream until {@link IndexWriter#AddDocument(Document)}
+ /// has been called.
+ ///
+ /// </summary>
+ /// <param name="name">The name of the field
+ /// </param>
+ /// <param name="tokenStream">The TokenStream with the content
+ /// </param>
+ /// <param name="termVector">Whether term vector should be stored
+ /// </param>
+ /// <throws> NullPointerException if name or tokenStream is <code>null</code> </throws>
+ public Field(System.String name, TokenStream tokenStream, TermVector termVector)
+ {
+ if (name == null)
+ throw new System.NullReferenceException("name cannot be null");
+ if (tokenStream == null)
+ throw new System.NullReferenceException("tokenStream cannot be null");
+
+ this.name = String.Intern(name); // field names are interned
+ this.fieldsData = tokenStream;
+
+ this.isStored = false;
+ this.isCompressed = false;
+
+ this.isIndexed = true;
+ this.isTokenized = true;
+
+ this.isBinary = false;
+
+ SetStoreTermVector(termVector);
+ }
+
+
/// <summary> Create a stored field with binary value. Optionally the value may be compressed.
///
/// </summary>
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/FieldSelector.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelector.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelector.cs Tue Jun 24 19:52:46 2008
@@ -28,9 +28,10 @@
{
/// <summary> </summary>
- /// <param name="">fieldName
+ /// <param name="fieldName">the field to accept or reject
/// </param>
- /// <returns> true if the {@link Field} with <code>fieldName</code> should be loaded or not
+ /// <returns> an instance of {@link FieldSelectorResult}
+ /// if the {@link Field} named <code>fieldName</code> should be loaded.
/// </returns>
FieldSelectorResult Accept(System.String fieldName);
}
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelectorResult.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/FieldSelectorResult.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelectorResult.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/FieldSelectorResult.cs Tue Jun 24 19:52:46 2008
@@ -16,6 +16,7 @@
*/
using System;
+using System.Runtime.InteropServices;
namespace Lucene.Net.Documents
{
@@ -24,6 +25,7 @@
///
/// </summary>
//Replace with an enumerated type in 1.5
+ [Serializable]
public sealed class FieldSelectorResult
{
@@ -32,6 +34,7 @@
/// <p/>
/// {@link Document#Add(Fieldable)} should be called by the Reader.
/// </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult LOAD = new FieldSelectorResult(0);
/// <summary> Lazily load this {@link Field}. This means the {@link Field} is valid, but it may not actually contain its data until
/// invoked. {@link Document#GetField(String)} SHOULD NOT BE USED. {@link Document#GetFieldable(String)} is safe to use and should
@@ -39,12 +42,14 @@
/// <p/>
/// {@link Document#Add(Fieldable)} should be called by the Reader.
/// </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult LAZY_LOAD = new FieldSelectorResult(1);
/// <summary> Do not load the {@link Field}. {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should return null.
/// {@link Document#Add(Fieldable)} is not called.
/// <p/>
/// {@link Document#Add(Fieldable)} should not be called by the Reader.
/// </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult NO_LOAD = new FieldSelectorResult(2);
/// <summary> Load this field as in the {@link #LOAD} case, but immediately return from {@link Field} loading for the {@link Document}. Thus, the
/// Document may not have its complete set of Fields. {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should
@@ -52,21 +57,25 @@
/// <p/>
/// {@link Document#Add(Fieldable)} should be called by the Reader.
/// </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult LOAD_AND_BREAK = new FieldSelectorResult(3);
/// <summary> Behaves much like {@link #LOAD} but does not uncompress any compressed data. This is used for internal purposes.
/// {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should not return null.
/// <p/>
/// {@link Document#Add(Fieldable)} should be called by the Reader.
/// </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult LOAD_FOR_MERGE = new FieldSelectorResult(4);
/// <summary>Expert: Load the size of this {@link Field} rather than its value.
/// Size is measured as number of bytes required to store the field == bytes for a binary or any compressed value, and 2*chars for a String value.
/// The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0]
/// </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult SIZE = new FieldSelectorResult(5);
- /// <summary>Expert: Like {@link #SIZE} but immediately break from the field loading loop, i.e. stop loading further fields, after the size is loaded </summary>
+ /// <summary>Expert: Like {@link #SIZE} but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded </summary>
+ [NonSerialized]
public static readonly FieldSelectorResult SIZE_AND_BREAK = new FieldSelectorResult(6);
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Fieldable.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/Fieldable.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Fieldable.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Fieldable.cs Tue Jun 24 19:52:46 2008
@@ -17,6 +17,8 @@
using System;
+using TokenStream = Lucene.Net.Analysis.TokenStream;
+
namespace Lucene.Net.Documents
{
@@ -39,11 +41,11 @@
/// the range of that encoding.
///
/// </summary>
- /// <seealso cref="Lucene.Net.Documents.Document#SetBoost(float)">
+ /// <seealso cref="Lucene.Net.Documents.Document.SetBoost(float)">
/// </seealso>
- /// <seealso cref="int)">
+ /// <seealso cref="Lucene.Net.Search.Similarity.LengthNorm(String, int)">
/// </seealso>
- /// <seealso cref="Lucene.Net.Search.Similarity#EncodeNorm(float)">
+ /// <seealso cref="Lucene.Net.Search.Similarity.EncodeNorm(float)">
/// </seealso>
void SetBoost(float boost);
@@ -66,24 +68,30 @@
/// </summary>
System.String Name();
- /// <summary>The value of the field as a String, or null. If null, the Reader value
- /// or binary value is used. Exactly one of stringValue(), readerValue(), and
- /// binaryValue() must be set.
+ /// <summary>The value of the field as a String, or null. If null, the Reader value,
+ /// binary value, or TokenStream value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
/// </summary>
System.String StringValue();
- /// <summary>The value of the field as a Reader, or null. If null, the String value
- /// or binary value is used. Exactly one of stringValue(), readerValue(),
- /// and binaryValue() must be set.
+ /// <summary>The value of the field as a Reader, or null. If null, the String value,
+ /// binary value, or TokenStream value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
/// </summary>
System.IO.TextReader ReaderValue();
- /// <summary>The value of the field in Binary, or null. If null, the Reader or
- /// String value is used. Exactly one of stringValue(), readerValue() and
- /// binaryValue() must be set.
+ /// <summary>The value of the field in Binary, or null. If null, the Reader value,
+ /// String value, or TokenStream value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
/// </summary>
byte[] BinaryValue();
+ /// <summary>The value of the field as a TokenStream, or null. If null, the Reader value,
+ /// String value, or binary value is used. Exactly one of stringValue(),
+ /// readerValue(), binaryValue(), and tokenStreamValue() must be set.
+ /// </summary>
+ TokenStream TokenStreamValue();
+
/// <summary>True iff the value of the field is to be stored in the index for return
/// with search hits. It is an error for this to be true if a field is
/// Reader-valued.
@@ -111,7 +119,7 @@
/// preserved, use the <code>stored</code> attribute instead.
///
/// </summary>
- /// <seealso cref="String)">
+ /// <seealso cref="Lucene.Net.Index.IndexReader.GetTermFreqVector(int, String)">
/// </seealso>
bool IsTermVectorStored();
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/LoadFirstFieldSelector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/LoadFirstFieldSelector.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/LoadFirstFieldSelector.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/LoadFirstFieldSelector.cs Tue Jun 24 19:52:46 2008
@@ -23,6 +23,7 @@
/// <p/>
/// See {@link FieldSelectorResult#LOAD_AND_BREAK}
/// </summary>
+ [Serializable]
public class LoadFirstFieldSelector : FieldSelector
{
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/MapFieldSelector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/MapFieldSelector.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/MapFieldSelector.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/MapFieldSelector.cs Tue Jun 24 19:52:46 2008
@@ -15,13 +15,6 @@
* limitations under the License.
*/
-/*
-* MapFieldSelector.java
-*
-* Created on May 2, 2006, 6:49 PM
-*
-*/
-
using System;
namespace Lucene.Net.Documents
@@ -32,13 +25,14 @@
/// </summary>
/// <author> Chuck Williams
/// </author>
+ [Serializable]
public class MapFieldSelector : FieldSelector
{
internal System.Collections.IDictionary fieldSelections;
/// <summary>Create a a MapFieldSelector</summary>
- /// <param name="fieldSelections">maps from field names to FieldSelectorResults
+ /// <param name="fieldSelections">maps from field names (String) to FieldSelectorResults
/// </param>
public MapFieldSelector(System.Collections.IDictionary fieldSelections)
{
@@ -46,7 +40,7 @@
}
/// <summary>Create a a MapFieldSelector</summary>
- /// <param name="fields">fields to LOAD. All other fields are NO_LOAD.
+ /// <param name="fields">fields to LOAD. List of Strings. All other fields are NO_LOAD.
/// </param>
public MapFieldSelector(System.Collections.IList fields)
{
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/NumberTools.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/NumberTools.cs Tue Jun 24 19:52:46 2008
@@ -32,9 +32,8 @@
/// This class handles <b>all</b> long values (unlike
/// {@link Lucene.Net.Documents.DateField}).
///
+ ///
/// </summary>
- /// <author> Matt Quail (spud at madbean dot com)
- /// </author>
public class NumberTools
{
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Package.html
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/Package.html?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Package.html (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/Package.html Tue Jun 24 19:52:46 2008
@@ -1,10 +1,38 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="Doug Cutting">
-</head>
-<body>
-The Document abstraction.
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body>
+<p>The logical representation of a {@link org.apache.lucene.document.Document} for indexing and searching.</p>
+<p>The document package provides the user level logical representation of content to be indexed and searched. The
+package also provides utilities for working with {@link org.apache.lucene.document.Document}s and {@link org.apache.lucene.document.Fieldable}s.</p>
+<h2>Document and Fieldable</h2>
+<p>A {@link org.apache.lucene.document.Document} is a collection of {@link org.apache.lucene.document.Fieldable}s. A
+ {@link org.apache.lucene.document.Fieldable} is a logical representation of a user's content that needs to be indexed or stored.
+ {@link org.apache.lucene.document.Fieldable}s have a number of properties that tell Lucene how to treat the content (like indexed, tokenized,
+ stored, etc.) See the {@link org.apache.lucene.document.Field} implementation of {@link org.apache.lucene.document.Fieldable}
+ for specifics on these properties.
+</p>
+<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
+{@link org.apache.lucene.document.Fieldable}s.</p>
+<h2>Working with Documents</h2>
+<p>First and foremost, a {@link org.apache.lucene.document.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 {@link org.apache.lucene.document.Document}. To see an example of this,
+ take a look at the Lucene <a href = "http://lucene.apache.org//java/docs/gettingstarted.html" target = "top">demo</a> and the associated source code
+ for extracting content from HTML.
+</p>
+<p>The {@link org.apache.lucene.document.DateTools} and {@link org.apache.lucene.document.NumberTools} classes are utility
+classes to make dates, times and longs searchable (remember, Lucene only searches text).</p>
+<p>The {@link org.apache.lucene.document.FieldSelector} class provides a mechanism to tell Lucene how to load Documents from
+storage. If no FieldSelector is used, all Fieldables on a Document will be loaded. As an example of the FieldSelector usage, consider
+ the common use case of
+displaying search results on a web page and then having users click through to see the full document. In this scenario, it is often
+ the case that there are many small fields and one or two large fields (containing the contents of the original file). Before the FieldSelector,
+the full Document had to be loaded, including the large fields, in order to display the results. Now, using the FieldSelector, one
+can {@link org.apache.lucene.document.FieldSelectorResult#LAZY_LOAD} the large fields, thus only loading the large fields
+when a user clicks on the actual link to view the original content.</p>
+</body>
+</html>
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/SetBasedFieldSelector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/SetBasedFieldSelector.cs?rev=671405&r1=671404&r2=671405&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/SetBasedFieldSelector.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/SetBasedFieldSelector.cs Tue Jun 24 19:52:46 2008
@@ -23,6 +23,7 @@
///
///
/// </summary>
+ [Serializable]
public class SetBasedFieldSelector : FieldSelector
{