ContactConstants.cs
1.92 KB
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
using System;
namespace Sungero.Parties.Constants
{
public static class Contact
{
/// <summary>
/// Настройки полей индекса с данными о контактах.
/// </summary>
public const string ElasticsearchIndexConfig = @"{
""settings"": {
""index"": {
""analysis"": {
""char_filter"": {
""e_char_filter"": {
""type"": ""mapping"",
""mappings"": [ ""Ё => Е"", ""ё => е"" ]
}
},
""analyzer"": {
""name_analyzer"": {
""type"": ""custom"",
""tokenizer"": ""standard"",
""filter"": [
""lowercase"",
""russian_morphology""
],
""char_filter"": [""e_char_filter""]
}
}
}
}
},
""mappings"": {
""properties"": {
""Id"": {""type"": ""keyword""},
""FullName"": {""type"": ""text"", ""analyzer"": ""name_analyzer""},
""CompanyId"": {""type"": ""keyword""},
""Updated"": {""type"": ""date"", ""format"": ""dd.MM.yyyy HH:mm:ss""},
""Status"": {""type"": ""keyword""}
}
}
}";
/// <summary>
/// Шаблон для создания индекса с данными о контактах.
/// </summary>
public const string ElasticsearchIndexTemplate = "{{ \"Id\": \"{0}\", \"CompanyId\": \"{1}\", \"FullName\": \"{2}\", \"Updated\": \"{3}\", \"Status\": \"{4}\" }}";
/// <summary>
/// Минимальная оценка при нечетком поиске контактов.
/// </summary>
public const double ElasticsearchMinScore = 2;
}
}