public IndexFieldInfo(string name, string value, FieldInfoType type, Field.Store store, Field.Index index, Field.TermVector termVector) { Name = name; Value = value; Type = type; Store = store; Index = index; TermVector = termVector; }
public static bool WithOffsets(this Field.TermVector tv) { switch (tv) { case Field.TermVector.NO: case Field.TermVector.YES: case Field.TermVector.WITH_POSITIONS: return(false); case Field.TermVector.WITH_OFFSETS: case Field.TermVector.WITH_POSITIONS_OFFSETS: return(true); default: throw new ArgumentOutOfRangeException("tv", "Invalid value for Field.TermVector"); } }
protected internal virtual void SetStoreTermVector(Field.TermVector termVector) { if (termVector == Field.TermVector.NO) { this.storeTermVector = false; this.storePositionWithTermVector = false; this.storeOffsetWithTermVector = false; } else if (termVector == Field.TermVector.YES) { this.storeTermVector = true; this.storePositionWithTermVector = false; this.storeOffsetWithTermVector = false; } else if (termVector == Field.TermVector.WITH_POSITIONS) { this.storeTermVector = true; this.storePositionWithTermVector = true; this.storeOffsetWithTermVector = false; } else if (termVector == Field.TermVector.WITH_OFFSETS) { this.storeTermVector = true; this.storePositionWithTermVector = false; this.storeOffsetWithTermVector = true; } else if (termVector == Field.TermVector.WITH_POSITIONS_OFFSETS) { this.storeTermVector = true; this.storePositionWithTermVector = true; this.storeOffsetWithTermVector = true; } else { throw new System.ArgumentException("unknown termVector parameter " + termVector); } }
protected internal AbstractField(System.String name, Field.Store store, Field.Index index, Field.TermVector termVector) { if (name == null) { throw new System.NullReferenceException("name cannot be null"); } this.name = String.Intern(name); // field names are interned if (store == Field.Store.YES) { this.isStored = true; this.isCompressed = false; } else if (store == Field.Store.COMPRESS) { this.isStored = true; this.isCompressed = true; } else if (store == Field.Store.NO) { this.isStored = false; this.isCompressed = false; } else { throw new System.ArgumentException("unknown store parameter " + store); } if (index == Field.Index.NO) { this.isIndexed = false; this.isTokenized = false; } else if (index == Field.Index.ANALYZED) { this.isIndexed = true; this.isTokenized = true; } else if (index == Field.Index.NOT_ANALYZED) { this.isIndexed = true; this.isTokenized = false; } else if (index == Field.Index.NOT_ANALYZED_NO_NORMS) { this.isIndexed = true; this.isTokenized = false; this.omitNorms = true; } else if (index == Field.Index.ANALYZED_NO_NORMS) { this.isIndexed = true; this.isTokenized = false; this.omitNorms = true; } else { throw new System.ArgumentException("unknown index parameter " + index); } this.isBinary = false; SetStoreTermVector(termVector); }
public FieldCacheKey(string name, Field.Index? index, Field.Store store, Field.TermVector termVector, int[] multipleItemsSameField) { this.name = name; this.index = index; this.store = store; this.termVector = termVector; this.multipleItemsSameField = multipleItemsSameField; }
protected internal virtual void SetStoreTermVector(Field.TermVector termVector) { this.storeTermVector = termVector.IsStored(); this.storePositionWithTermVector = termVector.WithPositions(); this.storeOffsetWithTermVector = termVector.WithOffsets(); }
protected internal AbstractField(System.String name, Field.Store store, Field.Index index, Field.TermVector termVector) { if (name == null) { throw new System.NullReferenceException("name cannot be null"); } this.internalName = StringHelper.Intern(name); // field names are interned this.internalIsStored = store.IsStored(); this.internalIsIndexed = index.IsIndexed(); this.internalIsTokenized = index.IsAnalyzed(); this.internalOmitNorms = index.OmitNorms(); this.internalIsBinary = false; SetStoreTermVector(termVector); }