-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathStringMappingDescriptor.cs
108 lines (101 loc) · 2.67 KB
/
StringMappingDescriptor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using System;
using System.Linq;
using System.Linq.Expressions;
using Nest.Resolvers;
namespace Nest
{
public class StringMappingDescriptor<T>
{
internal StringMapping _Mapping = new StringMapping();
public StringMappingDescriptor<T> Name(string name)
{
this._Mapping.Name = name;
return this;
}
public StringMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
{
this._Mapping.Name = objectPath;
return this;
}
public StringMappingDescriptor<T> IndexName(string indexName)
{
this._Mapping.IndexName = indexName;
return this;
}
public StringMappingDescriptor<T> Index(FieldIndexOption fieldIndexOption)
{
this._Mapping.Index = fieldIndexOption;
return this;
}
public StringMappingDescriptor<T> Store(bool store = true)
{
this._Mapping.Store = store;
return this;
}
public StringMappingDescriptor<T> TermVector(TermVectorOption termVector)
{
this._Mapping.TermVector = termVector;
return this;
}
public StringMappingDescriptor<T> Boost(double boost)
{
this._Mapping.Boost = boost;
return this;
}
public StringMappingDescriptor<T> NullValue(string nullValue)
{
this._Mapping.NullValue = nullValue;
return this;
}
public StringMappingDescriptor<T> OmitNorms(bool omitNorms = true)
{
this._Mapping.OmitNorms = omitNorms;
return this;
}
public StringMappingDescriptor<T> IndexOptions(IndexOptions indexOptions)
{
this._Mapping.IndexOptions = indexOptions;
return this;
}
public StringMappingDescriptor<T> Analyzer(string analyzer)
{
this._Mapping.Analyzer = analyzer;
return this;
}
public StringMappingDescriptor<T> IndexAnalyzer(string indexAnalyzer)
{
this._Mapping.IndexAnalyzer = indexAnalyzer;
return this;
}
public StringMappingDescriptor<T> SearchAnalyzer(string searchAnalyzer)
{
this._Mapping.SearchAnalyzer = searchAnalyzer;
return this;
}
public StringMappingDescriptor<T> DocValues(bool docValues = true)
{
this._Mapping.DocValues = docValues;
return this;
}
public StringMappingDescriptor<T> IncludeInAll(bool includeInAll = true)
{
this._Mapping.IncludeInAll = includeInAll;
return this;
}
public StringMappingDescriptor<T> PositionOffsetGap(int positionOffsetGap)
{
this._Mapping.PositionOffsetGap = positionOffsetGap;
return this;
}
public StringMappingDescriptor<T> CopyTo(params string[] fields)
{
this._Mapping.CopyTo = fields.Select(f => (PropertyPathMarker)f);
return this;
}
public StringMappingDescriptor<T> CopyTo(params Expression<Func<T, object>>[] objectPaths)
{
this._Mapping.CopyTo = objectPaths.Select(e => (PropertyPathMarker)e);
return this;
}
}
}