Skip to content
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

v0.28: Smart cropping #1687

Closed
guimachiavelli opened this issue Jun 7, 2022 · 5 comments · Fixed by #1707 or #1730
Closed

v0.28: Smart cropping #1687

guimachiavelli opened this issue Jun 7, 2022 · 5 comments · Fixed by #1707 or #1730
Assignees
Milestone

Comments

@guimachiavelli
Copy link
Member

Currently, when using attributesToCrop, Meilisearch will start cropping at the first occurrence of any search term. If a user searches for 'white car', cropping of 'the woman in the white shirt drove a white car' will be centred on the first 'white', even though the second occurrence includes both terms.

With v0.28, a new cropping algorithm will instead centre cropping so it includes the highest possible number of search terms. We are calling this "smart cropping."

References

PR: meilisearch/milli#483
Issue on core: meilisearch/meilisearch#2299
SME: @ManyTheFish

@guimachiavelli guimachiavelli added this to the v0.28 milestone Jun 7, 2022
@ManyTheFish
Copy link
Member

ManyTheFish commented Jun 7, 2022

Hey @guimachiavelli, about the "smart cropping" names, it's not an official name chosen by the product team but an identifier for the core team.
You can freely change it for something else that would better fit the documentation.

@guimachiavelli
Copy link
Member Author

Thanks for the clarification, @ManyTheFish ☺️

@guimachiavelli guimachiavelli self-assigned this Jun 9, 2022
@guimachiavelli guimachiavelli mentioned this issue Jun 15, 2022
@guimachiavelli
Copy link
Member Author

@ManyTheFish, just to be sure: what is the cropping behaviour for single-word queries (e.g. shirt)? Do we centre the crop around the first occurrence of the term, like on <=v0.27, but take the sentence context in consideration, like on >=v0.28?

@ManyTheFish
Copy link
Member

ManyTheFish commented Jun 15, 2022

we take the sentence context in consideration 😄

@guimachiavelli
Copy link
Member Author

Brilliant, thanks!

bors bot added a commit that referenced this issue Jul 7, 2022
1730: v0.28: Smart cropping r=guimachiavelli a=guimachiavelli

Closes #1687 

Co-authored-by: gui machiavelli <[email protected]>
Co-authored-by: gui machiavelli <[email protected]>
bors bot added a commit that referenced this issue Jul 11, 2022
1707: v0.28 r=guimachiavelli a=guimachiavelli

This is a staging PR for all changes related to Meilisearch v0.28.

Please avoid making changes directly to this PR; instead, create new child branches based off this one.

Closes #1687, #1688, #1691, #1692, #1693, #1694, #1699, #1700, #1701, #1702, #1703, #1704, #1706, #1722, #1727, #561

Co-authored-by: gui machiavelli <[email protected]>
Co-authored-by: gui machiavelli <[email protected]>
Co-authored-by: Tommy Melvin <[email protected]>
Co-authored-by: Maryam Sulemani <[email protected]>
Co-authored-by: Maryam <[email protected]>
@bors bors bot closed this as completed in #1707 Jul 11, 2022
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 a pull request may close this issue.

2 participants