CompanyBaseConstants.cs
3.54 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
namespace Sungero.Parties.Constants
{
public static class CompanyBase
{
public const string FindedContactsInServiceParamName = "FindedContactsInService";
public const string ActiveCounterpartyStateInService = "Действующее";
/// <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"": {{
""name_index_analyzer"": {{
""tokenizer"": ""standard"",
""filter"": [ ""lowercase"" ],
""char_filter"": [""e_char_filter""]
}},
""name_query_analyzer"": {{
""tokenizer"": ""standard"",
""filter"": [
""lowercase"",
""my_synonyms""
],
""char_filter"": [""e_char_filter""]
}},
""email_analyzer"":{{
""tokenizer"" : ""uax_url_email"",
""filter"" : [""lowercase""]
}}
}}
}}
}}
}},
""mappings"": {{
""properties"": {{
""Id"": {{""type"": ""keyword""}},
""Name"": {{
""type"": ""text"",
""analyzer"": ""name_index_analyzer"",
""search_analyzer"": ""name_query_analyzer""
}},
""ShortName"": {{
""type"": ""text"",
""analyzer"": ""name_index_analyzer"",
""search_analyzer"": ""name_query_analyzer""
}},
""HeadCompany"": {{""type"": ""text""}},
""TIN"": {{""type"": ""keyword""}},
""TRRC"": {{""type"": ""keyword""}},
""PSRN"": {{""type"": ""keyword""}},
""Address"": {{""type"": ""text""}},
""Homepage"": {{""type"": ""text""}},
""Email"": {{""type"": ""text"", ""analyzer"": ""email_analyzer""}},
""Phones"": {{""type"": ""text""}},
""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}\", " +
"\"HeadCompany\": \"{3}\", \"TIN\": \"{4}\", \"TRRC\": \"{5}\", \"PSRN\": \"{6}\", \"Homepage\": \"{7}\", " +
"\"Email\": \"{8}\", \"Phones\": \"{9}\", \"Address\": \"{10}\", \"Updated\": \"{11}\", \"Status\": \"{12}\" }}";
/// <summary>
/// Минимальная оценка при нечетком поиске контрагентов.
/// </summary>
[Sungero.Core.Public]
public const double ElasticsearchMinScore = 5;
}
}