Skip to content

Releases: meilisearch/meilisearch-js

v0.47.0 🌻

23 Dec 11:42
eb60101
Compare
Choose a tag to compare

This version introduces features released on Meilisearch v1.12.0 🎉

Check out the Meilisearch v1.12.0 changelog for more information.

🚀 Enhancements

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()

The getTasks() methods now accept a reverse parameter to retrieve tasks in reverse chronological order.

const tasks = await client.getTasks({ reverse: 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
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()

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 🌻

02 Dec 09:42
8167a99
Compare
Choose a tag to compare

⚠️ Breaking changes

  • Separate token specific code into its own export (#1739) @flevi29

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 🌻

28 Oct 13:58
e224f5c
Compare
Choose a tag to compare

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)

🚀 Enhancements

⚙️ Maintenance/misc

Thanks again to @Barabasbalazs, @brunoocasali, @curquiza, @mdubus! 🎉

v0.44.1 🌻

04 Oct 10:25
bc97969
Compare
Choose a tag to compare

🐛 Bug Fixes

Thanks again to @flevi29 and @knd775 for the report! 🎉

v0.44.0 🌻

03 Oct 12:42
6990387
Compare
Choose a tag to compare

⚠️ Breaking changes

  • Add package.json "exports" field (#1611) @flevi29
    Could be a breaking change for anyone who was importing anything other than what we have in the "exports" package.json field.

⚙️ Maintenance/misc

Thanks again to @flevi29, @meili-bors[bot] ! 🎉

v0.43.0 🌻

02 Oct 14:45
3b7e7e4
Compare
Choose a tag to compare

⚠️ Breaking changes

🔒 Security

  • build(deps): bump elliptic from 6.5.4 to 6.5.7 in /playgrounds/javascript (#1699)
  • build(deps): bump serve-static from 1.14.1 to 1.16.2 in /playgrounds/javascript (#1700)

⚙️ Maintenance/misc

Thanks again to @brunoocasali, @curquiza, @flevi29, @meili-bors[bot] ! 🎉

v0.42.0 🌻

26 Aug 13:45
bb4f53e
Compare
Choose a tag to compare

This version introduces features released on Meilisearch v1.10.0 🎉
Check out the changelog of Meilisearch v1.10.0 for more information on the changes.

⚠️ Breaking changes

  • Improve errors (#1656) @/flevi29
    More details here
  • Changes related to Hybrid search (experimental) for the REST embedder (#1692) @mdubus
    • Removed parameters: query, inputField, inputType, pathToEmbeddings and embeddingObject.
    • Replaced by request and response
    • New parameter: headers

🚀 Enhancements

  • Hybrid search improvements (#1692) @mdubus

    • Add url parameter to the OpenAI embedder
    • dimensions is now available as an optional parameter for ollama embedders.
  • Add federated search parameters (#1689) @flevi29

client.multiSearch({
    federation: {},
    queries: [
      {
        indexUid: 'movies',
        q: 'batman',
        limit: 5,
      },
      {
        indexUid: 'comics',
        q: 'batman',
        limit: 5,
      },
    ]
  })
  • Add capabilities to update documents by function (#1691) @flevi29
index.updateDocumentsByFunction({
    context: { ctx: 'Harry' },
    filter: 'id = 4',
    function: 'doc.comment = `Yer a wizard, ${context.ctx}!`',
  })
)
  • Add language settings (#1693) @/flevi29
client.index('INDEX_NAME').updateLocalizedAttributes([
    { attributePatterns: ['jpn'], locales: ['*_ja'] },
];)
client.index('INDEX_NAME').search('進撃の巨人', { locales: ['jpn'] })

⚙️ Maintenance/misc

Thanks again to @amit-ksh, @brunoocasali, @curquiza, @flevi29, @mdubus, @meili-bors[bot] ! 🎉

v0.41.0 🌻

01 Jul 16:11
01f51b4
Compare
Choose a tag to compare

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.

🚀 Enhancements

client.index('movies').search('interstellar', { matchingStrategy: MatchingStrategies.FREQUENCY });
client.index('movies').search('badman', { rankingScoreThreshold: 0.2 });
client.index('movies').searchGet('badman', { rankingScoreThreshold: 0.2 });
client.index('movies').search('', { distinct: 'genre' });
client.index('movies').searchSimilarDocuments({ id: 'target-document-id' });
client.index('movies').getDocuments({ retrieveVectors: true });

🔒 Security

  • build(deps): bump ws from 5.2.3 to 5.2.4 in /playgrounds/javascript (#1672)

⚙️ Maintenance/misc

Thanks again to @brunoocasali, @curquiza, @flevi29, @mdubus, and @the-sinner! 🎉

v0.40.0 🌻

15 May 11:19
cd61a8c
Compare
Choose a tag to compare

💥 Breaking Changes

  • Fix the issue introduced in the v0.39 that affected vite apps #1652 @brunoocasali
  • Now to use the generateTenantToken you should use it with await:
    before:
    const token = client.generateTenantToken(apiKeyUid, searchRules, {
        apiKey: apiKey,
        expiresAt: expiresAt,
      })
    after:
    const token = await client.generateTenantToken(apiKeyUid, searchRules, {
        apiKey: apiKey,
        expiresAt: expiresAt,
      })

⚙️ Maintenance/misc

Thanks again to @brunoocasali, @mdubus! 🎉

v0.39.0 🌻

06 May 13:20
4475864
Compare
Choose a tag to compare

🚀 Enhancements

  • feat: hybrid search improvements for v1.8.x (#1647) @mdubus
  • Add null to Embedder type (#1646) @amit-ksh
  • Add searchCutoffMs index setting (#1643, #1645) @amit-ksh
    client.index('movies').getSearchCutoffMs()
    client.index('movies').updateSearchCutoffMs(150)
    client.index('movies').resetSearchCutoffMs()

⚠️ if you're using vite to build your front-end app, you must add this to your configuration (see more info here #1649)

export default defineConfig({
  plugins: [vue()],
  build: {
    rollupOptions: {
      external: ['crypto'], // this is the important part
    },
  },
})

Otherwise, you'll face errors like Module "crypto" has been externalized for browser compatibility.

⚙️ Maintenance/misc

  • Update ESLint, Prettier, TypeScript and fix/improve their configuration files (#1616) @flevi29
  • Fix code style after configuration changes (#1638) @brunoocasali

Thanks again to @amit-ksh, @brunoocasali, @curquiza, @flevi29, @mdubus! 🎉