Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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");
            }
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
        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;
			}
Exemplo n.º 6
0
 protected internal virtual void  SetStoreTermVector(Field.TermVector termVector)
 {
     this.storeTermVector             = termVector.IsStored();
     this.storePositionWithTermVector = termVector.WithPositions();
     this.storeOffsetWithTermVector   = termVector.WithOffsets();
 }
Exemplo n.º 7
0
        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);
        }