Исходный код вики OpenSearch for .NET

Редактировал(а) Alexandr Fokin 2023/12/17 11:29

Последние авторы
1 |(% style="width:173px" %) |(% style="width:1077px" %).NET clients
2 [[https:~~/~~/opensearch.org/docs/latest/clients/dot-net/>>https://opensearch.org/docs/latest/clients/dot-net/]]|(% style="width:250px" %)
3 |(% style="width:173px" %) |(% style="width:1077px" %)[[Open Search>>doc:Разработка.Базы данных.NoSQL.Документоориентированная структура.Open Search.WebHome]]|(% style="width:250px" %)
4 |(% style="width:173px" %) |(% style="width:1077px" %) |(% style="width:250px" %)
5 |(% style="width:173px" %)Простое подключение|(% style="width:1077px" %){{code language="c#"}}var node = new Uri("https://<ip>:<port>");
6 var config = new ConnectionSettings(node)
7 .BasicAuthentication("admin", "admin")
8 .DefaultIndex("students")
9 .ServerCertificateValidationCallback(
10 (p1, p2, p3, p4) =>
11 {
12 return true;
13 }
14 )
15 .ThrowExceptions(true);
16
17 var client = new OpenSearchClient(config);
18
19 var student = new Student(100, "Paulo", "Santos", 3.93, 2021);
20
21 var response = client.Index(student, i => i.Index("students"));{{/code}}|(% style="width:250px" %)Пример минимального подключения.
22 \\Замечание1: при локальном развертывании не подключался через localhost, только через ip машины.
23
24