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

Implements localized attributes #662

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

irevoire
Copy link
Member

Pull Request

Warning

The tests won't work since the Meilisearch implementation is broken currently in rc0, see the following PR meilisearch/meilisearch#4836
I did the test on the branch that implemented the change though.

Related issue

Fixes #660

What does this PR do?

  • Add a new search parameter named locales to the search method
  • 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

@irevoire irevoire added the Meilisearch bump Changes related to the Meilisearch bump version label Jul 30, 2024
@irevoire irevoire requested a review from curquiza July 30, 2024 16:47
@curquiza curquiza added the enhancement New feature or request label Jul 31, 2024
@irevoire irevoire linked an issue Jul 31, 2024 that may be closed by this pull request
2 tasks
@irevoire irevoire force-pushed the implements-localized-attributes branch from 93e8d12 to 6c24ae4 Compare July 31, 2024 16:11
@norkunas
Copy link
Collaborator

norkunas commented Aug 1, 2024

Too many unrelated commits :)

@irevoire irevoire force-pushed the implements-localized-attributes branch from 6c24ae4 to ad3aae0 Compare August 1, 2024 08:17
@irevoire
Copy link
Member Author

irevoire commented Aug 1, 2024

Oops yes good catch, I failed my rebase 😅

@irevoire irevoire removed a link to an issue Aug 1, 2024
2 tasks
@irevoire irevoire linked an issue Aug 1, 2024 that may be closed by this pull request
4 tasks
@curquiza
Copy link
Member

curquiza commented Aug 1, 2024

Merging! The non-passing test is not related to this PR (already present on bump-meilisearch-v1.10)

@curquiza curquiza merged commit abbd51d into bump-meilisearch-v1.10.0 Aug 1, 2024
11 of 12 checks passed
@curquiza curquiza deleted the implements-localized-attributes branch August 1, 2024 09:10
meili-bors bot added a commit that referenced this pull request Aug 26, 2024
668: Update version for the next release (v1.10.0) r=brunoocasali a=meili-bot

_This PR is auto-generated._

The automated script updates the version of meilisearch-php to a new version: "v1.10.0"

CHANGELOGS 👇

This version introduces features released on Meilisearch v1.10.0 🎉
Check out the changelog of [Meilisearch v1.10.0](https://github.com/meilisearch/meilisearch/releases/tag/v1.10.0) for more information on the changes.

## 🚀 Enhancements

- Add localized attributes settings (#662) `@/irevoire` 
```
$client->index('INDEX_NAME')->updateLocalizedAttributes([
    'locales' => ['jpn'],
    'attributePatterns' => ['*_ja']
]);
```

- Add `locales` search parameter (#663) `@/irevoire`
```php
$client->index('INDEX_NAME')->search('進撃の巨人', [
    'locales' => ['jpn']
]);
```

- Add federation options when doing multi-search (#663) `@/irevoire` 
```php
$client->multiSearch([
      (new SearchQuery())
        ->setIndexUid('movies'))
        ->setQuery('batman')
        ->setLimit(5),
      (new SearchQuery())
        ->setIndexUid('comics')
        ->setQuery('batman')
        ->setLimit(5),
    ],
    (new MultiSearchFederation())
  );
```

- Add capability to update documents by function (⚠️ experimental feature) (#664) `@/irevoire`

```php
 $function = '
            if doc.id % context.modulo == 0 {
                doc.title = `kefir would read ${doc.title}`;
            };
            doc.remove("comment");
            doc.remove("genre");
';
$client-> index->updateDocumentsByFunction($function, ['context' => ['modulo' => 3]]);
```

## ⚙️ Maintenance/misc

- Update CI (#666 & #667) `@/norkunas` 


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Meilisearch bump Changes related to the Meilisearch bump version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.10.0] Language settings & search parameter
3 participants