NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
Packagist
Packagist, #605 most downloaded on Packagist
PHP wrapper for the Meilisearch API
Latest stable
v1.17.0
Last release 1 months ago
07 Oct 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
80 releases Β· first in 2020
Drag across the ruler to compare, or tap a release to open it.
If you're migrating from v1.x , read the complete migration guide .
If you're migrating from v1.x, read the complete migration guide.
Index instead of IndexesThe per-index object from $client->index() / $client->getIndex() is now Meilisearch\Endpoints\Index. Metadata is lazy-loaded; fetchInfo() and fetchPrimaryKey() were removed.
Update type hints, imports, and code that fetched index metadata or assumed getIndex() made an HTTP call.
Rename Indexes to Index
// Before (v1.x)
use Meilisearch\Endpoints\Indexes;
function handle(Indexes $index): void { /* ... */ }
// After (v2.x)
use Meilisearch\Endpoints\Index;
function handle(Index $index): void { /* ... */ }getIndex() is now lazy
// Before (v1.x) - threw ApiException immediately if the index didn't exist
$index = $client->getIndex('missing');
// After (v2.x) - the call to a getter triggers the fetch (and any exception)
$index = $client->getIndex('missing');
$index->getPrimaryKey(); // ApiException thrown hereCall getters instead of fetchInfo() / fetchPrimaryKey()
// Before (v1.x)
$index = $client->index('books');
$index->fetchInfo();
$primaryKey = $index->fetchPrimaryKey();
// After (v2.x)
$index = $client->index('books');
$primaryKey = $index->getPrimaryKey(); // loads on demandgetUid(), getCreatedAt(), getUpdatedAt() are no longer nullable
// Before (v1.x)
$date = $index->getCreatedAt();
if ($date !== null) {
echo $date->format(DATE_ATOM);
}
// After (v2.x)
echo $index->getCreatedAt()->format(DATE_ATOM);multiSearch() now takes MultiSearchQuerysetIndexUid() and setFederationOptions() were moved off SearchQuery and onto the new MultiSearchQuery class. SearchQuery is now only for single-index search.
Update multi-search and federation query construction.
Use MultiSearchQuery for multiSearch()
// Before (v1.x)
use Meilisearch\Contracts\SearchQuery;
$client->multiSearch([
(new SearchQuery())->setIndexUid('books')->setQuery('prince'),
(new SearchQuery())->setIndexUid('songs')->setQuery('be'),
]);
// After (v2.x)
use Meilisearch\Contracts\MultiSearchQuery;
$client->multiSearch([
(new MultiSearchQuery())->setIndexUid('books')->setQuery('prince'),
(new MultiSearchQuery())->setIndexUid('songs')->setQuery('be'),
]);Use MultiSearchQuery for federation options
// Before (v1.x)
$query = (new SearchQuery())
->setIndexUid('books')
->setFederationOptions((new FederationOptions())->setWeight(0.5));
// After (v2.x)
$query = (new MultiSearchQuery())
->setIndexUid('books')
->setFederationOptions((new FederationOptions())->setWeight(0.5));IndexStats objectIndex stats APIs no longer return array-based responses. They now return a typed IndexStats object.
Update code that reads index stats fields to use getter methods.
$stats = $index->stats();
// Before (v1.x)
$count = $stats['numberOfDocuments'];
$indexing = $stats['isIndexing'];
$fields = $stats['fieldDistribution'];
// After (v2.x)
$count = $stats->getNumberOfDocuments();
$indexing = $stats->isIndexing();
$fields = $stats->getFieldDistribution();getSettings() returns plain arrays for nested settingssynonyms, typoTolerance, faceting, and embedders are now plain arrays instead of iterable setting objects, so iterator_to_array() is no longer needed.
Update code that converts nested settings to arrays.
$settings = $index->getSettings();
// Before (v1.x)
$typoTolerance = iterator_to_array($settings['typoTolerance']);
$synonyms = iterator_to_array($settings['synonyms']);
// After (v2.x)
$typoTolerance = $settings['typoTolerance'];
$synonyms = $settings['synonyms'];Batch objectsBatch APIs no longer return array-based responses. They now return typed Batch objects.
Update code that reads batch fields or lists batches.
// Before (v1.x)
$batch = $client->getBatch($uid);
$uid = $batch['uid'];
$startedAt = $batch['startedAt']; // string
$total = $batch['stats']['totalNbTasks'];
// After (v2.x)
$batch = $client->getBatch($uid);
$uid = $batch->getUid();
$startedAt = $batch->getStartedAt(); // \DateTimeImmutable
$total = $batch->getStats()->getTotalNbTasks();This also applies to $client->getBatches(). getResults() now returns an array of Batch objects.
// Before (v1.x)
$batches = $client->getBatches();
$uid = $batches->getResults()[0]['uid'];
// After (v2.x)
$batches = $client->getBatches();
$uid = $batches->getResults()[0]->getUid();progress is a BatchProgress object while the batch is running, and null when it has finished.
// Before (v1.x)
$percent = $batch['progress']['percentage'] ?? null;
// After (v2.x)
$percent = $batch->getProgress()?->getPercentage();Indexes stats, settings, and search (#931) @StriftBatch results (#928) @StriftIndexes stats, settings, and search (#931) @StriftindexSize and usedIndexSize to IndexStats (#946) @murilolivoratowait() tests with HTTP-stubbed polling (#947) @StriftThanks to @Strift, @murilolivorato and @norkunas! π
See full changelog: v2.0.0-beta.7...v2.0.0-beta.8
Your coding agent can read these notes before it upgrades. Set up the MCP server β
If you're migrating from v1.x, read the complete migration guide.
Index instead of IndexesThe per-index object from $client->index() / $client->getIndex() is now Meilisearch\Endpoints\Index. Metadata is lazy-loaded; fetchInfo() and fetchPrimaryKey() were removed.
Update type hints, imports, and code that fetched index metadata or assumed getIndex() made an HTTP call.
Rename Indexes to Index
// Before (v1.x)
use Meilisearch\Endpoints\Indexes;
function handle(Indexes $index): void { /* ... */ }
// After (v2.x)
use Meilisearch\Endpoints\Index;
function handle(Index $index): void { /* ... */ }
getIndex() is now lazy
// Before (v1.x) - threw ApiException immediately if the index didn't exist
$index = $client->getIndex('missing');
// After (v2.x) - the call to a getter triggers the fetch (and any exception)
$index = $client->getIndex('missing');
$index->getPrimaryKey(); // ApiException thrown here
Call getters instead of fetchInfo() / fetchPrimaryKey()
// Before (v1.x)
$index = $client->index('books');
$index->fetchInfo();
$primaryKey = $index->fetchPrimaryKey();
// After (v2.x)
$index = $client->index('books');
$primaryKey = $index->getPrimaryKey(); // loads on demand
getUid(), getCreatedAt(), getUpdatedAt() are no longer nullable
// Before (v1.x)
$date = $index->getCreatedAt();
if ($date !== null) {
echo $date->format(DATE_ATOM);
}
// After (v2.x)
echo $index->getCreatedAt()->format(DATE_ATOM);
multiSearch() now takes MultiSearchQuerysetIndexUid() and setFederationOptions() were moved off SearchQuery and onto the new MultiSearchQuery class. SearchQuery is now only for single-index search.
Update multi-search and federation query construction.
Use MultiSearchQuery for multiSearch()
// Before (v1.x)
use Meilisearch\Contracts\SearchQuery;
$client->multiSearch([
(new SearchQuery())->setIndexUid('books')->setQuery('prince'),
(new SearchQuery())->setIndexUid('songs')->setQuery('be'),
]);
// After (v2.x)
use Meilisearch\Contracts\MultiSearchQuery;
$client->multiSearch([
(new MultiSearchQuery())->setIndexUid('books')->setQuery('prince'),
(new MultiSearchQuery())->setIndexUid('songs')->setQuery('be'),
]);
Use MultiSearchQuery for federation options
// Before (v1.x)
$query = (new SearchQuery())
->setIndexUid('books')
->setFederationOptions((new FederationOptions())->setWeight(0.5));
// After (v2.x)
$query = (new MultiSearchQuery())
->setIndexUid('books')
->setFederationOptions((new FederationOptions())->setWeight(0.5));
IndexStats objectIndex stats APIs no longer return array-based responses. They now return a typed IndexStats object.
Update code that reads index stats fields to use getter methods.
$stats = $index->stats();
// Before (v1.x)
$count = $stats['numberOfDocuments'];
$indexing = $stats['isIndexing'];
$fields = $stats['fieldDistribution'];
// After (v2.x)
$count = $stats->getNumberOfDocuments();
$indexing = $stats->isIndexing();
$fields = $stats->getFieldDistribution();
getSettings() returns plain arrays for nested settingssynonyms, typoTolerance, faceting, and embedders are now plain arrays instead of iterable setting objects, so iterator_to_array() is no longer needed.
Update code that converts nested settings to arrays.
$settings = $index->getSettings();
// Before (v1.x)
$typoTolerance = iterator_to_array($settings['typoTolerance']);
$synonyms = iterator_to_array($settings['synonyms']);
// After (v2.x)
$typoTolerance = $settings['typoTolerance'];
$synonyms = $settings['synonyms'];
Batch objectsBatch APIs no longer return array-based responses. They now return typed Batch objects.
Update code that reads batch fields or lists batches.
// Before (v1.x)
$batch = $client->getBatch($uid);
$uid = $batch['uid'];
$startedAt = $batch['startedAt']; // string
$total = $batch['stats']['totalNbTasks'];
// After (v2.x)
$batch = $client->getBatch($uid);
$uid = $batch->getUid();
$startedAt = $batch->getStartedAt(); // \DateTimeImmutable
$total = $batch->getStats()->getTotalNbTasks();
This also applies to $client->getBatches(). getResults() now returns an array of Batch objects.
// Before (v1.x)
$batches = $client->getBatches();
$uid = $batches->getResults()[0]['uid'];
// After (v2.x)
$batches = $client->getBatches();
$uid = $batches->getResults()[0]->getUid();
progress is a BatchProgress object while the batch is running, and null when it has finished.
// Before (v1.x)
$percent = $batch['progress']['percentage'] ?? null;
// After (v2.x)
$percent = $batch->getProgress()?->getPercentage();
Indexes stats, settings, and search (#931) @StriftBatch results (#928) @StriftIndexes stats, settings, and search (#931) @StriftindexSize and usedIndexSize to IndexStats (#946) @murilolivoratowait() tests with HTTP-stubbed polling (#947) @StriftThanks to @Strift, @murilolivorato and @norkunas! π
See full changelog: https://github.com/meilisearch/meilisearch-php/compare/v2.0.0-beta.7...v2.0.0-beta.8
Typehint HandlesSystem::health return type ( #927 ) @Strift
HandlesDocuments::getDocument. (#926) @StriftThanks to @Strift, @dependabot[bot], @mvanhorn, Matt Van Horn and dependabot[bot]! π
See full changelog: v2.0.0-beta.6...v2.0.0-beta.7
If you're migrating from v1.x , read the complete migration guide .
If you're migrating from v1.x, read the complete migration guide.
API key methods no longer accept array-based write payloads or return plain list shapes. They now use CreateKeyQuery and UpdateKeyQuery for requests, KeysResults for lists, and KeyAction for actions.
// Before (v1.x)
$key = $client->createKey([
'description' => 'tenant token key',
'actions' => ['*'],
'indexes' => ['tenant*'],
'expiresAt' => '2055-10-02T00:00:00Z',
]);
// After (v2.x)
$key = $client->createKey(new CreateKeyQuery(
actions: [KeyAction::Any],
indexes: ['tenant*'],
description: 'tenant token key',
expiresAt: new DateTimeImmutable('2055-10-02T00:00:00Z'),
));The client updateKey method accepts an UpdateKeyQuery, which works similarly. It allows clearing the key name or description by passing null.
Additionally, KeysResults::count() was removed; use count($keysResults) instead.
SimilarDocumentsQuery, FacetSearchResult, and SearchResult are now finalThese other changes only pertain to PHPStan type hints improvements:
DocumentsResults (#908) @norkunasData's ArrayAccess methods (#912) @norkunasshowPerformanceDetails option (#871) @QDenkadistinct in federated search requests (#892) @mvanhornarray_key_exists instead of isset in Task::offsetExists (#870) @norkunasThanks to @QDenka, @Strift, @curquiza, @mvanhorn and @norkunas! π
See full changelog: v2.0.0-beta.5...v2.0.0-beta.6
Note This replaces the incorrect v2.0.0-beta.4 release tagged from the wrong branch.
Note
This replaces the incorrect v2.0.0-beta.4 release tagged from the wrong branch.
If you're migrating from v1.x, read the full migration guide instead.
$client->getTasks() and $index->getTasks() now return a TaskResults object.
// Before (v1.x)
$tasks = $client->getTasks();
$results = $tasks['results']; // Accessing as array
// After (v2.x)
$tasks = $client->getTasks(); // Returns TaskResults
$results = $tasks->getResults(); // Returns an array of Task objectsAdditionally
all() method now returns an array of Task objects.TaskResults class is now finalTask and implement ArrayAccess (backward compatibility) (#863) @norkunasThanks to @Strift, @norkunas and dependabot[bot]! π
See full changelog: v2.0.0-beta.3...v2.0.0-beta.5
Warning This release was incorrectly tagged from the wrong branch . Please use v2.0.0-beta.5 instead.
Warning
This release was incorrectly tagged from the wrong branch.
Please use v2.0.0-beta.5 instead.
Fix PHP-CS-Fixer deprecation ( #830 ) @norkunas
The custom $message property has been removed from custom exceptions. Use the getMessage() method instead:
try {
// ...
} catch (\Meilisearch\Exceptions\ApiException $e) {
// Before (v1.x)
echo $e->message;
// After (v2.x)
echo $e->getMessage();
}Also:
rethrowWithHint static method now returns a \RuntimeException instead of a generic \Exception.Thanks to @Strift and @norkunas! π
See full changelog: v2.0.0-beta.2...v2.0.0-beta.3
Database stats now return a typed Stats object
Stats object$stats = $client->stats();
// Before (v1.x) - accessing stats as array
$databaseSize = $response['databaseSize'];
$usedDatabaseSize = $response['usedDatabaseSize'];
// etc...
// After (v2.x) - use getter methods
$databaseSize = $stats->getDatabaseSize();
$usedDatabaseSize = $stats->getUsedDatabaseSize();Version object$version = $client->version();
// Before (v1.x) - access as array
$commitSha = $version['commitSha'];
$commitDate = $version['commitDate']; // String
$pkgVersion = $version['pkgVersion'];
// After (v2.x) - use getter methods
$commitSha = $version->getCommitSha();
$commitDate = $version->getCommitDate(); // \DateTimeImmutable
$pkgVersion = $version->getPkgVersion();MeiliSearch namespaceWe removed MeiliSearch (capital S) namespace.
// Before (v1.x) - MeiliSearch with capital S
use MeiliSearch\Client;
// After (v2.x) - Meilisearch without capital S
use Meilisearch\Client;Indexes::parseDate() public methodThis only affects you if you were using this utility method directly.
// Before (v1.x) - If you used this method in your code
$dateTime = \Meilisearch\Endpoints\Indexes::parseDate('2021-01-01T01:23:45.123456Z');
// After (v2.x) - Use native PHP instead
$dateTime = new \DateTimeImmutable('2021-01-01T01:23:45.123456Z');Stats object (#823) @norkunasVersion object (#821) @norkunasThanks to @Strift, @bpolaszek, @dependabot[bot], @norkunas, @tacman, and @walkwizus! π
See full changelog: v2.0.0-beta.1...v2.0.0-beta.2
While we recommend against production usage due to breaking changes, the code is stable. Please consider whether you can afford the potential upcomingβ¦
While we recommend against production usage due to breaking changes, the code is stable. Please consider whether you can afford the potential upcoming breaking changes before upgrading.
This introduces two changes:
wait(int $timeoutInMs = 5000, int $intervalInMs = 50): Task methodAwaiting tasks:
// Before
$promise = $this->client->createIndex('new-index', ['primaryKey' => 'objectID']);
$this->index->waitForTask($promise['taskUid']);
// After
$this->client->createIndex('new-index', ['primaryKey' => 'objectID'])->wait();Asserting task status:
// Before
$task = $this->client->getTask($taskUid);
if ($task['status'] === 'succeeded') {
// do something
}
// After
if ($task->getStatus() === TaskStatus::Succeeded) {
// do something
}Asserting task types:
// Before
$task = $this->client->getTask($taskUid);
if ($task['type'] === 'indexCreation') {
// do something
}
// After
$task = $this->client->getTask($taskUid);
if ($task->getType() === TaskType::IndexCreation) {
// do something
}Before: catching SDK-specific JSON exceptions
<?php
try {
$client->index('books')->addDocuments([["title" => "\xB1\x31"]]);
} catch (JsonEncodingException | JsonDecodingException $e) {
// handle JSON errors
}After: catching native PHP JsonException
<?php
try {
$client->index('books')->addDocuments([["title" => "\xB1\x31"]]);
} catch (\JsonException $e) {
// handle JSON errors
}documents endpoint (#779) @bpolaszekphp-version in matrix (#792) @StriftThanks to @Strift, @bpolaszek, and @norkunas! π
See full changelog: v1.16.0...v2.0.0-beta.1
Add Dynamic Search Rules (#942) @Junaid-PK
Thanks to @Junaid-PK, @Strift, @dependabot[bot] and dependabot[bot]! π
See full changelog: https://github.com/meilisearch/meilisearch-php/compare/v1.16.1...v1.17.0
This PR adds support for sorting to the documents endpoint .
This PR adds support for sorting to the documents endpoint.
Thanks to @Strift, and dependabot[bot]! π
See full changelog: v1.16.0...v1.16.1
This release makes the SDK compatible with features release in Meilisearch 1.16 .
This release makes the SDK compatible with features release in Meilisearch 1.16.
retrieveVectors (#777) @bpolaszekThanks again to @Strift, @bpolaszek, @brunoocasali, and @norkunas! π
This version introduces features released in Meilisearch v1.15.0.
This version introduces features released in Meilisearch v1.15.0.
disableOnNumbers field to typo tolerance settings (#753) @Strift_md code samples for Mintlify migration (#737) @curquizaThanks again to @Strift, @curquiza, and @norkunas! π
Adds new features related to Meilisearch 1.14 (#731) @Strift
Thanks again to @Strift! π
This version introduces features released on Meilisearch v1.13.0 π Check out the changelog of Meilisearch v1.13.0 for more information on the changes.
This version introduces features released on Meilisearch v1.13.0 π Check out the changelog of Meilisearch v1.13.0 for more information on the changes.
Thanks again to @Strift! π
This version introduces features released on Meilisearch v1.12.0 π
This version introduces features released on Meilisearch v1.12.0 π
Check out the Meilisearch v1.12.0 changelog for more information.
Introducing new methods to get one or several batches, respectively getBatch() and getBatches(). A batch is a set of tasks processed together.
The TaskQuery class now has a setReverse() method to retrieve tasks in reverse chronological order.
client->getTasks((new TasksQuery())->setReverse(true));
Index settings now allow disabling prefix search and facet search. They're both enabled by default. The SDK now comes with dedicated methods to configure these settings.
// disable prefix search
$index->updatePrefixSearch('disabled');
// reset prefix search settings
$index->resetPrefixSearch();
// disable facet search
$index->updateFacetSearch(false);
// reset facet search settings
$index->resetFacetSearch();
hitsCount always the number of hits (and not totalHits value) (https://github.com/meilisearch/meilisearch-php/pull/701) @johnnynotsoluckyThanks again to @aivchen, @johnnynotsolucky, @norkunas, @mdubus and @Strift! π
This version introduces features released on Meilisearch v1.11.0 π Check out the changelog of Meilisearch v1.11.0 for more information on the changes.
This version introduces features released on Meilisearch v1.11.0 π Check out the changelog of Meilisearch v1.11.0 for more information on the changes.
multiSearch (#683) @ManyTheFish & @norkunasrankingScoreThreshold to SimilarDocumentsQuery (#675) @norkunasThanks again to @ManyTheFish, @grizzm0, @apozeus and @norkunas! π
feat: Adds hybrid search options contract for multisearch (#677) @apozeus
rankingScoreThreshold to SimilarDocumentsQuery (#675) @norkunasThanks again to @apozeus, @grizzm0, and @norkunas! π
Implements localized attributes (#662) @irevoire
Thanks again to @brunoocasali, @curquiza, @irevoire, and @norkunas! π
Handle unexpected but valid JSON content-types (#656) @brunoocasali
Thanks again to @brunoocasali, and @norkunas! π
This version introduces features released on Meilisearch v1.9.0 π Check out the changelog of Meilisearch v1.9.0 for more information on the changes.
This version introduces features released on Meilisearch v1.9.0 π Check out the changelog of Meilisearch v1.9.0 for more information on the changes.
$client->index('INDEX_NAME')->search('badman', [
'rankingScoreThreshold' => 0.2
]);
$similarQuery = new SimilarDocumentsQuery('TARGET_DOCUMENT_ID');
$client->index('INDEX_NAME')->getSimilar($similarQuery);
setRetrieveVectors method to SimilarDocumentsQuerysetRetrieveVectors method to DocumentsQuery$client->index('products')->updateFilterableAttributes(['product_id', 'sku', 'url']);
Thanks again to @Koopzington, @ManyTheFish, @curquiza, and @the-sinner! π
This version introduces features released on Meilisearch v1.8.0 π Check out the changelog of Meilisearch v1.8.0 for more information on the changes.
This version introduces features released on Meilisearch v1.8.0 π Check out the changelog of Meilisearch v1.8.0 for more information on the changes.
searchCutoffMs (https://github.com/meilisearch/meilisearch-php/pull/636) @brunoocasali$client->index('books')->getSearchCutoffMs();
$client->index('books')->updateSearchCutoffMs(150);
$client->index('books')->resetSearchCutoffMs();
getSemanticHitCount() method to retrieve how many results were found because of the semantic query. https://github.com/meilisearch/meilisearch-php/pull/639 @brunoocasaliThanks again to @brunoocasali, @curquiza, @guimachiavelli, and @norkunas! π
This version introduces features released on Meilisearch v1.7.0 :tada: Check out the changelog of Meilisearch v1.7.0 for more information on the chang
This version introduces features released on Meilisearch v1.7.0 :tada: Check out the changelog of Meilisearch v1.7.0 for more information on the changes.
scoreDetails feature is not experimental anymore. You can directly use showRankingScoreDetails during a search without activating the experimental feature πFix "CsvInBatchesWithDelimiter" test (#613) @aivchen
Thanks again to @aivchen, and @norkunas! π
Add support for the new setting: proximityPrecision (https://github.com/meilisearch/meilisearch-php/pull/606) brunoocasali `php $client->index('books'
proximityPrecision (https://github.com/meilisearch/meilisearch-php/pull/606) brunoocasali$client->index('books')->getProximityPrecision();
$client->index('books')->updateProximityPrecision('byAttribute');
$client->index('books')->resetProximityPrecision();
β οΈ This is about an experimental feature of Meilisearch. Activate the vectorStore experimental feature to use it
embedders settings & Add support for the hybrid parameter during search (https://github.com/meilisearch/meilisearch-php/pull/608) brunoocasali$client->index('books')->getEmbedders();
$client->index('books')->updateEmbedders(['default' => ['source' => 'userProvided', 'dimensions' => 1]]);
$client->index('books')->resetEmbedders();
@throws in HandlesTasks delegate (#599) @norkunasThanks again to @norkunas, @brunoocasali! π
This version introduces features released on Meilisearch v1.5.0 :tada: Check out the changelog of Meilisearch v1.5.0 for more information on the chang
This version introduces features released on Meilisearch v1.5.0 :tada: Check out the changelog of Meilisearch v1.5.0 for more information on the changes.
β οΈ If you want to adopt new features of this release, update the Meilisearch server to the appropriate version.
createSnapshot() to trigger snapshot creation. Similar to the already existing createDump() for dumps (#587) @brunoocasaliFix an unexpected breaking change in v1.4.0 when passing a empty masterkey (#585) @mmachatschek
Thanks again to @mmachatschek! π
A bug fix in Meilisearch v1.4.0 introduces a breaking change in the filter usage. It only concerns users using the filter search parameter with \. Expβ¦
This version introduces features released on Meilisearch v1.4.0 :tada: Check out the changelog of Meilisearch v1.4.0 for more information on the changes.
β οΈ If you want to adopt new features of this release, update the Meilisearch server to the according version.
dictionary (#574) @alallema$index->getDictionary();
$index->updateDictionary(['J. R. R.', 'W. E. B.']);
$index->resetDictionary();
separator-tokens (#574) @alallema$index->getSeparatorTokens();
$index->updateSeparatorTokens(['|', '…']);
$index->resetSeparatorTokens();
non-separator-tokens (#574) @alallema$index->getNonSeparatorTokens();
$index->updateNonSeparatorTokens(['@', '#']);
$index->resetNonSeparatorTokens();
A bug fix in Meilisearch v1.4.0 introduces a breaking change in the filter usage. It only concerns users using the filter search parameter with \.
Explanation and change to apply are detailed in the Meilisearch v1.4.0
Thanks again to @alallema, @brunoocasali, @curquiza, @dependabot, @dependabot[bot], @meili-bors[bot], and @norkunas! π
This version introduces features released on Meilisearch v1.3.0 :tada: Check out the changelog of Meilisearch v1.3.0 for more information on the chang
This version introduces features released on Meilisearch v1.3.0 :tada: Check out the changelog of Meilisearch v1.3.0 for more information on the changes.
β οΈ If you want to adopt new features of this release, update the Meilisearch server to the according version.
setShowRankingScoreDetails and search(['showRankingScoreDetails' => boolean]) to show the scores of each relevant document returned in the search.setVector and search(['vector' => [...]]) to enable vector search capabilities.setAttributesToSearchOn and search(['attributesToSearchOn' => [...]])index->facetSearch(FacetSearchQuery params) to search only in facets.β οΈ The EXPERIMENTAL features are not covered by semver. To explicitly opt-in, check this guide.
Thanks again to @94noni, @Strift, @alallema, @brunoocasali, @norkunas and @stloyd! π
Fix fetching documents by getDocuments with filters and fields being set in DocumentsQuery (#523) @panzer-punk
getDocuments with filters and fields being set in DocumentsQuery (#523) @panzer-punkThanks again to @justkahdri, @panzer-punk! π
Still, even being supported, the ability to receive only a list of ids is *deprecated*, and it will be removed in meilisearch-php v2
This version introduces features released on Meilisearch v1.2.0 :tada: Check out the changelog of Meilisearch v1.2.0 for more information on the changes. β οΈ If you want to adopt new features of this release, update the Meilisearch server to the according version.
The method deleteDocuments() now supports a different behavior. This method could take an array containing a filter key with the filter value, which will filter and delete the documents. #509 @brunoocasali
β οΈ You must configure the attributes you want to filter using the Index\filterableAttributes().
β οΈ Remember to update your Meilisearch server to v1.2.0 or newer before adopting it.
Still, even being supported, the ability to receive only a list of ids is deprecated, and it will be removed in meilisearch-php v2
Add the ability to setFilter in the DocumentsQuery. When a query with a filter is sent to getDocuments(DocumentsQuery $query) it will filter the documents similar to the search method. See the docs on how to use filters. #510 @brunoocasali
β οΈ You must configure the attributes you want to filter using the Index\filterableAttributes().
β οΈ Remember to update your Meilisearch server to v1.2.0 or newer before adopting it.
Thanks again to @brunoocasali, @tacman, @norkunas! π
Nothing published for this version
This version introduces features released on Meilisearch v1.1.0 :tada: Check out the changelog of Meilisearch v1.1.0 for more information on the chang
This version introduces features released on Meilisearch v1.1.0 :tada: Check out the changelog of Meilisearch v1.1.0 for more information on the changes. If you want to adopt new features of this release, update the Meilisearch server to the according version.
addDocumentsCsv, addDocumentsCsvInBatches, and updateDocumentsCsvInBatches. This argument allows you to customize the separator character in your csv file. (#480) @brunoocasalifacetStats on SearchResult (#487) @brunoocasali.$client->multiSearch() method to execute multiple search requests simultaneously with different configurations. (#481) @brunoocasali
Introduce SearchQuery builder class to build the search requests used in the multiSearch.
Usage example:
$this->client->multiSearch([
(new SearchQuery())->setIndexUid('books')
->setQuery('princ')
->setSort(['author:desc']),
(new SearchQuery())->setIndexUid('movies')
->setQuery('be')
->setHitsPerPage(4)
->setFilter(['duration-float > 3']),
]);
SearchQuery was not meant to be used if the regular $index->search() requests (yet).This version makes this package compatible with Meilisearch v1.0.0 :tada: Check out the changelog of Meilisearch v1.0.0 for more information on the ch
This version makes this package compatible with Meilisearch v1.0.0 :tada: Check out the changelog of Meilisearch v1.0.0 for more information on the changes.
Endpoints/Indexes date attributes $createdAt and $updatedAt are DateTime now instead of string. (#457) @brunoocasali
getCreatedAtString and getUpdatedAtString functions.canceledBy/setCanceledBy in TasksQuery (#454) @brunoocasalinext attribute and setNext from TasksQuery. (#454) @brunoocasalinext attribute and setNext from DeleteTasksQuery. (#454) @brunoocasalinext, canceledBy attributes and setNext, setCanceledBy from CancelTasksQuery. (#454) @brunoocasalideleteAllIndexes, since they don't really delete all the indexes but only the first page. (#454) @brunoocasaligetAllRawIndexes function. (#454) @brunoocasaligetAllIndexes to getIndexes. (#454) @brunoocasalisrc/Endpoints/Delegates. (#455) @brunoocasali
Meilisearch\Delegates\HandlesIndex to Meilisearch\Endpoints\Delegates\HandlesIndexMeilisearch\Delegates\HandlesSystem to Meilisearch\Endpoints\Delegates\HandlesSystemMeilisearch\Delegates\TasksQueryTrait to Meilisearch\Endpoints\Delegates\TasksQueryTraitThanks again to @brunoocasali and @norkunas! π
β οΈ This release has nothing new, and it is just a tag to mark the previous release v0.26.1 as breaking, so v0.27.0.
β οΈ This release has nothing new, and it is just a tag to mark the previous release v0.26.1 as breaking, so v0.27.0.
You should be careful because every occurrence of MeiliSearch, even in the file names were changed to Meilisearch.
More details in the comments section here and here.
Original changelog from v0.26.1:
MeiliSearch to Meilisearch (#431) @mmachatschekβ οΈ If you handle ::class directly, a change is required, as pointed out https://github.com/meilisearch/meilisearch-php/pull/431#issuecomment-1365760201
Thanks again to @brunoocasali and @mmachatschek! π
Change casing of MeiliSearch to Meilisearch (#431) @mmachatschek
MeiliSearch to Meilisearch (#431) @mmachatschekβ οΈ If you handle ::class directly, a change is required, as pointed out https://github.com/meilisearch/meilisearch-php/pull/431#issuecomment-1365760201
Thanks again to @brunoocasali and @mmachatschek! π
This version makes this package compatible with Meilisearch v0.30.0 :tada: Check out the changelog of Meilisearch v0.30.0 for more information on the
This version makes this package compatible with Meilisearch v0.30.0 :tada: Check out the changelog of Meilisearch v0.30.0 for more information on the changes.
<details> <summary>Add support to finite pagination (#418) @brunoocasali </summary>
Now you can call:
$client.search('batman', [ 'page' => 1, 'hitsPerPage' => 10 ])$client.search('batman', [ 'hitsPerPage' => 10 ])$client.search('batman', [ 'page' => 4 ])results = $client.search('batman', [ 'page' => 4 ])
And get a limited pagination with a fixed number of total hits in the results object results['totalHits'].
You can still use the offset/limit by calling $client.search('batman', [ 'limit' => 4, 'offset' => 10 ])
SearchResult#hitsCount can still retrieve the total hits value.
</details>
<details>
<summary> Add <code>cancelTasks</code> method (#420) @brunoocasali </summary>
<br>
Allow users to cancel a processing or an enqueued task by using cancelTasks(CancelTasksQuery $query)
// CancelTasksQuery methods:
setNext(int $next)
setTypes(array $types)
setStatuses(array $statuses)
setIndexUids(array $indexUids)
setUids(array $uids)
setCanceledBy(array $canceledBy)
setBeforeEnqueuedAt(\DateTime $date)
setAfterEnqueuedAt(\DateTime $date)
setBeforeStartedAt(\DateTime $date)
setAfterStartedAt(\DateTime $date)
setBeforeFinishedAt(\DateTime $date)
setAfterFinishedAt(\DateTime $date)
</details>
<details> <summary> Add <code>swapIndexes</code> method (#422) @brunoocasali </summary> <br> Add a new method in the Client client->swapIndexes(array $indexes) to swap indexes. The array should follow this structure: [['indexA', 'indexB'], ['indexC', 'indexD'], ...] </details>
<details> <summary> Add <code>deleteTasks</code> method (#423) @brunoocasali </summary> <br> Allow users to delete processed, failed, and canceled tasks.
A new method deleteTasks(DeleteTasksQuery $query)
// DeleteTasksQuery methods:
setNext(int $next)
setTypes(array $types)
setStatuses(array $statuses)
setIndexUids(array $indexUids)
setUids(array $uids)
setCanceledBy(array $canceledBy)
setBeforeEnqueuedAt(\DateTime $date)
setAfterEnqueuedAt(\DateTime $date)
setBeforeStartedAt(\DateTime $date)
setAfterStartedAt(\DateTime $date)
setBeforeFinishedAt(\DateTime $date)
setAfterFinishedAt(\DateTime $date)
</details>
tasks resource. (#419) @brunoocasali
setUids(array<int>) filter to match by Task.uid.setCanceledBy(array<int>) filter to match by Task.canceledBysetBeforeEnqueuedAt(\DateTime) filter to match by Task.beforeEnqueuedAtsetAfterEnqueuedAt(\DateTime) filter to match by Task.AfterEnqueuedAtsetBeforeStartedAt(\DateTime) filter to match by Task.beforeStartedAtsetAfterStartedAt(\DateTime) filter to match by Task.AfterStartedAtsetBeforeFinishedAt(\DateTime) filter to match by Task.beforeFinishedAtsetAfterFinishedAt(\DateTime) filter to match by Task.AfterFinishedAtsetUid(array) to setIndexUids(array) filter to match by Task.indexUidsetStatus(array) to setStatuses(array<string>) filter to match by Task.statusThanks again to @brunoocasali ! π
Added the current app documentation to README (#396) @yhoungdev
Indexes::search (#389) @LeSuisseThanks again to @94noni, @AntonioLeutsch, @Braunson, @LeSuisse, @bofalke, @brunoocasali, @dependabot, @dependabot[bot], @girijakar, @jonatanrdsantos, @karlomikus, and @yhoungdev! π
This breaking change *__may not affect you__*, but in any case, you should check your search queries if you want to keep the same behavior from v0.28.
This version makes this package compatible with Meilisearch v0.29.0 :tada: Check out the changelog of Meilisearch v0.29.0 for more information on the changes.
matchingStrategy (#376) @brunoocasaliactions field during key creation now accepts wildcards on actions. For example, indexes.* provides rights to indexes.create, indexes.get,indexes.delete, indexes.delete, and indexes.update. (#377) @brunoocasaliThis breaking change may not affect you, but in any case, you should check your search queries if you want to keep the same behavior from v0.28.
NOT filter keyword does not have an implicitly EXIST operator anymore. Check out for more information: https://github.com/meilisearch/meilisearch/issues/2486Add the ability to provide extra custom user agents (#369) @brunoocasali
Thanks again to @brunoocasali! π
Pass $options to Indexes#allRaw method (#360) @Jared87
$options to Indexes#allRaw method (#360) @Jared87faceting and pagination settings (#362) @tgalopin co-authored by @eelcol (#361)
getFaceting, updateFaceting, resetFacetinggetPagination, updatePagination, resetPaginationIndexesResults constructor (#357) @norkunasThanks again to @Jared87, @brunoocasali, @eelcol, @norkunas and @tgalopin! π
This version makes this package only compatible with Meilisearch v0.28.0 :tada: Check out the changelog of Meilisearch v0.28.0 for more information on
This version makes this package only compatible with Meilisearch v0.28.0 :tada: Check out the changelog of Meilisearch v0.28.0 for more information on the changes.
:warning: Small disclaimer: The rawSearch (and other raw* functions) are a direct connection between your PHP application and Meilisearch, you may find changes that are not present in this section.
MeiliSearch\Client->getDumpStatus method was removed. (#336) @brunoocasaliMeiliSearch\Client->getIndexes method now return a object type IndexesResults. (#341), (#345) @brunoocasaliMeiliSearch\Client->generateTenantToken now require a String apiKeyUid which is the uid of the Key instance used to sign the token. (#343) @brunoocasaliMeiliSearch\Client->createDump now responds with Task object. (#336, #337) @brunoocasaliMeiliSearch\Client->getKeys method now return a object type KeysResults. (#343), (#338) @brunoocasaliMeiliSearch\Client->updateKey now can just update a description and/or name, if there are other key/value will be silently ignored. (#343), (#338) @brunoocasaliMeiliSearch\Client->getTasks method now return a object type TasksResults. (#337), (#346) @brunoocasaliMeiliSearch\Index->getTasks method now return a object type TasksResults. (#337), (#346) @brunoocasaliMeiliSearch\Index->search facetsDistribution is now facets (#332) @curquizaMeiliSearch\Index->search matches is now showMatchesPosition (#332) @curquizaMeiliSearch\Index->getDocuments method now return a object type DocumentsResults.MeiliSearch\Index->getDocuments method now accepts a object as a parameter and offset, limit, attributesToRetrieve were not longer accepted.exhaustiveNbHits, facetsDistribution, exhaustiveFacetsCount were removed from SearchResult. (#332) @curquizaMeiliSearch\Client->getIndexes accepts a object IndexesQuery to filter and paginate the results.MeiliSearch\Client->getKeys accepts a object KeysQuery to filter and paginate the results. (#343), (#338) @brunoocasaliMeiliSearch\Client->getKey accepts both a Key#uid or Key#key value. (#343), (#338) @brunoocasaliMeiliSearch\Client->getTasks accepts a object TasksQuery to filter and paginate the results. (#337), (#346) @brunoocasaliMeiliSearch\Index->getTasks accepts a object TasksQuery to filter and paginate the results. (#337), (#346) @brunoocasaliMeiliSearch\Client->createKey can specify a uid (optionally) to create a new Key. (#343), (#338) @brunoocasaliMeiliSearch\Index->getDocument accepts a fields list to compact the remap the response. (#340), (#344) @brunoocasaliMeiliSearch\Index->getDocuments accepts a object DocumentsQuery to filter and paginate the results. (#340), (#344) @brunoocasaliKey has now a name and uid string fields. (#343), (#338) @brunoocasaliestimatedTotalHits, facetDistribution were added to SearchResult (#332) @curquiza
nbHits is still defined and will contain the same value as estimatedTotalHits.uid or apiKey will raise InvalidApiKeyException. (#343) @brunoocasaliThanks again to @brunoocasali, @curquiza! π
Improve Docker configuration in the package (#328) @brunoocasali
DateTime properties in Keys (#326) @NextraThanks again to @Nextra, @brunoocasali ! π
This version makes this package compatible with Meilisearch v0.27.0π Check out the changelog of Meilisearch v0.27.0 for more information about the cha
This version makes this package compatible with Meilisearch v0.27.0π Check out the changelog of Meilisearch v0.27.0 for more information about the changes.
index.getTypoTolerance()
index.updateTypoTolerance(params)
index.resetTypoTolerance()getKeys method (#323) @alallemaFix authorization header when no api key is provide (#305) @alallema
Thanks again to @alallema ! π
β¦v0.26.0 for more information about the β οΈ Breaking changes about the flag and dump new behavior.
This version makes this package compatible with MeiliSearch v0.25 up to v0.26.0 π Check out the changelog of MeiliSearch v0.26.0 for more information about the β οΈ Breaking changes about the flag and dump new behavior. (#292)
generateTenantToken() as a result of the addition of the multi-tenant functionality.
This method creates a JWT tenant token that will allow the user to have multi-tenant indexes and thus restrict access to documents based on the end-user making the search request. (#297) @alallemaThanks again to @TeddyBear06, @alallema, @jonatanrdsantos! π
This package version is compatible with MeiliSearch v0.25.0
This package version is compatible with MeiliSearch v0.25.0
"Meilisearch PHP (v0.21.0)" (#293) @brunoocasaliThanks again to @alallema, @brunoocasali, @mmachatschek and @shahlin! π
This package version is compatible with MeiliSearch v0.25.0
This package version is compatible with MeiliSearch v0.25.0 (#370)
Authorization header instead of X-Meili-API-Key (#265)deleteIndexIfExists method (#266) @alallemagetOrCreateIndex method (#267) @alallemacreateIndex(), updateIndex(), deleteIndex() are now asynchrone and return a task response instead of an Index.index.create and index.delete from index return a task.waitForPendingUpdate() is renamed into waitForTask and is accessible from index and from client.index.waitForTask() method call /tasks/:uidindex.getUpdateStatus is renamed index.getTaskindex.getAllUpdateStatus is renamed index.getTasksclient.waitForTask() call /tasks/:uidclient.waitForTask()client.getTasks that calls /tasksclient.getTask that calls /tasks/:uid
Notes: The only two methods that now return an Index are client.index() and client.getIndex()client.getKeys does not return an object of keys, but an array of keys. Check out keys API references.http.patch use by updateKeyclient.getKey get information about a specific API key.client.createKey create a new API key.client.deleteKey delete an API key.client.updateKey update an API key.Thanks again to @alallema, @curquiza, @jonatanrdsantos, @norkunas, and Jonatan Santos! π
This package version is compatible with MeiliSearch v0.24.0 and later, but not with v0.23.1 and older. Be sure you are using at least MeiliSearch v0.2
This package version is compatible with MeiliSearch v0.24.0 and later, but not with v0.23.1 and older. Be sure you are using at least MeiliSearch v0.24.0 or newer before doing the upgrade.
Thanks again to @Hard-Coder05, @Sukriti-sood, @alallema, @almasaeed2010, @curquiza, @edinapap, @kjellknapen, @mheap, @srichter and Kjell Knapen! π
β οΈ Since this release is breaking for a user using MeiliSearch v0.23.1 or older and only work for v0.24.0 or later, we abandoned it. If you are using
β οΈ Since this release is breaking for a user using MeiliSearch v0.23.1 or older and only work for v0.24.0 or later, we abandoned it. If you are using MeiliSearch v0.23.1 or older, please still use meilisearch-php v0.19.2 If you are using MeiliSearch v0.24.0 or newer, please still use meilisearch-php v0.20.0 Sorry for this!
This package version is compatible with MeiliSearch v0.24.0
Thanks again to @Hard-Coder05, @Sukriti-sood, @alallema, @almasaeed2010, @curquiza, @edinapap, @kjellknapen, @mheap, @srichter and Kjell Knapen! π
This package version is compatible with MeiliSearch v0.23.0
This package version is compatible with MeiliSearch v0.23.0
deleteIndexIfExists() (#226) @bofalkeaddDocumentsInBatches(array $documents, ?int $batchSize = 1000, ?string $primaryKey = null) (#229) @bofalkeupdateDocumentsInBatches(array $documents, ?int $batchSize = 1000, ?string $primaryKey = null) (#229) @bofalkegetAllRawIndexes() (#228) @kjellknapenaddDocumentsJson(string $documents, ?string $primaryKey = null)addDocumentsNdJson(string $documents, ?string $primaryKey = null)addDocumentsCsv(string $documents, ?string $primaryKey = null)Thanks again to @AbihaFatima, @alallema, @bofalke, @curquiza, @kjellknapen, @srichter, and Kjell Knapen! π
This package version is compatible with MeiliSearch v0.22.0 π
This package version is compatible with MeiliSearch v0.22.0 π
sort feature compatibility (#200) @alallema. More about sorting.
get_sortable_attributes, set_sortable_attributes, reset_sortable_attributes.sort parameter during search.Thanks again to @alallema, @aocneanu, @curquiza! π
This version makes this package compatible with MeiliSearch v0.21.0 π Check out the changelog of MeiliSearch v0.21.0
This version makes this package compatible with MeiliSearch v0.21.0 π Check out the changelog of MeiliSearch v0.21.0
WaitForPendingUpdate (#189) @alallemabuildDate into commitDate (#191)fieldsDistribution into fieldDiestribution (#191)attributesForFaceting into filterableAttributes (#190) @alallemaThanks again to @alallema, @bidoubiwa, and @norkunas! π
Exception when improper utf8 chars (#181) @codedge
Thanks again to @codedge! π
Fix ApiException constructor crashing when HTTP body is empty (#174) @Tarpsvo
Thanks again to @Tarpsvo, @bidoubiwa, @curquiza ! π
Better type checking with phpstan (#169) @codedge
Thanks again to @codedge, @bidoubiwa, @curquiza! π
Remove php 7.2 support (#166) @codedge
Thanks to @codedge, @ppshobi and @Guikingone for their involvement in this repository for this release! π
Standardize health method (#157) @alallema
Thanks again to @alallema, @curquiza and @mmachatschek! π
Add more details MeiliSearch\Exceptions\ApiException (#150) @claudiunicolaa
Thanks again to @claudiunicolaa! π
Should throw exception if httpBody empty (#146) @jwohlfert23
Thanks again to @claudiunicolaa, @jwohlfert23 ! π
Sorry for all the breaking changes, our goal is to make this package as good and easy-to-use as possible! If you have any trouble, feel free to open aβ¦
Sorry for all the breaking changes, our goal is to make this package as good and easy-to-use as possible! If you have any trouble, feel free to open an issue in the repo. We will glad to guide you through all these changes!
The search() method has now the following prototype:
public function search($query, array $searchParams = [], array $options = [])
The usage is described in the Wiki.
(#120) @Guikingone
The search() method now returns a instance of SearchResult
ex: $index->search('prince')->getHits()
Please check the README and the Wiki to know how to use it!
π‘ If you still want to get an Array as a return, use rawSearch() or set the $option parameter to ['raw' => true].
(#120) @Guikingone
$client->getIndex() is still present but does an HTTP call. This method should be only used to fetch information from the MeiliSearch instance, not to manipulate an Index object in your code base. Use index() instead. See the Getting Started to be sure using this SDK the most optimized way. (#124) @curquiza
$client->updateIndex returns an Index instance. (#124) @curquiza
$index->getPrimaryKey() does not do any HTTP call, but only returns the primaryKey attribute. Use $index->fetchPrimaryKey() if you want the same behavior as the old $index->getPrimaryKey() (#124) @curquiza
$index->show() is removed and replaced by $index->fetchInfo() (returns an instance) and $index->fetchRawInfo() (returns an array) (#124) @curquiza
$client->showIndex($uid) is removed. Use $client->getIndex($uid) (returns an instance) or $client->index($uid)->fetchRawInfo() (returns an array) instead. (#124) @curquiza
The SearchResult instance contains the new methods described in this section of the Wiki. (#120) @Guikingone and (#134) @curquiza
Add the rawSearch() method (#134) @curquiza
This method has the same behavior as the "old" search() method: it returns the raw response sent by the MeiliSearch in an Array.
Introduction of the $client->index($uid) method that replaces $client->getIndex($uid). getIndex() is still available but does HTTP call, so this should be only used to fetch information from the MeiliSearch instance. See our Getting Started to use this package the right way (#124) @curquiza
New attribute in the Index class: primaryKey accessible via the getter $index->getPrimaryKey() (#124) @curquiza
New method $index->fetchRawInfo(): returns an array of index (#124) @curquiza
New method $index->fetchInfo(): returns an Index instance (#124) @curquiza
Thanks again to @Guikingone, @ppshobi, @bidoubiwa and @curquiza ! π
One column per quarter.