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
ValueSource.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 IndexReader = Lucene.Net.Index.IndexReader;
21 
22 namespace Lucene.Net.Search.Function
23 {
24 
25  /// <summary> Expert: source of values for basic function queries.
26  /// <p/>At its default/simplest form, values - one per doc - are used as the score of that doc.
27  /// <p/>Values are instantiated as
28  /// <see cref="Lucene.Net.Search.Function.DocValues">DocValues</see> for a particular reader.
29  /// <p/>ValueSource implementations differ in RAM requirements: it would always be a factor
30  /// of the number of documents, but for each document the number of bytes can be 1, 2, 4, or 8.
31  ///
32  /// <p/><font color="#FF0000">
33  /// WARNING: The status of the <b>Search.Function</b> package is experimental.
34  /// The APIs introduced here might change in the future and will not be
35  /// supported anymore in such a case.</font>
36  ///
37  ///
38  /// </summary>
39  [Serializable]
40  public abstract class ValueSource
41  {
42 
43  /// <summary> Return the DocValues used by the function query.</summary>
44  /// <param name="reader">the IndexReader used to read these values.
45  /// If any caching is involved, that caching would also be IndexReader based.
46  /// </param>
47  /// <throws> IOException for any error. </throws>
48  public abstract DocValues GetValues(IndexReader reader);
49 
50  /// <summary> description of field, used in explain() </summary>
51  public abstract System.String Description();
52 
53  /* (non-Javadoc) <see cref="java.lang.Object.toString() */
54  public override System.String ToString()
55  {
56  return Description();
57  }
58 
59  /// <summary> Needed for possible caching of query results - used by <see cref="ValueSourceQuery.Equals(Object)" />.</summary>
60  /// <seealso cref="Object.Equals(Object)">
61  /// </seealso>
62  abstract public override bool Equals(System.Object o);
63 
64  /// <summary> Needed for possible caching of query results - used by <see cref="ValueSourceQuery.GetHashCode()" />.</summary>
65  /// <seealso cref="Object.GetHashCode()">
66  /// </seealso>
67  abstract public override int GetHashCode();
68  }
69 }