Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implements the update documents by function #664

Merged

Conversation

irevoire
Copy link
Member

Pull Request

Related issue

Fixes #661

What does this PR do?

  • Implements the update documents by function method
  • Add a test

@irevoire irevoire added enhancement New feature or request Meilisearch bump Changes related to the Meilisearch bump version labels Jul 31, 2024
@irevoire irevoire changed the base branch from main to bump-meilisearch-v1.10.0 July 31, 2024 15:28
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
curquiza
curquiza previously approved these changes Aug 1, 2024
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

@irevoire can you update the tests? 😇

@curquiza curquiza dismissed their stale review August 1, 2024 09:17

miss-click I wanted to refuse

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

Request of change for the tests (no miss click this time 🤞 )

@curquiza curquiza merged commit 3c237bb into bump-meilisearch-v1.10.0 Aug 1, 2024
11 of 12 checks passed
@curquiza curquiza deleted the implements-the-edit-document-function branch August 1, 2024 11:32
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>
# for free to join this conversation on GitHub. Already have an account? # 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] Update documents by function
3 participants