-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathBooleanMappingDescriptor.cs
68 lines (61 loc) · 1.58 KB
/
BooleanMappingDescriptor.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
using System;
using System.Linq;
using System.Linq.Expressions;
using Nest.Resolvers;
namespace Nest
{
public class BooleanMappingDescriptor<T>
{
internal BooleanMapping _Mapping = new BooleanMapping();
public BooleanMappingDescriptor<T> Name(string name)
{
this._Mapping.Name = name;
return this;
}
public BooleanMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
{
this._Mapping.Name = objectPath;
return this;
}
public BooleanMappingDescriptor<T> IndexName(string indexName)
{
this._Mapping.IndexName = indexName;
return this;
}
public BooleanMappingDescriptor<T> Index(NonStringIndexOption index = NonStringIndexOption.analyzed)
{
this._Mapping.Index = index;
return this;
}
public BooleanMappingDescriptor<T> Store(bool store = true)
{
this._Mapping.Store = store;
return this;
}
public BooleanMappingDescriptor<T> Boost(double boost)
{
this._Mapping.Boost = boost;
return this;
}
public BooleanMappingDescriptor<T> NullValue(bool nullValue)
{
this._Mapping.NullValue = nullValue;
return this;
}
public BooleanMappingDescriptor<T> IncludeInAll(bool includeInAll = true)
{
this._Mapping.IncludeInAll = includeInAll;
return this;
}
public BooleanMappingDescriptor<T> CopyTo(params string[] fields)
{
this._Mapping.CopyTo = fields.Select(f => (PropertyPathMarker)f);
return this;
}
public BooleanMappingDescriptor<T> CopyTo(params Expression<Func<T, object>>[] objectPaths)
{
this._Mapping.CopyTo = objectPaths.Select(e => (PropertyPathMarker)e);
return this;
}
}
}