23 using SpanQuery = Lucene.Net.Search.Spans.SpanQuery;
35 protected internal System.String internalName =
"body";
36 protected internal bool storeTermVector =
false;
37 protected internal bool storeOffsetWithTermVector =
false;
38 protected internal bool storePositionWithTermVector =
false;
39 protected internal bool internalOmitNorms =
false;
40 protected internal bool internalIsStored =
false;
41 protected internal bool internalIsIndexed =
true;
42 protected internal bool internalIsTokenized =
true;
43 protected internal bool internalIsBinary =
false;
44 protected internal bool lazy =
false;
45 protected internal bool internalOmitTermFreqAndPositions =
false;
46 protected internal float internalBoost = 1.0f;
48 protected internal System.Object fieldsData = null;
52 protected internal int internalBinaryLength;
53 protected internal int internalbinaryOffset;
62 throw new System.NullReferenceException(
"name cannot be null");
65 this.internalIsStored = store.IsStored();
66 this.internalIsIndexed = index.IsIndexed();
67 this.internalIsTokenized = index.IsAnalyzed();
68 this.internalOmitNorms = index.OmitNorms();
70 this.internalIsBinary =
false;
72 SetStoreTermVector(termVector);
84 public virtual float Boost
86 get {
return internalBoost; }
87 set { this.internalBoost = value; }
93 public virtual string Name
95 get {
return internalName; }
98 protected internal virtual void SetStoreTermVector(
Field.
TermVector termVector)
100 this.storeTermVector = termVector.IsStored();
101 this.storePositionWithTermVector = termVector.WithPositions();
102 this.storeOffsetWithTermVector = termVector.WithOffsets();
111 get {
return internalIsStored; }
117 public bool IsIndexed
119 get {
return internalIsIndexed; }
126 public bool IsTokenized
128 get {
return internalIsTokenized; }
140 public bool IsTermVectorStored
142 get {
return storeTermVector; }
148 public virtual bool IsStoreOffsetWithTermVector
150 get {
return storeOffsetWithTermVector; }
154 public virtual bool IsStorePositionWithTermVector
156 get {
return storePositionWithTermVector; }
162 get {
return internalIsBinary; }
172 public virtual byte[] GetBinaryValue()
174 return GetBinaryValue(null);
177 public virtual byte[] GetBinaryValue(byte[] result)
179 if (internalIsBinary || fieldsData is byte[])
180 return (byte[]) fieldsData;
189 public virtual int BinaryLength
193 if (internalIsBinary)
195 return internalBinaryLength;
197 return fieldsData is byte[] ? ((byte[]) fieldsData).Length : 0;
205 public virtual int BinaryOffset
207 get {
return internalbinaryOffset; }
211 public virtual bool OmitNorms
213 get {
return internalOmitNorms; }
214 set { this.internalOmitNorms = value; }
228 public virtual bool OmitTermFreqAndPositions
230 set { this.internalOmitTermFreqAndPositions = value; }
231 get {
return internalOmitTermFreqAndPositions; }
234 public virtual bool IsLazy
240 public override System.String ToString()
242 System.Text.StringBuilder result =
new System.Text.StringBuilder();
243 if (internalIsStored)
245 result.Append(
"stored");
247 if (internalIsIndexed)
249 if (result.Length > 0)
251 result.Append(
"indexed");
253 if (internalIsTokenized)
255 if (result.Length > 0)
257 result.Append(
"tokenized");
261 if (result.Length > 0)
263 result.Append(
"termVector");
265 if (storeOffsetWithTermVector)
267 if (result.Length > 0)
269 result.Append(
"termVectorOffsets");
271 if (storePositionWithTermVector)
273 if (result.Length > 0)
275 result.Append(
"termVectorPosition");
277 if (internalIsBinary)
279 if (result.Length > 0)
281 result.Append(
"binary");
283 if (internalOmitNorms)
285 result.Append(
",omitNorms");
287 if (internalOmitTermFreqAndPositions)
289 result.Append(
",omitTermFreqAndPositions");
293 result.Append(
",lazy");
296 result.Append(internalName);
299 if (fieldsData != null && lazy ==
false)
301 result.Append(fieldsData);
305 return result.ToString();
309 public abstract TextReader ReaderValue {
get; }
310 public abstract string StringValue {
get; }