Releases: meilisearch/meilisearch-js
v0.51.0 π¦
This version introduces features released in Meilisearch v1.15.0.
β οΈ Breaking changes
π Enhancements
- Add experimental features methods (#1928) @flevi29
- Add
disableOnNumbers
to typo tolerance settings (#1951) @Strift - export type GranularFilterableAttribute (#1965) @nicolasvienot
βοΈ Maintenance/misc
- Remove _md code samples for Mintlify migration (#1924) @curquiza
- Trace Node.js warnings in CI tests (#1946) @flevi29
- Refactor tasks, batches & tests (#1952) @flevi29
Thanks again to @Strift, @brunoocasali, @curquiza, @flevi29, @nicolasvienot! π
v0.50.0 π¦«
This release adds new features related to Meilisearch 1.14.
β οΈ Breaking changes
Refactored HTTP client (#1741) @flevi29
Important
The Meilisearch class now accepts a requestInit
parameter instead of requestConfig
. Parameters of requestInit
are the same, except it no longer accepts signal
.
const client = new Meilisearch({
host: 'https://edge.meilisearch.com',
apiKey: 'your meilisearch API key',
// `requestConfig` is removed, use `requestInit` instead
requestInit: {
headers: {
"A-Http-Header": "The Value",
},
},
});
Refactored tasks and batches usage (#1825) @flevi29
Important
TaskClient
and BatchClient
are no longer exported
Migration guide: tasks promises now have a "waitTask" method
// Replace this
const task = client.createIndex("test");
await client.waitForTask(task.taskUid);
// By this
await client.createIndex("test").waitTask();
Migration guide: access TaskClient
via the tasks
property
// Replace this
client.getTask(1)
client.tasks.getTask(1)
// by this
client.getTasks()
client.tasks.getTasks()
Note
TaskClient
is also accessible through the Index class, e.g., client.index('myindex').tasks
Migration guide: access BatchClient
via the batches
property
// Replace this
client.getBatch(1)
client.batches.getBatch(1)
// By this
client.getBatches()
client.batches.getBatches()
Note
BatchClient
is also accessible through the Index class, e.g., client.index('myindex').batches
Updated exported types
Important
- Removed
Batch
,EnqueuedTask
, andTask
classes. The types are still exported! - Date properties on
Batch
,EnqueuedTask
, andTask
are now string. They can be converted to a date using e.g.new Date(string)
- Renamed
MeiliSearchTimeOutError
toMeiliSearchRequestTimeOutError
- Renamed
TasksQuery
toTasksOrBatchesQuery
π Enhancements
- Adds new features related to Meilisearch 1.14 (#1914) @Strift
- Add embedding metrics (#1888) @consoleLogIt
- Add documents database metrics to indexStats type (#1889) @consoleLogIt
- Add usedDatabaseSize field to stats type (#1890) @consoleLogIt
- Implement the experimental feature for remote federated search requests. (#1891) @consoleLogIt
- Improve
TaskClient
,BatchClient
and associated types (#1825) @flevi29
π Bug Fixes
- Refactor
HttpRequests
(#1741) @flevi29 - Remove custom TypeScript ESLint rules and adapt code, fix
HttpRequests
issue where timeout errors sometimes weren't properly thrown (#1749) @Barabasbalazs - Improve
TaskClient
,BatchClient
and associated types (#1825) @flevi29
βοΈ Maintenance/misc
- Update Vitest, ESLint and plugins, adapt code (#1900) @flevi29
- Remove hint about bad Meilisearch version (#1848) @flevi29
- Update Vite and Vitest (#1847) @flevi29
- Improve
HttpRequests
(#1741) @flevi29 - Add
husky
and configurelint-staged
(#1861) @flevi29 - Fix
package.json
"repository"
field (#1865) @flevi29 - Remove BORS, enable merge queues in actions (#1896) @flevi29
- Remove custom TypeScript ESLint rules and adapt code, fix
HttpRequests
issue where timeout errors sometimes weren't properly thrown (#1749) @Barabasbalazs - Improve
TaskClient
,BatchClient
and associated types (#1825) @flevi29
Thanks again to @Barabasbalazs, @Strift, @consoleLogIt, and @flevi29! π
v0.49.0 ποΈ
This version introduces features released on Meilisearch v1.13.0 π
β¨ New
- AI-powered search is now stable @Strift
π Bug Fixes
βοΈ Maintenance/misc
v0.48.2 π»
v0.48.1 π»
v0.48.0 π»
β οΈ Breaking changes
Migration
Replace:
await generateTenantToken("74c9c733-3368-4738-bbe5-1d18a5fecb37", [], {
apiKey: "0a6e572506c52ab0bd6195921575d23092b7f0c284ab4ac86d12346c33057f99",
expiresAt: new Date("December 17, 4000 03:24:00"),
});
By:
await generateTenantToken({
apiKey: "0a6e572506c52ab0bd6195921575d23092b7f0c284ab4ac86d12346c33057f99",
apiKeyUid: "74c9c733-3368-4738-bbe5-1d18a5fecb37",
searches: [],
expiresAt: new Date("December 17, 4000 03:24:00"),
});
βοΈ Maintenance
- Switch from rollup to vite, from commonjs to ecmascript modules (#1740) @flevi29
- Remove mention of support of Node 14 and 16 (#1805) @Strift
- Fix and improve
eslint
config, other minor changes (#1795) @flevi29 - Fix swapped args in localized-attributes sample (#1818) @ellnix
- [Playground] Replace Parcel by Vite (#1821) @Strift
- Switch from rollup to vite, from commonjs to ecmascript modules (#1740) @flevi29
- Remove
nodemon
dependency (#1822) @flevi29
v0.47.0 π»
This version introduces features released on Meilisearch v1.12.0 π
Check out the Meilisearch v1.12.0 changelog for more information.
π Enhancements
- Addition: #1775
Introducing new methods to get one or several batches, respectively getBatch()
and getBatches()
.
// fetch one batch using batch UID
const batch = await client.getBatch(123)
// fetch all batches
const batches = await client.getBatches()
- Addition: #1774
The getTasks()
methods now accept a reverse
parameter to retrieve tasks in reverse chronological order.
const tasks = await client.getTasks({ reverse: true });
- Addition: #1790
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
await client.index('myIndex').updatePrefixSearch('disabled')
// reset prefix search settings
await client.index('myIndex').resetPrefixSearch()
// disable facet search
await client.index('myIndex').updateFacetSearch(false)
// reset facet search settings
await client.index('myIndex').resetFacetSearch()
- Update: #1773
The _matchesPosition
array now contains an indices
array the text was matched in an array.
When searching for fantasy
in a document that has a searchable genre
field with the value genre: ["fantasy", "adventure"]
, the matches position will be as follow:
{
genre: [{ start: 0, length: 7, indices: [0] }]
}
Which means:
- There was a single match in the
genre
array (array length == 1) - The match started as position
0
(the first character, "f") - The match has a length of
7
(the entire "fantasy" word) - The match was in the first item of the array (indices == [0])
βοΈ Maintenance/misc
- Update CONTRIBUTING.md with minimal Node version (#1788)
Thanks again to @Barabasbalazs, @mdubus, @irevoire, @curquiza, and @Strift. π
v0.46.0 π»
β οΈ Breaking changes
Old:
import { MeiliSearch } from "meilisearch";
const client = new MeiliSearch({ host: "http://127.0.0.1:7700", apiKey: "masterKey" });
const token = await client.generateTenantToken("e489fe16-3381-431b-bee3-00430192915d");
// ...
New:
import { generateTenantToken } from "meilisearch/token";
const token = await generateTenantToken("e489fe16-3381-431b-bee3-00430192915d", [], { apiKey: "masterKey" });
// ...
π Bug Fixes
- fix: pull the latest in the CI instead of forcing the v1.11 (#1751) @mdubus
- Updated Type definition for multiSearch return types for better TS support (#1776) @Barabasbalazs
π Security
- build(deps): bump @eslint/plugin-kit from 0.2.0 to 0.2.3 (#1763)
- build(deps): bump cross-spawn from 6.0.5 to 6.0.6 in /playgrounds/javascript (#1766)
Thanks again to @Barabasbalazs, @flevi29, @mdubus! π
v0.45.0 π»
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.
β οΈ Breaking changes (experimental feature only)
- Adapt the library to the new usage of the Hybrid search and
embedder
settings in Meilisearch v1.11 (#1715) @mdubus
π Enhancements
βοΈ Maintenance/misc
- Remove eslint vitest exceptions (#1748) @Barabasbalazs
Thanks again to @Barabasbalazs, @brunoocasali, @curquiza, @mdubus! π