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

Handle the new federation options #663

Merged
merged 10 commits into from
Aug 1, 2024

Conversation

irevoire
Copy link
Member

Pull Request

Related issue

Fixes #659

What does this PR do?

  • Create a new object, federationOptions, which can specify the weight of a query.
  • Add a method to provide the federationOptions to a search request
  • Adds the federation field parameter in the multi-search
  • Add a test

Hey @norkunas, since you reviewed #662 and are definitely better than me in PHP I added you as a reviewer in this PR as well.
If you don't have the time don't worry we'll find another reviewer 👍

@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 12:49
Co-authored-by: Tomas Norkūnas <[email protected]>
@irevoire irevoire force-pushed the handle-the-new-federation-options branch from 4547cae to dc9fd3b Compare July 31, 2024 13:06
@irevoire irevoire force-pushed the handle-the-new-federation-options branch from c0f4dcf to 47ffe4b Compare August 1, 2024 09:02
@irevoire irevoire requested a review from norkunas August 1, 2024 09:03
src/Contracts/SearchQuery.php Outdated Show resolved Hide resolved
@irevoire irevoire requested a review from norkunas August 1, 2024 09:53
@curquiza curquiza merged commit e76988c into bump-meilisearch-v1.10.0 Aug 1, 2024
11 of 12 checks passed
@curquiza curquiza deleted the handle-the-new-federation-options branch August 1, 2024 11:32
@curquiza curquiza mentioned this pull request Aug 2, 2024
3 tasks
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 <[email protected]>
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] Federated search
3 participants