-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a GetChunks extension method for batches #230
Conversation
Hey @juchom I'll take some time to review your PR, but I didn’t forget you! Anyway, thanks for your contribution, I'll let you know if I need anything! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @juchom🥇
Your description really helped me to understand what was going on there, the improvement made a real difference, thanks! 🎉
bors merge |
230: Create a GetChunks extension method for batches r=brunoocasali a=juchom # Pull Request ## What does this PR do? This pull request is here to make code a little bit easier to follow for batches. For exemple if we look at `AddDocumentsInBatchesAsync` we have this two piece of code. https://github.com/meilisearch/meilisearch-dotnet/blob/3f14f432a658deb8a83ab505179b34559e9c1252/src/Meilisearch/Index.cs#L152-L161 https://github.com/meilisearch/meilisearch-dotnet/blob/3f14f432a658deb8a83ab505179b34559e9c1252/src/Meilisearch/Index.cs#L732-L745 To follow the code we have to start 159 with a call to the second snippet. We go to the second snippet where we do so computation to get chunks, then we call a function and we have to go up to the first snippet and see what is happening with this local function. With this refactoring the `AddDocumentsInBatchesAsync` is self explaining. The second snippet is now replaced by an extension method that returns a chunk on demand. With the new code you see what the method is doing on first read https://github.com/meilisearch/meilisearch-dotnet/blob/4264a71913db643356c128670de09122b6c7e7f4/src/Meilisearch/Index.cs#L152-L161 This is a part from a previous PR #213. I will make several from #213 because there is too much things in this one. Co-authored-by: Julien Chomarat <j.chomarat@linoa.com>
Build failed: |
bors try |
tryBuild failed: |
bors try |
tryBuild succeeded: |
a10653c
to
30cb794
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FINALLY! 🔥 🔥
Thanks a lot @juchom
bors merge |
Build succeeded: |
Pull Request
What does this PR do?
This pull request is here to make code a little bit easier to follow for batches.
For exemple if we look at
AddDocumentsInBatchesAsync
we have this two piece of code.meilisearch-dotnet/src/Meilisearch/Index.cs
Lines 152 to 161 in 3f14f43
meilisearch-dotnet/src/Meilisearch/Index.cs
Lines 732 to 745 in 3f14f43
To follow the code we have to start 159 with a call to the second snippet. We go to the second snippet where we do so computation to get chunks, then we call a function and we have to go up to the first snippet and see what is happening with this local function.
With this refactoring the
AddDocumentsInBatchesAsync
is self explaining.The second snippet is now replaced by an extension method that returns a chunk on demand.
With the new code you see what the method is doing on first read
meilisearch-dotnet/src/Meilisearch/Index.cs
Lines 152 to 161 in 4264a71
This is a part from a previous PR #213. I will make several from #213 because there is too much things in this one.