Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
FieldSelectorResult.cs
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 using System;
19 
20 using System.Runtime.InteropServices;
21 
22 namespace Lucene.Net.Documents
23 {
24  /// <summary>Provides information about what should be done with this Field</summary>
25  public enum FieldSelectorResult
26  {
27  /// <summary>
28  ///
29  /// </summary>
30  INVALID, // TODO: This is kinda a kludgy workaround for the fact enums can't be null
31 
32  /// <summary> Load this <see cref="Field" /> every time the <see cref="Document" /> is loaded, reading in the data as it is encountered.
33  /// <see cref="Document.GetField(String)" /> and <see cref="Document.GetFieldable(String)" /> should not return null.
34  /// <p/>
35  /// <see cref="Document.Add(IFieldable)" /> should be called by the Reader.
36  /// </summary>
37  LOAD,
38 
39  /// <summary> Lazily load this <see cref="Field" />. This means the <see cref="Field" /> is valid, but it may not actually contain its data until
40  /// invoked. <see cref="Document.GetField(String)" /> SHOULD NOT BE USED. <see cref="Document.GetFieldable(String)" /> is safe to use and should
41  /// return a valid instance of a <see cref="IFieldable" />.
42  /// <p/>
43  /// <see cref="Document.Add(IFieldable)" /> should be called by the Reader.
44  /// </summary>
45  LAZY_LOAD,
46 
47  /// <summary> Do not load the <see cref="Field" />. <see cref="Document.GetField(String)" /> and <see cref="Document.GetFieldable(String)" /> should return null.
48  /// <see cref="Document.Add(IFieldable)" /> is not called.
49  /// <p/>
50  /// <see cref="Document.Add(IFieldable)" /> should not be called by the Reader.
51  /// </summary>
52  NO_LOAD,
53 
54  /// <summary> Load this field as in the <see cref="LOAD" /> case, but immediately return from <see cref="Field" /> loading for the <see cref="Document" />. Thus, the
55  /// Document may not have its complete set of Fields. <see cref="Document.GetField(String)" /> and <see cref="Document.GetFieldable(String)" /> should
56  /// both be valid for this <see cref="Field" />
57  /// <p/>
58  /// <see cref="Document.Add(IFieldable)" /> should be called by the Reader.
59  /// </summary>
60  LOAD_AND_BREAK,
61 
62  /// <summary>Expert: Load the size of this <see cref="Field" /> rather than its value.
63  /// 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.
64  /// The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0]
65  /// </summary>
66  SIZE,
67 
68  /// <summary>Expert: Like <see cref="SIZE" /> but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded </summary>
69  SIZE_AND_BREAK
70  }
71 }