EmployeeConstants.cs
2.51 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
56
57
58
59
60
61
namespace Sungero.Company.Constants
{
public static class Employee
{
/// <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""},
""FirstName"": {""type"": ""text"", ""analyzer"": ""name_analyzer""},
""LastName"": {""type"": ""text"", ""analyzer"": ""name_analyzer""},
""Patronymic"": {""type"": ""text"", ""analyzer"": ""name_analyzer""},
""InitialFirstName"": {""type"": ""keyword""},
""InitialPatronymic"": {""type"": ""keyword""},
""BusinessUnitId"": {""type"": ""keyword""},
""Updated"": {""type"": ""date"", ""format"": ""dd.MM.yyyy HH:mm:ss""},
""Status"": {""type"": ""keyword""}
}
}
}";
/// <summary>
/// Шаблон для создания индекса с данными о сотрудниках.
/// </summary>
public const string ElasticsearchIndexTemplate = "{{ \"Id\": \"{0}\", \"FullName\": \"{1}\", \"LastName\": \"{2}\", " +
"\"FirstName\": \"{3}\", \"Patronymic\": \"{4}\", \"InitialFirstName\": \"{5}\", \"InitialPatronymic\": \"{6}\", " +
"\"BusinessUnitId\": \"{7}\", \"Updated\": \"{8}\", \"Status\": \"{9}\" }}";
/// <summary>
/// Минимальная оценка при нечетком поиске сотрудников.
/// </summary>
public const double ElasticsearchMinScore = 2;
}
}