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(); } }
/// <summary> /// Register a field to be indexed /// </summary> protected void Index(string field, FieldIndexing indexing) { IndexesStrings.Add(field, indexing); }
/// <summary> /// Register a field to be indexed /// </summary> protected void Index(Expression <Func <TReduceResult, object> > field, FieldIndexing indexing) { Indexes.Add(field, indexing); }
/// <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; }
/// <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; }
private bool IsDefaultValue(FieldIndexing val) { return(val == FieldIndexing.Default); }