From a60f0590c50266058c9e348d9d68d2bcb655ea8a Mon Sep 17 00:00:00 2001 From: Alireza Ziaee Date: Sun, 9 Oct 2022 01:56:54 +0330 Subject: [PATCH 01/31] Migrate test project to .NET 6 --- CONTRIBUTING.md | 2 +- Dockerfile | 5 +---- tests/Meilisearch.Tests/Meilisearch.Tests.csproj | 5 ++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38cfabf0..cc0a6bdf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ You can set up your local environment natively or using `docker`, check out the Example of running all the checks with docker: ```bash -docker-compose run --rm package bash -c "dotnet test && dotnet format --check Meilisearch.sln" +docker-compose run --rm package bash -c "dotnet test && dotnet format --verify-no-changes -v n" ``` To install dependencies: diff --git a/Dockerfile b/Dockerfile index 356fbb4b..293f5387 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1 @@ -FROM mcr.microsoft.com/dotnet/sdk:3.1-bullseye - -RUN dotnet tool install -g dotnet-format -ENV PATH="$PATH:/root/.dotnet/tools" +FROM mcr.microsoft.com/dotnet/sdk:6.0 diff --git a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj index e131912d..a5da4b24 100644 --- a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj +++ b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj @@ -1,13 +1,12 @@ - + - netcoreapp3.1 + net6.0 false - From dcfb1cc0a0695667228e58f83661360f6937941d Mon Sep 17 00:00:00 2001 From: Alireza Ziaee Date: Sun, 9 Oct 2022 02:11:36 +0330 Subject: [PATCH 02/31] Remove Dockerfile --- Dockerfile | 1 - docker-compose.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 293f5387..00000000 --- a/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 diff --git a/docker-compose.yml b/docker-compose.yml index e0b3a019..9b513b75 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ volumes: services: package: - build: . + image: mcr.microsoft.com/dotnet/sdk:6.0 tty: true stdin_open: true working_dir: /home/package From 1452ec45e19dc39e45229a6e8cda68ef35d345b8 Mon Sep 17 00:00:00 2001 From: Alireza Ziaee Date: Mon, 10 Oct 2022 12:49:19 +0330 Subject: [PATCH 03/31] Fix tests workflow to support .NET 6 --- .github/workflows/tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 685a58f2..50ee735c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: "3.1.x" + dotnet-version: "6.0.x" - name: Install dependencies run: dotnet restore - name: Build @@ -39,8 +39,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: "3.1.x" - - name: Install dotnet-format - run: dotnet tool install -g dotnet-format + dotnet-version: "6.0.x" - name: Check with dotnet-format - run: dotnet format --check Meilisearch.sln + run: dotnet format --verify-no-changes -v n 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 04/31] 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 b3384ac6c295d488851227fe9806fbb8b5cef358 Mon Sep 17 00:00:00 2001 From: Alireza Ziaee Date: Tue, 9 May 2023 14:11:46 +0330 Subject: [PATCH 05/31] Fix packageReferences versions --- tests/Meilisearch.Tests/Meilisearch.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj index cc943950..e97ea9d7 100644 --- a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj +++ b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj @@ -7,8 +7,8 @@ - - + + From 53c2d25c14da3cfb06db047ba18c2633f59ccb60 Mon Sep 17 00:00:00 2001 From: Alireza Ziaee Date: Tue, 9 May 2023 14:18:01 +0330 Subject: [PATCH 06/31] Fix tests.yml --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3f2d434..740446fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,8 +40,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: "6.0.x" - - name: Check with dotnet-format - run: dotnet format --check Meilisearch.sln - name: Check with dotnet-format run: dotnet format --version - name: Check with dotnet-format From ebb35a801e96838c94186b5cc1818caecc8c0b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie?= Date: Mon, 5 Jun 2023 11:24:30 +0200 Subject: [PATCH 07/31] Update .github/workflows/tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 740446fb..2e77d5c9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,4 +43,4 @@ jobs: - name: Check with dotnet-format run: dotnet format --version - name: Check with dotnet-format - run: dotnet format --verify-no-changes -v n + run: dotnet format --verbosity normal --verify-no-changes From cc846edccd69cb3277d0763798d3dc09dde5dfd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie?= Date: Mon, 5 Jun 2023 11:24:41 +0200 Subject: [PATCH 08/31] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78286ac2..94cc67b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ You can set up your local environment natively or using `docker`, check out the Example of running all the checks with docker: ```bash -docker-compose run --rm package bash -c "dotnet test && dotnet format --verify-no-changes -v n" +docker-compose run --rm package bash -c "dotnet test && dotnet format --verbosity normal --verify-no-changes" ``` To install dependencies: From 7c1bcadbe7263fd27e3bc6bfd0a457ebfda4521d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie?= Date: Mon, 5 Jun 2023 11:34:32 +0200 Subject: [PATCH 09/31] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2e77d5c9..740446fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,4 +43,4 @@ jobs: - name: Check with dotnet-format run: dotnet format --version - name: Check with dotnet-format - run: dotnet format --verbosity normal --verify-no-changes + run: dotnet format --verify-no-changes -v n From 0bae4c7b8190271d47504884276c79b6f5171502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie?= Date: Tue, 6 Jun 2023 07:34:26 +0200 Subject: [PATCH 10/31] Update .github/workflows/tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 740446fb..2e77d5c9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,4 +43,4 @@ jobs: - name: Check with dotnet-format run: dotnet format --version - name: Check with dotnet-format - run: dotnet format --verify-no-changes -v n + run: dotnet format --verbosity normal --verify-no-changes From 032ede73c3a1eef0904c10beb94e2246d634721d Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 27 Jun 2023 01:46:58 +0300 Subject: [PATCH 11/31] Add new routes --- src/Meilisearch/Index.Documents.cs | 41 ++++++++++++++++--- .../QueryParameters/DeleteDocumentsQuery.cs | 14 +++++++ .../QueryParameters/DocumentsQuery.cs | 10 +++++ 3 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs diff --git a/src/Meilisearch/Index.Documents.cs b/src/Meilisearch/Index.Documents.cs index 88f35761..0b4a1d08 100644 --- a/src/Meilisearch/Index.Documents.cs +++ b/src/Meilisearch/Index.Documents.cs @@ -376,14 +376,27 @@ public async Task GetDocumentAsync(int documentId, List fields = d public async Task>> GetDocumentsAsync(DocumentsQuery query = default, CancellationToken cancellationToken = default) { - var uri = $"indexes/{Uid}/documents"; - if (query != null) + if (query != null && query.Filter != null) { - uri = $"{uri}?{query.ToQueryString()}"; + //Use the fetch route + var uri = $"indexes/{Uid}/documents/fetch"; + var result = await _http.PostAsJsonAsync(uri, query, cancellationToken: cancellationToken) + .ConfigureAwait(false); + return await result.Content + .ReadFromJsonAsync>>(cancellationToken: cancellationToken) + .ConfigureAwait(false); } + else + { + var uri = $"indexes/{Uid}/documents"; + if (query != null) + { + uri = $"{uri}?{query.ToQueryString()}"; + } - return await _http.GetFromJsonAsync>>(uri, cancellationToken: cancellationToken) - .ConfigureAwait(false); + return await _http.GetFromJsonAsync>>(uri, cancellationToken: cancellationToken) + .ConfigureAwait(false); + } } /// @@ -430,6 +443,24 @@ await _http.PostAsJsonAsync($"indexes/{Uid}/documents/delete-batch", documentIds .ConfigureAwait(false); } + /// + /// Delete documents from an index based on a filter. + /// + /// Available ONLY with Meilisearch v1.2 and newer. + /// A hash containing a filter that should match documents. + /// The cancellation token for this call. + /// Return the task info. + public async Task DeleteDocumentsAsync(DeleteDocumentsQuery query, + CancellationToken cancellationToken = default) + { + var httpresponse = + await _http.PostAsJsonAsync($"indexes/{Uid}/documents/delete", query, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + return await httpresponse.Content.ReadFromJsonAsync(cancellationToken: cancellationToken) + .ConfigureAwait(false); + } + /// /// Delete documents in batch. /// diff --git a/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs b/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs new file mode 100644 index 00000000..7e846d92 --- /dev/null +++ b/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs @@ -0,0 +1,14 @@ +using System.Text.Json.Serialization; + +namespace Meilisearch.QueryParameters +{ + public class DeleteDocumentsQuery + { + public DeleteDocumentsQuery(object filter) + { + Filter = filter; + } + [JsonPropertyName("filter")] + public object Filter { get; set; } + } +} diff --git a/src/Meilisearch/QueryParameters/DocumentsQuery.cs b/src/Meilisearch/QueryParameters/DocumentsQuery.cs index c6ae88c8..d5e2a191 100644 --- a/src/Meilisearch/QueryParameters/DocumentsQuery.cs +++ b/src/Meilisearch/QueryParameters/DocumentsQuery.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text.Json.Serialization; namespace Meilisearch.QueryParameters { @@ -10,16 +11,25 @@ public class DocumentsQuery /// /// Gets or sets the limit. /// + [JsonPropertyName("limit")] public int? Limit { get; set; } /// /// Gets or sets the offset. /// + [JsonPropertyName("offset")] public int? Offset { get; set; } /// /// Gets or sets the attributes to retrieve. /// + [JsonPropertyName("fields")] public List Fields { get; set; } + + /// + /// An optional filter to apply + /// + [JsonPropertyName("filter")] + public object Filter { get; set; } } } From 9ee23131aa81d691d66d5a9fde83779101c47634 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 27 Jun 2023 03:16:01 +0300 Subject: [PATCH 12/31] Added tets --- .env | 2 +- src/Meilisearch/Index.Documents.cs | 32 +++++++--- .../QueryParameters/DeleteDocumentsQuery.cs | 4 -- tests/Meilisearch.Tests/DocumentTests.cs | 64 +++++++++++++++---- 4 files changed, 76 insertions(+), 26 deletions(-) diff --git a/.env b/.env index 27411543..7fa0c6a5 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -MEILISEARCH_VERSION=v1.1.0 +MEILISEARCH_VERSION=v1.2.0 PROXIED_MEILISEARCH=http://nginx/api/ MEILISEARCH_URL=http://meilisearch:7700 diff --git a/src/Meilisearch/Index.Documents.cs b/src/Meilisearch/Index.Documents.cs index 0b4a1d08..433e6602 100644 --- a/src/Meilisearch/Index.Documents.cs +++ b/src/Meilisearch/Index.Documents.cs @@ -69,7 +69,8 @@ public async Task AddDocumentsJsonAsync(string documents, string prima /// One ASCII character used to customize the delimiter for CSV. Comma used by default. /// The cancellation token for this call. /// Returns the task info. - public async Task AddDocumentsCsvAsync(string documents, string primaryKey = default, char csvDelimiter = default, + public async Task AddDocumentsCsvAsync(string documents, string primaryKey = default, + char csvDelimiter = default, CancellationToken cancellationToken = default) { var uri = $"indexes/{Uid}/documents"; @@ -79,6 +80,7 @@ public async Task AddDocumentsCsvAsync(string documents, string primar { queryString.Add("primaryKey", primaryKey); } + if (csvDelimiter != default) { queryString.Add("csvDelimiter", csvDelimiter.ToString()); @@ -146,12 +148,14 @@ public async Task> AddDocumentsInBatchesAsync(IEnumerab /// The cancellation token for this call. /// Returns the task list. public async Task> AddDocumentsCsvInBatchesAsync(string documents, - int batchSize = 1000, string primaryKey = default, char csvDelimiter = default, CancellationToken cancellationToken = default) + int batchSize = 1000, string primaryKey = default, char csvDelimiter = default, + CancellationToken cancellationToken = default) { var tasks = new List(); foreach (var chunk in documents.GetCsvChunks(batchSize)) { - tasks.Add(await AddDocumentsCsvAsync(chunk, primaryKey, csvDelimiter, cancellationToken).ConfigureAwait(false)); + tasks.Add(await AddDocumentsCsvAsync(chunk, primaryKey, csvDelimiter, cancellationToken) + .ConfigureAwait(false)); } return tasks; @@ -196,7 +200,9 @@ public async Task UpdateDocumentsAsync(IEnumerable documents, st uri = $"{uri}?{new { primaryKey = primaryKey }.ToQueryString()}"; } - responseMessage = await _http.PutJsonCustomAsync(uri, documents, Constants.JsonSerializerOptionsRemoveNulls, cancellationToken).ConfigureAwait(false); + responseMessage = await _http + .PutJsonCustomAsync(uri, documents, Constants.JsonSerializerOptionsRemoveNulls, cancellationToken) + .ConfigureAwait(false); return await responseMessage.Content.ReadFromJsonAsync(cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -340,7 +346,8 @@ public async Task> UpdateDocumentsNdjsonInBatchesAsync(str /// The cancellation token for this call. /// Type of the document. /// Returns the document, with the according type if the object is available. - public async Task GetDocumentAsync(string documentId, List fields = default, CancellationToken cancellationToken = default) + public async Task GetDocumentAsync(string documentId, List fields = default, + CancellationToken cancellationToken = default) { var uri = $"indexes/{Uid}/documents/{documentId}"; if (fields != null) @@ -361,7 +368,8 @@ public async Task GetDocumentAsync(string documentId, List fields /// The cancellation token for this call. /// Type to return for document. /// Type if the object is availble. - public async Task GetDocumentAsync(int documentId, List fields = default, CancellationToken cancellationToken = default) + public async Task GetDocumentAsync(int documentId, List fields = default, + CancellationToken cancellationToken = default) { return await GetDocumentAsync(documentId.ToString(), fields, cancellationToken); } @@ -380,7 +388,8 @@ public async Task>> GetDocumentsAsync(Document { //Use the fetch route var uri = $"indexes/{Uid}/documents/fetch"; - var result = await _http.PostAsJsonAsync(uri, query, cancellationToken: cancellationToken) + var result = await _http.PostAsJsonAsync(uri, query, Constants.JsonSerializerOptionsRemoveNulls, + cancellationToken: cancellationToken) .ConfigureAwait(false); return await result.Content .ReadFromJsonAsync>>(cancellationToken: cancellationToken) @@ -394,7 +403,8 @@ public async Task>> GetDocumentsAsync(Document uri = $"{uri}?{query.ToQueryString()}"; } - return await _http.GetFromJsonAsync>>(uri, cancellationToken: cancellationToken) + return await _http + .GetFromJsonAsync>>(uri, cancellationToken: cancellationToken) .ConfigureAwait(false); } } @@ -455,6 +465,7 @@ public async Task DeleteDocumentsAsync(DeleteDocumentsQuery query, { var httpresponse = await _http.PostAsJsonAsync($"indexes/{Uid}/documents/delete", query, + Constants.JsonSerializerOptionsRemoveNulls, cancellationToken: cancellationToken) .ConfigureAwait(false); return await httpresponse.Content.ReadFromJsonAsync(cancellationToken: cancellationToken) @@ -508,6 +519,7 @@ public async Task> SearchAsync(string query, body = searchAttributes; body.Q = query; } + body.IndexUid = default; var responseMessage = await _http.PostAsJsonAsync($"indexes/{Uid}/search", body, @@ -515,8 +527,8 @@ public async Task> SearchAsync(string query, .ConfigureAwait(false); return await responseMessage.Content - .ReadFromJsonAsync>(cancellationToken: cancellationToken) - .ConfigureAwait(false); + .ReadFromJsonAsync>(cancellationToken: cancellationToken) + .ConfigureAwait(false); } } } diff --git a/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs b/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs index 7e846d92..008e15fa 100644 --- a/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs +++ b/src/Meilisearch/QueryParameters/DeleteDocumentsQuery.cs @@ -4,10 +4,6 @@ namespace Meilisearch.QueryParameters { public class DeleteDocumentsQuery { - public DeleteDocumentsQuery(object filter) - { - Filter = filter; - } [JsonPropertyName("filter")] public object Filter { get; set; } } diff --git a/tests/Meilisearch.Tests/DocumentTests.cs b/tests/Meilisearch.Tests/DocumentTests.cs index c87d5ff4..bd37fe24 100644 --- a/tests/Meilisearch.Tests/DocumentTests.cs +++ b/tests/Meilisearch.Tests/DocumentTests.cs @@ -23,7 +23,8 @@ public DocumentTests(TFixture fixture) _client = fixture.DefaultClient; } - public async Task InitializeAsync() => await _fixture.DeleteAllIndexes(); // Test context cleaned for each [Fact] + public async Task InitializeAsync() => + await _fixture.DeleteAllIndexes(); // Test context cleaned for each [Fact] public Task DisposeAsync() => Task.CompletedTask; @@ -134,10 +135,8 @@ public async Task BasicDocumentsAdditionInBatches() // Add the documents Movie[] movies = { - new Movie { Id = "1", Name = "Batman" }, - new Movie { Id = "2", Name = "Reservoir Dogs" }, - new Movie { Id = "3", Name = "Taxi Driver" }, - new Movie { Id = "4", Name = "Interstellar" }, + new Movie { Id = "1", Name = "Batman" }, new Movie { Id = "2", Name = "Reservoir Dogs" }, + new Movie { Id = "3", Name = "Taxi Driver" }, new Movie { Id = "4", Name = "Interstellar" }, new Movie { Id = "5", Name = "Titanic" }, }; var tasks = await index.AddDocumentsInBatchesAsync(movies, 2); @@ -419,10 +418,8 @@ public async Task BasicDocumentsUpdateInBatches() // Add the documents Movie[] movies = { - new Movie { Id = "1", Name = "Batman" }, - new Movie { Id = "2", Name = "Reservoir Dogs" }, - new Movie { Id = "3", Name = "Taxi Driver" }, - new Movie { Id = "4", Name = "Interstellar" }, + new Movie { Id = "1", Name = "Batman" }, new Movie { Id = "2", Name = "Reservoir Dogs" }, + new Movie { Id = "3", Name = "Taxi Driver" }, new Movie { Id = "4", Name = "Interstellar" }, new Movie { Id = "5", Name = "Titanic" }, }; var tasks = await index.AddDocumentsInBatchesAsync(movies, 2); @@ -590,6 +587,20 @@ public async Task GetMultipleExistingDocuments() documents.Results.Last().Id.Should().Be("16"); } + [Fact] + public async Task GetMultipleExistingDocumentsWithQuery() + { + var index = await _fixture.SetUpBasicIndex("GetMultipleExistingDocumentWithQueryTest"); + var taskUpdate = await index.UpdateFilterableAttributesAsync(new[] { "genre" }); + taskUpdate.TaskUid.Should().BeGreaterOrEqualTo(0); + await index.WaitForTaskAsync(taskUpdate.TaskUid); + + var documents = await index.GetDocumentsAsync(new DocumentsQuery() { Filter = "genre = 'SF'" }); + Assert.Equal(2, documents.Results.Count()); + documents.Results.Should().ContainSingle(x=>x.Id == "12"); + documents.Results.Should().ContainSingle(x=>x.Id == "13"); + } + [Fact] public async Task GetMultipleExistingDocumentsWithLimit() { @@ -604,7 +615,11 @@ public async Task GetMultipleExistingDocumentsWithLimit() public async Task GetMultipleExistingDocumentsWithField() { var index = await _fixture.SetUpBasicIndex("GetMultipleExistingDocumentWithLimitTest"); - var documents = await index.GetDocumentsAsync(new DocumentsQuery() { Limit = 2, Fields = new List { "id" } }); + var documents = + await index.GetDocumentsAsync(new DocumentsQuery() + { + Limit = 2, Fields = new List { "id" } + }); Assert.Equal(2, documents.Results.Count()); documents.Results.First().Id.Should().Be("10"); documents.Results.First().Name.Should().BeNull(); @@ -615,7 +630,11 @@ public async Task GetMultipleExistingDocumentsWithField() public async Task GetMultipleExistingDocumentsWithMultipleFields() { var index = await _fixture.SetUpBasicIndex("GetMultipleExistingDocumentWithLimitTest"); - var documents = await index.GetDocumentsAsync(new DocumentsQuery() { Limit = 2, Fields = new List { "id", "name" } }); + var documents = + await index.GetDocumentsAsync(new DocumentsQuery() + { + Limit = 2, Fields = new List { "id", "name" } + }); Assert.Equal(2, documents.Results.Count()); documents.Results.First().Id.Should().Be("10"); documents.Results.First().Name.Should().Be("Gladiator"); @@ -700,6 +719,29 @@ public async Task DeleteMultipleDocumentsWithIntegerId() Assert.Equal("document_not_found", ex.Code); } + [Fact] + public async Task DeleteMultipleDocumentsByFilter() + { + var index = await _fixture.SetUpBasicIndex("DeleteMultipleDocumentsByFilterTest"); + var taskUpdate = await index.UpdateFilterableAttributesAsync(new[] { "genre" }); + taskUpdate.TaskUid.Should().BeGreaterOrEqualTo(0); + await index.WaitForTaskAsync(taskUpdate.TaskUid); + + // Delete the documents + var task = await index.DeleteDocumentsAsync(new DeleteDocumentsQuery() { Filter = "genre = SF" }); + task.TaskUid.Should().BeGreaterOrEqualTo(0); + await index.WaitForTaskAsync(task.TaskUid); + + // Check the documents have been deleted + var docs = await index.GetDocumentsAsync(); + Assert.Equal(5, docs.Results.Count()); + MeilisearchApiError ex; + ex = await Assert.ThrowsAsync(() => index.GetDocumentAsync("12")); + Assert.Equal("document_not_found", ex.Code); + ex = await Assert.ThrowsAsync(() => index.GetDocumentAsync("13")); + Assert.Equal("document_not_found", ex.Code); + } + [Fact] public async Task DeleteAllExistingDocuments() { From f13e76fc74ec7da66d8bc7960b20b0e53b4bb4e9 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 27 Jun 2023 03:19:06 +0300 Subject: [PATCH 13/31] format --- tests/Meilisearch.Tests/DocumentTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/Meilisearch.Tests/DocumentTests.cs b/tests/Meilisearch.Tests/DocumentTests.cs index bd37fe24..ebdaa3fc 100644 --- a/tests/Meilisearch.Tests/DocumentTests.cs +++ b/tests/Meilisearch.Tests/DocumentTests.cs @@ -597,8 +597,8 @@ public async Task GetMultipleExistingDocumentsWithQuery() var documents = await index.GetDocumentsAsync(new DocumentsQuery() { Filter = "genre = 'SF'" }); Assert.Equal(2, documents.Results.Count()); - documents.Results.Should().ContainSingle(x=>x.Id == "12"); - documents.Results.Should().ContainSingle(x=>x.Id == "13"); + documents.Results.Should().ContainSingle(x => x.Id == "12"); + documents.Results.Should().ContainSingle(x => x.Id == "13"); } [Fact] @@ -618,7 +618,8 @@ public async Task GetMultipleExistingDocumentsWithField() var documents = await index.GetDocumentsAsync(new DocumentsQuery() { - Limit = 2, Fields = new List { "id" } + Limit = 2, + Fields = new List { "id" } }); Assert.Equal(2, documents.Results.Count()); documents.Results.First().Id.Should().Be("10"); @@ -633,7 +634,8 @@ public async Task GetMultipleExistingDocumentsWithMultipleFields() var documents = await index.GetDocumentsAsync(new DocumentsQuery() { - Limit = 2, Fields = new List { "id", "name" } + Limit = 2, + Fields = new List { "id", "name" } }); Assert.Equal(2, documents.Results.Count()); documents.Results.First().Id.Should().Be("10"); From 71f06e790e6ce02a566d28e15140fcdf1c655544 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 27 Jun 2023 04:47:24 +0300 Subject: [PATCH 14/31] Updated code samples --- .code-samples.meilisearch.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 9e145690..80d68750 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -80,7 +80,13 @@ delete_an_index_1: |- get_one_document_1: |- await client.Index("movies").GetDocumentAsync(25684, new List { "id", "title", "poster", "release_date" }); get_documents_1: |- - await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { Limit = 2 }); + await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { Limit = 2, Filter = "genres = action" }); +get_documents_post_1: |- + await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { + Limit = 3, + Fields = new List { "title", "genres", "rating", "language"}, + Filter = "genres = action OR genres = adventure" + }); add_or_replace_documents_1: |- var movie = new[] { @@ -104,8 +110,10 @@ delete_all_documents_1: |- await client.Index("movies").DeleteAllDocumentsAsync(); delete_one_document_1: |- await client.Index("movies").DeleteOneDocumentAsync("25684"); -delete_documents_1: |- +delete_documents_by_batch_1: |- await client.Index("movies").DeleteDocumentsAsync(new[] { "23488", "153738", "437035", "363869" }); +delete_documents_by_filter_1: |- + await client.Index("movies").DeleteDocumentsAsync(new DeleteDocumentsQuery() { Filter = "genres = action OR genres = adventure" }); search_post_1: |- await client.Index("movies").SearchAsync("American ninja"); get_task_1: | From 556572682e281365f663ed41dd6286274c781443 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Thu, 29 Jun 2023 02:08:48 +0300 Subject: [PATCH 15/31] Address Review --- .code-samples.meilisearch.yaml | 2 +- src/Meilisearch/Constants.cs | 6 ++++ src/Meilisearch/Index.Documents.cs | 45 ++++++++++++++++++++---------- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 80d68750..f7c4c941 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -85,7 +85,7 @@ get_documents_post_1: |- await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { Limit = 3, Fields = new List { "title", "genres", "rating", "language"}, - Filter = "genres = action OR genres = adventure" + Filter = "(rating > 3 AND (genres=Adventure OR genres=Fiction)) AND language=English" }); add_or_replace_documents_1: |- var movie = new[] diff --git a/src/Meilisearch/Constants.cs b/src/Meilisearch/Constants.cs index d147bbb0..5aa0a1b3 100644 --- a/src/Meilisearch/Constants.cs +++ b/src/Meilisearch/Constants.cs @@ -25,5 +25,11 @@ internal static class Constants DefaultIgnoreCondition = JsonIgnoreCondition.Never, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, }; + + internal static string VersionErrorHintMessage(string message, string method) + { + return + $"{message}\nHint: It might not be working because maybe you're not up to date with the Meilisearch version that ${method} call requires."; + } } } diff --git a/src/Meilisearch/Index.Documents.cs b/src/Meilisearch/Index.Documents.cs index 433e6602..307f0e28 100644 --- a/src/Meilisearch/Index.Documents.cs +++ b/src/Meilisearch/Index.Documents.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; @@ -386,14 +387,22 @@ public async Task>> GetDocumentsAsync(Document { if (query != null && query.Filter != null) { - //Use the fetch route - var uri = $"indexes/{Uid}/documents/fetch"; - var result = await _http.PostAsJsonAsync(uri, query, Constants.JsonSerializerOptionsRemoveNulls, - cancellationToken: cancellationToken) - .ConfigureAwait(false); - return await result.Content - .ReadFromJsonAsync>>(cancellationToken: cancellationToken) - .ConfigureAwait(false); + try + { + //Use the fetch route + var uri = $"indexes/{Uid}/documents/fetch"; + var result = await _http.PostAsJsonAsync(uri, query, Constants.JsonSerializerOptionsRemoveNulls, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + return await result.Content + .ReadFromJsonAsync>>(cancellationToken: cancellationToken) + .ConfigureAwait(false); + } + catch (MeilisearchCommunicationError e) + { + throw new MeilisearchCommunicationError( + Constants.VersionErrorHintMessage(e.Message, nameof(GetDocumentsAsync)), e); + } } else { @@ -463,13 +472,21 @@ await _http.PostAsJsonAsync($"indexes/{Uid}/documents/delete-batch", documentIds public async Task DeleteDocumentsAsync(DeleteDocumentsQuery query, CancellationToken cancellationToken = default) { - var httpresponse = - await _http.PostAsJsonAsync($"indexes/{Uid}/documents/delete", query, - Constants.JsonSerializerOptionsRemoveNulls, - cancellationToken: cancellationToken) + try + { + var httpresponse = + await _http.PostAsJsonAsync($"indexes/{Uid}/documents/delete", query, + Constants.JsonSerializerOptionsRemoveNulls, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + return await httpresponse.Content.ReadFromJsonAsync(cancellationToken: cancellationToken) .ConfigureAwait(false); - return await httpresponse.Content.ReadFromJsonAsync(cancellationToken: cancellationToken) - .ConfigureAwait(false); + } + catch (MeilisearchCommunicationError e) + { + throw new MeilisearchCommunicationError( + Constants.VersionErrorHintMessage(e.Message, nameof(DeleteDocumentsAsync)), e); + } } /// From 9ce6908760f4432723cbe92e3929a26438974f48 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Mon, 3 Jul 2023 15:12:05 +0300 Subject: [PATCH 16/31] 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 17/31] 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 + }); From 103eccacd7e1eaec5d122e118a0baceb04f0540e Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:15:27 -0300 Subject: [PATCH 18/31] Update .code-samples.meilisearch.yaml --- .code-samples.meilisearch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 4a280612..f118f703 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -327,7 +327,7 @@ documents_guide_add_movie_1: |- new Movie { MovieId = "123sq178", Title = "Amelie Poulain" } }; await index.AddDocumentsAsync(movie); -getting_started_add_documents_md: |- +PLEASE_UPDATE_ME>>>>>>>>>>>>>getting_started_add_documents_md: |- ```bash dotnet add package Meilisearch ``` From b45c0b7dd7a4c8cf84cb956673aec4037562cdd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 04:40:17 +0000 Subject: [PATCH 19/31] Bump System.IdentityModel.Tokens.Jwt from 6.30.0 to 6.31.0 Bumps [System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 6.30.0 to 6.31.0. - [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases) - [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md) - [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/6.30.0...6.31.0) --- updated-dependencies: - dependency-name: System.IdentityModel.Tokens.Jwt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index d6086172..c508f524 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -21,7 +21,7 @@ - + From 88fc2f48d92da90d06cc81b3ec6c91a050fe3c54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 04:27:56 +0000 Subject: [PATCH 20/31] Bump Microsoft.NET.Test.Sdk from 17.6.1 to 17.6.3 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.1 to 17.6.3. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.6.1...v17.6.3) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/Meilisearch.Tests/Meilisearch.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj index 0f0934ad..58b6eea6 100644 --- a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj +++ b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj @@ -8,7 +8,7 @@ - + From 8429568cd4bd54a16bed95691796ea162554cac9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 04:31:19 +0000 Subject: [PATCH 21/31] Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/v2.4.5...2.5.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/Meilisearch.Tests/Meilisearch.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj index 0f0934ad..36fccf0b 100644 --- a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj +++ b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj @@ -10,7 +10,7 @@ - + From 375bf3379d920873697156eb78919483fe0fe4bc Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 11 Jul 2023 12:29:30 +0200 Subject: [PATCH 22/31] Update masterKey to aSampleMasterKey --- .code-samples.meilisearch.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 1d5a5d71..fbeb3509 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -111,10 +111,10 @@ get_one_document_1: |- get_documents_1: |- await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { Limit = 2, Filter = "genres = action" }); get_documents_post_1: |- - await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { - Limit = 3, - Fields = new List { "title", "genres", "rating", "language"}, - Filter = "(rating > 3 AND (genres=Adventure OR genres=Fiction)) AND language=English" + await client.Index("movies").GetDocumentsAsync(new DocumentsQuery() { + Limit = 3, + Fields = new List { "title", "genres", "rating", "language"}, + Filter = "(rating > 3 AND (genres=Adventure OR genres=Fiction)) AND language=English" }); add_or_replace_documents_1: |- var movie = new[] @@ -335,7 +335,7 @@ documents_guide_add_movie_1: |- new Movie { MovieId = "123sq178", Title = "Amelie Poulain" } }; await index.AddDocumentsAsync(movie); -PLEASE_UPDATE_ME>>>>>>>>>>>>>getting_started_add_documents_md: |- +getting_started_add_documents_md: |- ```bash dotnet add package Meilisearch ``` @@ -362,7 +362,7 @@ PLEASE_UPDATE_ME>>>>>>>>>>>>>getting_started_add_documents_md: |- { static async Task Main(string[] args) { - MeilisearchClient client = new MeilisearchClient("http://localhost:7700", "masterKey"); + MeilisearchClient client = new MeilisearchClient("http://localhost:7700", "aSampleMasterKey"); var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true From 8f380bd5f26bc254ef2ebe1839c41bef74e4b4d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 13:25:14 +0000 Subject: [PATCH 23/31] Bump xunit from 2.4.2 to 2.5.0 Bumps [xunit](https://github.com/xunit/xunit) from 2.4.2 to 2.5.0. - [Commits](https://github.com/xunit/xunit/compare/2.4.2...2.5.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/Meilisearch.Tests/Meilisearch.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj index 5671c73f..c4f5a7df 100644 --- a/tests/Meilisearch.Tests/Meilisearch.Tests.csproj +++ b/tests/Meilisearch.Tests/Meilisearch.Tests.csproj @@ -9,7 +9,7 @@ - + From ca2bcd4e11d36ba70aac5c835fe1743473c1c736 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Tue, 11 Jul 2023 10:29:15 -0300 Subject: [PATCH 24/31] Update src/Meilisearch/Meilisearch.csproj --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index c508f524..ab028d31 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -4,7 +4,7 @@ netstandard2.0 Library MeiliSearch - 0.14.2 + 0.14.3 .NET wrapper for Meilisearch, an open-source search engine https://github.com/meilisearch/meilisearch-dotnet meilisearch;dotnet;sdk;search-engine;search;instant-search From 157f17284bb5b979ebde71475155a2c969e0d64d Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 11 Jul 2023 16:53:22 +0300 Subject: [PATCH 25/31] fix nuget CI --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index ab028d31..0dd67bf4 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -26,7 +26,7 @@ - + From 8dd7f9ffcdecca0e2be5afe01c6b12ed1cc56d87 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 11 Jul 2023 16:56:45 +0300 Subject: [PATCH 26/31] fix logo path --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index 0dd67bf4..eab2efe3 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -27,7 +27,7 @@ - + From f1e10763e942317bac351e984e7470adf9a86f5b Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Tue, 11 Jul 2023 17:00:42 +0300 Subject: [PATCH 27/31] reset visible to false --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index eab2efe3..f6001781 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -27,7 +27,7 @@ - + From 9fad41aeb7897b23e6756c4e427bcfa52d190f47 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:53:00 -0300 Subject: [PATCH 28/31] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d128d2cf..b5661ace 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ For general information on how to use Meilisearch—such as our API reference, t ## ⚡ Supercharge your Meilisearch experience -Say goodbye to server deployment and manual updates with [Meilisearch Cloud](https://www.meilisearch.com/pricing?utm_campaign=oss&utm_source=integration&utm_medium=meilisearch-dotnet). No credit card required. +Say goodbye to server deployment and manual updates with [Meilisearch Cloud](https://www.meilisearch.com/pricing?utm_campaign=oss&utm_source=integration&utm_medium=meilisearch-dotnet). Get started with a 14-day free trial! No credit card required. ## 🔧 Installation From bc036b711539284480e3bd2602a1e65e5a4f57f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 04:51:11 +0000 Subject: [PATCH 29/31] Bump System.IdentityModel.Tokens.Jwt from 6.31.0 to 6.32.0 Bumps [System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 6.31.0 to 6.32.0. - [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases) - [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md) - [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/6.31.0...v6.32.0) --- updated-dependencies: - dependency-name: System.IdentityModel.Tokens.Jwt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index f6001781..ba4173b3 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -21,7 +21,7 @@ - + From 175984dd7d6212f2e51442c4f5558222095820d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 04:17:13 +0000 Subject: [PATCH 30/31] Bump System.IdentityModel.Tokens.Jwt from 6.32.0 to 6.32.1 Bumps [System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 6.32.0 to 6.32.1. - [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases) - [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md) - [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/v6.32.0...6.32.1) --- updated-dependencies: - dependency-name: System.IdentityModel.Tokens.Jwt dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Meilisearch/Meilisearch.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Meilisearch/Meilisearch.csproj b/src/Meilisearch/Meilisearch.csproj index ba4173b3..c3405f4b 100644 --- a/src/Meilisearch/Meilisearch.csproj +++ b/src/Meilisearch/Meilisearch.csproj @@ -21,7 +21,7 @@ - + From 56f75f9c943b130c1de2e56634c92a00c21943dd Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:38:07 -0300 Subject: [PATCH 31/31] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5661ace..b9d358ee 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

Meilisearch | -Meilisearch Cloud | +Meilisearch Cloud | Documentation | Discord | Roadmap | @@ -51,7 +51,7 @@ For general information on how to use Meilisearch—such as our API reference, t ## ⚡ Supercharge your Meilisearch experience -Say goodbye to server deployment and manual updates with [Meilisearch Cloud](https://www.meilisearch.com/pricing?utm_campaign=oss&utm_source=integration&utm_medium=meilisearch-dotnet). Get started with a 14-day free trial! No credit card required. +Say goodbye to server deployment and manual updates with [Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=github&utm_medium=meilisearch-dotnet). Get started with a 14-day free trial! No credit card required. ## 🔧 Installation