From 32598f0a09ef7f1c1c839469a0cedb926100a217 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Tue, 28 Mar 2023 07:55:58 -0300 Subject: [PATCH 1/3] Update .code-samples.meilisearch.yaml --- .code-samples.meilisearch.yaml | 59 +++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 51426e8c..f2d846cd 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -3,6 +3,63 @@ # the documentation on build # You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples --- +multi_search_1: |- + see cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L996-L1017 + with data: { "queries": [ + { + "indexUid": "movies", + "q": "pooh", + "limit": 5 + }, + { + "indexUid": "movies", + "q": "nemo", + "limit": 5 + }, + { + "indexUid": "movie_ratings", + "q": "us" + } + ] + } +faceted_search_update_settings_1: |- + See cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1018-L1024 + on the books index: Add "genres", "rating", "language" as filterable attributes +faceted_search_1: |- + See cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1025-L1034 + Search books index with data: { + "q": "classic", + "facets": [ + "genres", "rating", "language" + ] + } +faceted_search_2: |- + see cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1043-L1065 + multi-search with data: { + "queries": [ + { + "indexUid": "books", + "facets": ["language", "genres", "author", "format"], + "filter": [["language = English", "language = French"], ["genres = Fiction"]] + }, + { + "indexUid": "books", + "facets": ["language"], + "filter": [["genres = Fiction"]] + }, + { + "indexUid": "books", + "facets": ["genres"], + "filter": [["language = English", "language = French"]] + } + ] + } +geosearch_guide_filter_usage_3: |- + see cURL: https://github.com/meilisearch/documentation/blob/c8ab47d004753ce2241a756eff14ade448d70a93/.code-samples.meilisearch.yaml#L696-L700 + Search on `restaurants` with data: + { "filter": "_geoBoundingBox([45.494181, 9.179175], [45.449484, 9.214024])" } + + getting_started_faceting: |- var faceting = new Faceting { MaxValuesPerFacet = 2 @@ -486,7 +543,7 @@ getting_started_communicating_with_a_protected_instance: |- MeilisearchClient client = new MeilisearchClient("http://localhost:7700", "apiKey"); await client.Index("Movies").SearchAsync(""); -faceted_search_update_settings_1: |- +filtering_update_settings_1: |- await client.Index("movies").UpdateFilterableAttributesAsync(new [] { "director", "genres" }); faceted_search_filter_1: |- SearchQuery filters = new SearchQuery() From 9ce6908760f4432723cbe92e3929a26438974f48 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Mon, 3 Jul 2023 15:12:05 +0300 Subject: [PATCH 2/3] update samples --- .code-samples.meilisearch.yaml | 82 +++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index ee4cb75c..01d71fce 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -4,26 +4,34 @@ # You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples --- faceted_search_2: |- - see cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1043-L1065 - multi-search with data: { - "queries": [ - { - "indexUid": "books", - "facets": ["language", "genres", "author", "format"], - "filter": [["language = English", "language = French"], ["genres = Fiction"]] - }, - { - "indexUid": "books", - "facets": ["language"], - "filter": [["genres = Fiction"]] - }, - { - "indexUid": "books", - "facets": ["genres"], - "filter": [["language = English", "language = French"]] - } - ] - } + await client.MultiSearchAsync(new MultiSearchQuery() + { + Queries = new System.Collections.Generic.List() + { + new SearchQuery() { + IndexUid = "books", + Filter = new[] { + new[] {"language = English", "language = French"}, + new[] {"genres = Fiction"} + }, + Facets = new[] { "language", "genres", "author", "format" } + }, + new SearchQuery() { + IndexUid = "books", + Filter = new[] { + new[] {"genres = Fiction"} + }, + Facets = new[] { "language" } + }, + new SearchQuery() { + IndexUid = "books", + Filter = new[] { + new[] {"language = English", "language = French"} + }, + Facets = new[] { "genres" } + } + } + }); getting_started_faceting: |- var faceting = new Faceting { MaxValuesPerFacet = 2 @@ -728,21 +736,23 @@ update_faceting_settings_1: |- reset_faceting_settings_1: |- await client.Index("movies").ResetFacetingAsync(); multi_search_1: |- - see cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L996-L1017 - with data: { "queries": [ - { - "indexUid": "movies", - "q": "pooh", - "limit": 5 - }, - { - "indexUid": "movies", - "q": "nemo", - "limit": 5 - }, + await client.MultiSearchAsync(new MultiSearchQuery() + { + Queries = new System.Collections.Generic.List() { - "indexUid": "movie_ratings", - "q": "us" + new SearchQuery() { + IndexUid = "movies", + Q = "booh", + Limit = 5 + }, + new SearchQuery() { + IndexUid = "movies", + Q = "nemo", + Limit = 5 + }, + new SearchQuery() { + IndexUid = "movie_ratings", + Q = "us", + }, } - ] - } + }); \ No newline at end of file From 62b8e32479a9ec9a20117303ae4facf754aab774 Mon Sep 17 00:00:00 2001 From: alallema Date: Mon, 3 Jul 2023 16:17:50 +0200 Subject: [PATCH 3/3] Typo yaml --- .code-samples.meilisearch.yaml | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 01d71fce..4a280612 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -8,27 +8,27 @@ faceted_search_2: |- { Queries = new System.Collections.Generic.List() { - new SearchQuery() { - IndexUid = "books", + new SearchQuery() { + IndexUid = "books", Filter = new[] { new[] {"language = English", "language = French"}, new[] {"genres = Fiction"} - }, - Facets = new[] { "language", "genres", "author", "format" } + }, + Facets = new[] { "language", "genres", "author", "format" } }, - new SearchQuery() { - IndexUid = "books", + new SearchQuery() { + IndexUid = "books", Filter = new[] { new[] {"genres = Fiction"} - }, - Facets = new[] { "language" } + }, + Facets = new[] { "language" } }, - new SearchQuery() { - IndexUid = "books", + new SearchQuery() { + IndexUid = "books", Filter = new[] { new[] {"language = English", "language = French"} - }, - Facets = new[] { "genres" } + }, + Facets = new[] { "genres" } } } }); @@ -740,19 +740,19 @@ multi_search_1: |- { Queries = new System.Collections.Generic.List() { - new SearchQuery() { - IndexUid = "movies", - Q = "booh", + new SearchQuery() { + IndexUid = "movies", + Q = "booh", Limit = 5 }, - new SearchQuery() { - IndexUid = "movies", - Q = "nemo", + new SearchQuery() { + IndexUid = "movies", + Q = "nemo", Limit = 5 }, - new SearchQuery() { - IndexUid = "movie_ratings", + new SearchQuery() { + IndexUid = "movie_ratings", Q = "us", - }, + }, } - }); \ No newline at end of file + });