예제 #1
0
        public static LucField.TermVector ToLuceneIndexTermVector(IndexTermVector mode)
        {
            if (mode == IndexTermVector.Default)
            {
                mode = IndexingInfo.DefaultTermVectorStoringMode;
            }

            switch (mode)
            {
            case IndexTermVector.No: return(LucField.TermVector.NO);

            case IndexTermVector.WithOffsets: return(LucField.TermVector.WITH_OFFSETS);

            case IndexTermVector.WithPositions: return(LucField.TermVector.WITH_POSITIONS);

            case IndexTermVector.WithPositionsOffsets: return(LucField.TermVector.WITH_POSITIONS_OFFSETS);

            case IndexTermVector.Yes: return(LucField.TermVector.YES);

            default: throw new ArgumentOutOfRangeException("Not supported IndexTermVector: " + mode);
            }
        }
예제 #2
0
 /// <summary>
 /// Initializes an instance of the IndexField with a named System.DateTime value and indexing metadata.
 /// </summary>
 /// <param name="name">The name of the term.</param>
 /// <param name="value">System.DateTime value</param>
 /// <param name="mode">Indexing mode.</param>
 /// <param name="store">Index storing mode.</param>
 /// <param name="termVector">Term vector handling.</param>
 public IndexField(string name, DateTime value, IndexingMode mode, IndexStoringMode store, IndexTermVector termVector) : base(name, value)
 {
     Mode = mode; Store = store; TermVector = termVector;
 }