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

Language setting enhancement: Restrict the search auto-detection to a subset of languages based on the index settings #4828

Closed
2 tasks
ManyTheFish opened this issue Jul 25, 2024 · 2 comments
Assignees
Labels
enhancement New feature or improvement
Milestone

Comments

@ManyTheFish
Copy link
Member

ManyTheFish commented Jul 25, 2024

Summary

When putting the following Language settings:

{
   "localizedAttributes": [
      {"locales": ["jpn"], "attributePatterns": ["*"]}, 
   ]
}

Saying, "Everything is Japanese."

Then Meilisearch should be able to 100% detect Japanese without having to specify it at search time:

{
  "q": "進撃の巨人",
  "locales": ["jpn"]
}

See the related PRD:
https://meilisearch.notion.site/v1-10-Language-settings-usage-26c5d98b553349d9abacbe7aff698e4e?pvs=74

Technical Approach

In execute_search the locals are only taken from the search parameter, but if the locales are set to None, Meilisearch should be able to use the stored localized_attributes_rules to determine a subset of detectable languages.

TODO

  • Make Meilisearch use the stored localized_attributes_rules to auto-detect Language at search time
  • add tests
@ManyTheFish ManyTheFish added the enhancement New feature or improvement label Jul 25, 2024
@ManyTheFish ManyTheFish self-assigned this Jul 25, 2024
@ManyTheFish
Copy link
Member Author

@ManyTheFish will work on this during pre-release

@ManyTheFish ManyTheFish added this to the v1.10.0 milestone Jul 25, 2024
meili-bors bot added a commit that referenced this issue Aug 21, 2024
4881: Infer locales from index settings r=curquiza a=ManyTheFish

# Pull Request

## Related issue
Fixes #4828
Fixes #4816
## What does this PR do?
- Add some test using `AttributesToSearchOn`
- Make the search infer the language based on the index settings when the `locales` filed is not precise


CI is now working:
https://github.com/meilisearch/meilisearch/actions/runs/10490050545/job/29055955667



Co-authored-by: ManyTheFish <[email protected]>
@curquiza
Copy link
Member

Closed by #4881

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants