Skip to content

[10.x] Meilisearch v1 support #678

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

Merged
merged 6 commits into from
Feb 22, 2023

Conversation

mmachatschek
Copy link
Contributor

@mmachatschek mmachatschek commented Dec 16, 2022

@mmachatschek
Copy link
Contributor Author

@driesvints I'll bump you for an initial look at the changes

also maybe @curquiza or @brunoocasali can take a look too (the changes also have something to do with meilisearch/meilisearch-php#431)

@mmachatschek mmachatschek changed the title Make meilisearch v1 ready [10.x] Make meilisearch v1 ready Dec 16, 2022
@driesvints
Copy link
Member

@mmachatschek we're going to postpone the entire v10 release until Meilisearch PHP v1 is released but that's under the idea that it'll happen in early February. We don't want to wait longer than that.

@brunoocasali
Copy link
Contributor

Hi @mmachatschek, I approved and released the latest version https://github.com/meilisearch/meilisearch-php/releases/tag/v0.26.1

@driesvints our plan is to release a v1 of Meilisearch PHP in 2023 after the Meilisearch v1 which will occur in February 6th, 2023. We are now, planning the first quarter of 2023 and I'll personally include the PHP release as a top priority.

@driesvints
Copy link
Member

Thank you @brunoocasali!

@mmachatschek mmachatschek changed the title [10.x] Make meilisearch v1 ready [10.x] Meilisearch v1 preparation Dec 18, 2022
Copy link
Contributor

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mmachatschek, thanks a lot for your work here :)

@brunoocasali
Copy link
Contributor

@mmachatschek, I want to ask you to add the analytics information like Algolia's implementation does, if @driesvints agrees, to meilisearch-php.

The information can be sent as an array of strings like this:

['Meilisearch Laravel Scout (v10.0.0)'] there is a constructor argument you can send the information https://github.com/meilisearch/meilisearch-php/blob/main/src/Client.php#L52.

This information is essential for the Integrations Team to help maintain the integrations. By the way:

Analytics is enabled by default in the server, but you can disable them by following this guide
Also, of course, every analytics data we collect are ANONYMOUS read the guide for more information. So the users have nothing to worry about it.

@driesvints
Copy link
Member

@brunoocasali good idea. Would be cool if we could do that. Is that something we can already tackle in v9?

@brunoocasali
Copy link
Contributor

@brunoocasali good idea. Would be cool if we could do that. Is that something we can already tackle in v9?

Yes @driesvints! The analytics support started on Meilisearch v0.21, and Meilisearch-PHP added support for custom agents on v0.24.2.

@driesvints
Copy link
Member

In that case the only thing we’ll have to see is if we can add it on 9.x in a backwards compatible way so it doesn’t conflict with older meilisearch php installs that users might have.

@mmachatschek
Copy link
Contributor Author

mmachatschek commented Dec 21, 2022

@driesvints we can do that on the 9.x branch by making a version compare and then add the agent/or not if the version is lower than <0.24.2

that would be something for a differnt PR. I'll add the agent/analytics info on the 10.x branch with this PR

@mmachatschek
Copy link
Contributor Author

@driesvints will you add the migration guide?

@driesvints
Copy link
Member

@mmachatschek could you give me a tl;dr of the breaking changes?

@mmachatschek
Copy link
Contributor Author

@driesvints is the migration guide list in the PR description enough? I will take another look on the changes and check if there are more breaking changes for users other than the ones I already listed

@driesvints
Copy link
Member

@mmachatschek yeah looks good probably. Thanks!

@mmachatschek mmachatschek marked this pull request as ready for review February 6, 2023 14:49
@mmachatschek mmachatschek changed the title [10.x] Meilisearch v1 preparation [10.x] Meilisearch v1 support Feb 6, 2023
@driesvints
Copy link
Member

Seems like there's still work on this PR. Please ping me when it's ready and I'll write the upgrade guide then.

@mmachatschek mmachatschek marked this pull request as draft February 6, 2023 16:56
@driesvints
Copy link
Member

Thanks! I'll try to review this soon.

@mmachatschek mmachatschek force-pushed the remove_workarounds branch 2 times, most recently from fdb0fc5 to 5fcbf3c Compare February 8, 2023 20:07
Copy link
Contributor

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my POV it is good, but I may lack more knowledge from the laravel side :)

@driesvints
Copy link
Member

Cool. I just merged 9.x into 10.x so can you rebase with it? If that's done I'll start my review.

@mmachatschek mmachatschek force-pushed the remove_workarounds branch 2 times, most recently from 74727a1 to 70a371d Compare February 10, 2023 10:52
fix import


Upgrade to meilisearch-php v1

Update EngineManager.php
Fix deleteAllIndexes method

Fix deleteAllIndexes pagination


Update wrong usage of filters instead of filter

Update src/EngineManager.php

Co-authored-by: Bruno Casali <brunoocasali@gmail.com>

address review issue by @pyrou

Fetch all indexes before adding delete task


Update deleteallindexes implementation


increase number


fix case change
@mmachatschek
Copy link
Contributor Author

ping @driesvints rebase done

@driesvints
Copy link
Member

Code looks good. Thanks for all the work all! I'll write the migration guide soon before marking this as ready for review for Taylor.

@driesvints
Copy link
Member

Usage of the new pagination implementation of meilisearch (page/hitsPerPage) which makes the search results exhausitve instead of estimated

@mmachatschek can you give examples of how end users are affected? What did they get before and what will they get now? What Scout code would be affected?

@mmachatschek
Copy link
Contributor Author

@driesvints

@mmachatschek can you give examples of how end users are affected? What did they get before and what will they get now?

The pagination used in the new implementation, ensures that users get the correct counts of totalHits and totalPages which leads to more accurate paginations. There will not be any inconsistency between totalHits count on the first page, and the pages that come after that.

It may have happened that meilisearch e.g. returned a number of 1.000 totalHits on the first page and 950 on the 10th page.
So the previous implementation tried to give a faster estimate of how many results are available but that could lead to different counts on the paginations.

What Scout code would be affected?

I don't think there are any actions needed by end-users (that set limit/offset in a custom scout query) as meilisearch prefers the usage of (page/hitsPerPage) in the pagination that we call in the engine.

@driesvints
Copy link
Member

Cool, in that case I won't mention it in the upgrade guide.

Thanks a lot you all for all your work on this! @taylorotwell this is now ready for you to review. After merging this we can release Scout v10.

@driesvints driesvints marked this pull request as ready for review February 21, 2023 15:09
UPGRADE.md Outdated

Further more, all casing has been changed from the old `MeiliSearch` to the new `Meilisearch`. This means that all references to Meilisearch code you have in your codebase should adopt this new casing.

Please see [the full Meilisearch PHP v1.0 changelog](https://github.com/meilisearch/meilisearch/releases/tag/v1.0.0) for all changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just fixing the link. The old one was pointing to the Meilisearch release, not PHP release.

Suggested change
Please see [the full Meilisearch PHP v1.0 changelog](https://github.com/meilisearch/meilisearch/releases/tag/v1.0.0) for all changes.
Please see [the full Meilisearch PHP v1.0 changelog](https://github.com/meilisearch/meilisearch-php/releases/tag/v1.0.0) for all changes.

By the way, should we mention, the Meilisearch engine release release?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, should we mention, the Meilisearch engine release release?

The what?

driesvints and others added 3 commits February 22, 2023 09:24
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants