Skip to content

Commit 4fd19db

Browse files
committed
add 01-keyword-querying-filtering
1 parent 0d17e7d commit 4fd19db

File tree

4 files changed

+1479
-36
lines changed

4 files changed

+1479
-36
lines changed

src/_infra/azure-infra.ipynb

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,7 @@
2020
"kernelName": "pwsh"
2121
}
2222
},
23-
"outputs": [
24-
{
25-
"name": "stdout",
26-
"output_type": "stream",
27-
"text": [
28-
"{\n",
29-
" \"environmentName\": \"AzureCloud\",\n",
30-
" \"homeTenantId\": \"b41b72d0-4e9f-4c26-8a69-f949f367c91d\",\n",
31-
" \"id\": \"0b252e02-9c7a-4d73-8fbc-633c5d111ebc\",\n",
32-
" \"isDefault\": true,\n",
33-
" \"managedByTenants\": [],\n",
34-
" \"name\": \"Visual Studio Professional Subscription\",\n",
35-
" \"state\": \"Enabled\",\n",
36-
" \"tenantId\": \"b41b72d0-4e9f-4c26-8a69-f949f367c91d\",\n",
37-
" \"user\": {\n",
38-
" \"name\": \"Oleksii_Nikiforov@epam.com\",\n",
39-
" \"type\": \"user\"\n",
40-
" }\n",
41-
"}\n"
42-
]
43-
}
44-
],
23+
"outputs": [],
4524
"source": [
4625
"az account show\n",
4726
"\n",

src/elasticsearch-getting-started/00-quick-start.ipynb

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"cell_type": "markdown",
2323
"metadata": {},
2424
"source": [
25-
"### Install packages and import modules\n"
25+
"### Install packages and import modules"
2626
]
2727
},
2828
{
@@ -38,7 +38,7 @@
3838
},
3939
"outputs": [],
4040
"source": [
41-
"#r \"nuget: Elastic.Clients.Elasticsearch\"\n",
41+
"#r \"nuget: Elastic.Clients.Elasticsearch, 8.15.10\"\n",
4242
"#r \"nuget: System.Net.Http.Json, 8.0.1\"\n",
4343
"\n",
4444
"#!import ./Utils.cs\n",
@@ -51,7 +51,7 @@
5151
"source": [
5252
"## Initialize the Elasticsearch client\n",
5353
"\n",
54-
"Now, we need to initialize the Elasticsearch client. We will use the [Elasticsearch client for .NET](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html) to connect to Elasticsearch.\n"
54+
"Now, we need to initialize the Elasticsearch client. We will use the [Elasticsearch client for .NET](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html) to connect to Elasticsearch."
5555
]
5656
},
5757
{
@@ -254,22 +254,22 @@
254254
"using Elastic.Clients.Elasticsearch.IndexManagement;\n",
255255
"using Elastic.Clients.Elasticsearch.Mapping;\n",
256256
"\n",
257-
"\n",
258-
"var indexDescriptor = new CreateIndexRequestDescriptor<Book>(\"book_index\")\n",
259-
" .Mappings(m => m\n",
257+
"var indexResponse = await client.Indices.CreateAsync<Book>(\"book_index\", d =>\n",
258+
" d.Mappings(m => m\n",
260259
" .Properties(pp => pp\n",
261260
" .Text(p => p.Title)\n",
262-
" .DenseVector(\n",
263-
" Infer.Property<Book>(p => p.TitleVector),\n",
264-
" d => d.Dims(textEmeddingDimension).Index(true).Similarity(DenseVectorSimilarity.Cosine))\n",
261+
" .DenseVector(Infer.Property<Book>(p => p.TitleVector),\n",
262+
" d => d\n",
263+
" .Dims(textEmeddingDimension)\n",
264+
" .Index(true)\n",
265+
" .Similarity(DenseVectorSimilarity.Cosine))\n",
265266
" .Text(p => p.Summary)\n",
266267
" .Date(p => p.publish_date)\n",
267268
" .IntegerNumber(p => p.num_reviews)\n",
268269
" .Keyword(p => p.Publisher)\n",
270+
" .Keyword(p => p.Authors)\n",
269271
" )\n",
270-
" );\n",
271-
"\n",
272-
"var indexResponse = await client.Indices.CreateAsync<Book>(indexDescriptor);\n",
272+
" ));\n",
273273
"\n",
274274
"DumpRequest(indexResponse);"
275275
]
@@ -384,7 +384,7 @@
384384
" .IndexMany<Book>(books, (bd, b) => bd.Index(\"book_index\"))\n",
385385
");\n",
386386
"\n",
387-
"// bulkResponse.Display();"
387+
"bulkResponse.Display();"
388388
]
389389
},
390390
{
@@ -485,7 +485,14 @@
485485
{
486486
"cell_type": "code",
487487
"execution_count": null,
488-
"metadata": {},
488+
"metadata": {
489+
"dotnet_interactive": {
490+
"language": "csharp"
491+
},
492+
"polyglot_notebook": {
493+
"kernelName": "csharp"
494+
}
495+
},
489496
"outputs": [],
490497
"source": [
491498
"var searchQuery = \"javascript books\";\n",

0 commit comments

Comments
 (0)