BusinessUnitConstants.cs
3.21 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
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
namespace Sungero.Company.Constants
{
public static class BusinessUnit
{
/// <summary>
/// Настройки полей индекса с данными о НОР.
/// </summary>
public const string ElasticsearchIndexConfig = @"{{
""settings"":{{
""index"":{{
""similarity"":{{
""default"":{{
""type"":""BM25"",
""b"":0,
""k1"":0
}}
}},
""analysis"":{{
""filter"": {{
""my_synonyms"": {{
""type"": ""synonym_graph"",
""synonyms"": [{0}],
""expand"": true,
""updateable"": true
}}
}},
""char_filter"":{{
""e_char_filter"":{{
""type"":""mapping"",
""mappings"":[
""Ё => Е"",
""ё => е""
]
}}
}},
""analyzer"":{{
""text_index_analyzer"":{{
""tokenizer"":""standard"",
""filter"":[
""lowercase""
],
""char_filter"":[
""e_char_filter""
]
}},
""text_query_analyzer"":{{
""tokenizer"":""standard"",
""filter"":[
""lowercase"",
""my_synonyms""
],
""char_filter"":[
""e_char_filter""
]
}}
}}
}}
}}
}},
""mappings"":{{
""properties"":{{
""Id"":{{
""type"":""keyword""
}},
""Name"":{{
""type"":""text"",
""analyzer"":""text_index_analyzer"",
""search_analyzer"":""text_query_analyzer""
}},
""ShortName"":{{
""type"":""text"",
""analyzer"":""text_index_analyzer"",
""search_analyzer"":""text_query_analyzer""
}},
""TIN"":{{
""type"":""keyword""
}},
""TRRC"":{{
""type"":""keyword""
}},
""PSRN"":{{
""type"":""keyword""
}},
""Updated"":{{
""type"":""date"",
""format"":""dd.MM.yyyy HH:mm:ss""
}},
""Status"":{{
""type"":""keyword""
}}
}}
}}
}}";
/// <summary>
/// Шаблон для создания индекса с данными о НОР.
/// </summary>
public const string ElasticsearchIndexTemplate = "{{ \"Id\": \"{0}\", \"Name\": \"{1}\", \"ShortName\": \"{2}\", \"TIN\": \"{3}\", " +
"\"TRRC\": \"{4}\", \"PSRN\": \"{5}\", \"Updated\": \"{6}\", \"Status\": \"{7}\" }}";
/// <summary>
/// Минимальная оценка при нечетком поиске НОР.
/// </summary>
[Sungero.Core.Public]
public const double ElasticsearchMinScore = 5;
}
}