Skip to content

Releases: meilisearch/meilisearch-symfony

v0.16.1 🎵

10 Feb 09:05
36ef676

Choose a tag to compare

🐛 Bug Fixes

Thanks again to @Strift, and @norkunas! 🎉

v0.16.0 🎵

10 Feb 03:28
24b40a5

Choose a tag to compare

Migration guide

⚠️ Breaking changes

Requirements:

  • PHP: now requires PHP 8.1
  • Symfony: now requires Symfony 6.4+ or 7.x

SearchService deprecation

SearchService is now deprecated, and we recommend migrating to the new SearchManagerInterface instead.

Before (v0.15.10)
use Meilisearch\Bundle\SearchService;
use Doctrine\Persistence\ObjectManager;

final class PostSearch
{
    public function __construct(
        private SearchService $searchService,
        private ObjectManager $om,
    ) {}

    public function index(Post $post): void
    {
        // array<array<string, array{taskUid: int, status: string, ...}>>
        $response = $this->searchService->index($this->om, $post);

        $taskUid = $response[0]['posts']['taskUid'];
    }

    public function search(string $query): array
    {
        // list<Post>
        return $this->searchService->search(
            $this->om,
            Post::class,
            $query,
            ['limit' => 20],
        );
    }
}
After (v0.16.0)
use Meilisearch\Bundle\SearchManagerInterface;
use Meilisearch\Bundle\Model\SearchResults;
use Meilisearch\Contracts\Task;

final class PostSearch
{
    public function __construct(
        private SearchManagerInterface $searchManager,
    ) {}

    public function index(Post $post): void
    {
        // list<array<non-empty-string, Task>>
        $batches = $this->searchManager->index($post);

        /** @var Task $task */
        $task = $batches[0]['posts'];

        $taskUid = $task->getTaskUid();
        $task->wait(); // optional
    }

    public function search(string $query): SearchResults
    {
        // SearchResults<Post>
        $results = $this->searchManager->search(
            Post::class,
            $query,
            ['limit' => 20],
        );

        // Entities:
        $posts = $results->getHits(); // array<Post>

        // Metadata (optional):
        $totalHits = $results->getTotalHits();

        return $results;
    }
}

🚀 Enhancements

Note

This release is compatible with meilisearch-php@v2.0.0-beta.5, which brings type improvements.

⚙️ Maintenance/misc

Thanks again to @Chris53897, @Chris8934, @Strift, @brunoocasali, @curquiza, @dependabot[bot], @norkunas, @unicolored and dependabot[bot]! 🎉

v0.15.10 🎵

13 Nov 18:15
781bc60

Choose a tag to compare

🚀 Enhancements

⚙️ Maintenance/misc

Thanks again to @Chris53897, @Chris8934, @dependabot[bot], @meili-bors[bot], @norkunas and dependabot[bot]! 🎉

v0.15.9 🎵

10 Sep 09:46
a5a19d8

Choose a tag to compare

🚀 Enhancements

Thanks again to @johndodev, @norkunas and dependabot[bot]! 🎉

v0.15.8 🎵

04 Jun 09:45
80cefbf

Choose a tag to compare

  • Fix tests for v1.14 (#380) @Strift
  • Changes related to the next Meilisearch release (v1.14.0) (#378)

🚀 Enhancements

⚙️ Maintenance/misc

  • Cleanup CI configuring composer's minimum-stability (#383) @norkunas

Thanks again to @Strift, @meili-bors[bot], @norkunas and dependabot[bot]! 🎉

v0.15.7 🎵

03 Dec 13:06
345bb2b

Choose a tag to compare

🐛 Bug Fixes

  • Use VariableNode on "settings" configuration (#370) @pan93412
  • Fix: Container extension "meili_search" is not registered. (#371) @pan93412

⚙️ Maintenance/misc

Thanks again to @meili-bors[bot], @norkunas and @pan93412! 🎉

v0.15.6 🎵

24 Oct 03:41
9b25dfc

Choose a tag to compare

🚀 Enhancements

  • Add an option to use index swap in import command (#354) @thislg
  • Allow to configure custom http client (#359) @norkunas

🐛 Bug Fixes

⚙️ Maintenance/misc

Thanks again to @meili-bors[bot], @norkunas and @thislg! 🎉

v0.15.5 🎵

06 Sep 21:07
d510d87

Choose a tag to compare

🐛 Bug Fixes

  • Fix throwing TaskException with valid type argument (#349) @norkunas

⚙️ Maintenance/misc

Thanks again to @johndodev, @meili-bors[bot] and @norkunas! 🎉

v0.15.4 🎵

02 Aug 03:56
4bd0b39

Choose a tag to compare

  • Fixed Engine::remove() when multiple entities are provided (#342) @remigarcia

Thanks again to @meili-bors[bot], @norkunas, @remigarcia and Rémi Garcia! 🎉

v0.15.3 🎵

25 Jul 12:51
835a737

Choose a tag to compare

🚀 Enhancements

⚙️ Maintenance/misc

  • Test with Symfony 7.1 and leverage its features (#334) @norkunas
  • Add cs fixer native_function_invocation rule from meilisearch-php (#339) @norkunas

Thanks again to @meili-bors[bot] and @norkunas! 🎉