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

[v1.10.0] Language settings & search parameter #560

Closed
5 tasks
brunoocasali opened this issue Aug 27, 2024 · 1 comment · Fixed by #583
Closed
5 tasks

[v1.10.0] Language settings & search parameter #560

brunoocasali opened this issue Aug 27, 2024 · 1 comment · Fixed by #583
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@brunoocasali
Copy link
Member

Following this central issue

Explanation of the feature

Changes

  • new settings localizedAttributes and the sub-methods associated to it
  • new search parameter locales

Usage: https://meilisearch.notion.site/v1-10-Language-settings-usage-26c5d98b553349d9abacbe7aff698e4e

TODO

  • Add a new search parameter named locales to the search methods (GET and POST)
  • Ensure the updateSettings route can accept the new localizedAttributes setting
  • Create new methods getLocalizedAttributes, updateLocalizedAttributes and resetLocalizedAttributes corresponding to the sub settings GET/PUT/DELETE routes
  • Add tests
  • Add code samples for the feature:
    search_parameter_reference_locales_1: |-
        client.index('INDEX_NAME').search('進撃の巨人', { locales: ['jpn'] })
    get_localized_attribute_settings_1: |-
        client.index('INDEX_NAME').getLocalizedAttributes()
    update_localized_attribute_settings_1: |-
        client.index('INDEX_NAME').updateLocalizedAttributes([
            { attributePatterns: ['jpn'], locales: ['*_ja'] },
        ])
    reset_localized_attribute_settings_1: |-
        client.index('INDEX_NAME').resetLocalizedAttributes()
@brunoocasali brunoocasali added enhancement New feature or request good first issue Good for newcomers labels Aug 27, 2024
@ellnix
Copy link
Collaborator

ellnix commented Jan 2, 2025

I believe this code sample is incorrect:

    client.index('INDEX_NAME').updateLocalizedAttributes([
        { attributePatterns: ['jpn'], locales: ['*_ja'] },
    ])

It should be:

    client.index('INDEX_NAME').updateLocalizedAttributes([
        { attributePatterns: ['*_ja'], locales: ['jpn'] },
    ])

(attributePatterns and locales are flipped)

In its current state, the server throws an error.


@meili-bors meili-bors bot closed this as completed in 5c91e87 Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants