Skip to content

Commit

Permalink
Merge #407
Browse files Browse the repository at this point in the history
407: Update code-samples for Meilisearch v1.1.0 r=alallema a=meili-bot

⚠️ Should not be merged until the multi-search method is added.

_This PR is auto-generated._

Update the code-samples.meilisearch.yml according to the [integration-guides issue](meilisearch/integration-guides#254) for more information and the complete description about what should be done here check that issue.


Co-authored-by: meili-bot <[email protected]>
Co-authored-by: Amélie <[email protected]>
Co-authored-by: Ahmed Fwela <[email protected]>
Co-authored-by: meili-bors[bot] <89034592+meili-bors[bot]@users.noreply.github.com>
Co-authored-by: alallema <[email protected]>
  • Loading branch information
5 people authored Jul 3, 2023
2 parents 72d01ac + 62b8e32 commit 3db5508
Showing 1 changed file with 69 additions and 1 deletion.
70 changes: 69 additions & 1 deletion .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
# the documentation on build
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
---
faceted_search_2: |-
await client.MultiSearchAsync(new MultiSearchQuery()
{
Queries = new System.Collections.Generic.List<SearchQuery>()
{
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
Expand Down Expand Up @@ -425,7 +454,7 @@ getting_started_communicating_with_a_protected_instance: |-
MeilisearchClient client = new MeilisearchClient("http://localhost:7700", "apiKey");
await client.Index("Movies").SearchAsync<Movie>("");
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()
Expand All @@ -450,6 +479,15 @@ faceted_search_walkthrough_filter_1: |-
Filter = "(genre = 'Horror' AND genre = 'Mystery') OR director = 'Jordan Peele'"
};
await client.Index("movies").SearchAsync<Movie>("thriller", sq);
faceted_search_update_settings_1: |-
List<string> attributes = new() { "genres", "rating", "language" };
TaskInfo result = await client.Index("books").UpdateFilterableAttributesAsync(attributes);
faceted_search_1: |-
var sq = new SearchQuery
{
Facets = new string[] { "genres", "rating", "language" }
};
await client.Index("books").SearchAsync<Book>("classic", sq);
add_movies_json_1: |-
// Make sure to add this using to your code
using System.IO;
Expand Down Expand Up @@ -541,6 +579,15 @@ geosearch_guide_sort_usage_2: |-
}
};
SearchResult<Restaurant> restaurants = await client.Index("restaurants").SearchAsync<Restaurant>("restaurants", filters);
geosearch_guide_filter_usage_3: |-
SearchQuery filters = new SearchQuery()
{
Sort = new string[] {
"_geoBoundingBox([45.494181, 9.179175], [45.449484, 9.214024])",
"rating:desc"
}
};
SearchResult<Restaurant> restaurants = await client.Index("restaurants").SearchAsync<Restaurant>("restaurants", filters);
primary_field_guide_create_index_primary_key: |-
TaskInfo task = await client.CreateIndexAsync("books", "reference_number");
Expand Down Expand Up @@ -688,3 +735,24 @@ update_faceting_settings_1: |-
await client.Index("movies").UpdateFacetingAsync(faceting);
reset_faceting_settings_1: |-
await client.Index("movies").ResetFacetingAsync();
multi_search_1: |-
await client.MultiSearchAsync(new MultiSearchQuery()
{
Queries = new System.Collections.Generic.List<SearchQuery>()
{
new SearchQuery() {
IndexUid = "movies",
Q = "booh",
Limit = 5
},
new SearchQuery() {
IndexUid = "movies",
Q = "nemo",
Limit = 5
},
new SearchQuery() {
IndexUid = "movie_ratings",
Q = "us",
},
}
});

0 comments on commit 3db5508

Please sign in to comment.