public static Field.Index GetLuceneValue(this FieldIndexing value, string analyzer, Field.Index @default)
        {
            switch (value)
            {
            case FieldIndexing.No:
                return(Field.Index.NO);

            case FieldIndexing.Search:
                return(string.IsNullOrWhiteSpace(analyzer) == false ? Field.Index.ANALYZED : Field.Index.ANALYZED_NO_NORMS);

            case FieldIndexing.Exact:
                return(Field.Index.NOT_ANALYZED_NO_NORMS);

            case FieldIndexing.Default:
                return(@default);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #2
0
 /// <summary>
 /// Register a field to be indexed
 /// </summary>
 protected void Index(string field, FieldIndexing indexing)
 {
     IndexesStrings.Add(field, indexing);
 }
Example #3
0
 /// <summary>
 /// Register a field to be indexed
 /// </summary>
 protected void Index(Expression <Func <TReduceResult, object> > field, FieldIndexing indexing)
 {
     Indexes.Add(field, indexing);
 }
Example #4
0
		/// <summary>
		///  ctor
		/// </summary>
		/// <param name="Name"></param>
		/// <param name="defval"></param>
		/// <param name="Indexing"></param>
		/// <param name="len"></param>
		public Field(string Name,string defval,FieldIndexing Indexing, int len)
		{
			this.Name=Name; this.DefaultValue=Variant.Object2Variant(defval); this.Indexing=Indexing; this.type=FieldType.ftString; this.len=len;
		}
Example #5
0
		/// <summary>
		///  ctor
		/// </summary>
		/// <param name="Name"></param>
		/// <param name="defval"></param>
		/// <param name="Indexing"></param>
		public Field(string Name,long defval,FieldIndexing Indexing)
		{
			this.Name=Name; this.DefaultValue=Variant.Object2Variant(defval); this.Indexing=Indexing; this.type=FieldType.ftInt64;
		}
Example #6
0
 private bool IsDefaultValue(FieldIndexing val)
 {
     return(val == FieldIndexing.Default);
 }