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

Add language settings & search parameter #1693

Conversation

flevi29
Copy link
Collaborator

@flevi29 flevi29 commented Aug 20, 2024

Pull Request

Related issue

Fixes #1684

What does this PR do?

  • Adds language settings & search parameter feature, test

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@flevi29 flevi29 linked an issue Aug 20, 2024 that may be closed by this pull request
4 tasks
@curquiza curquiza requested review from mdubus and removed request for brunoocasali August 20, 2024 13:17
@curquiza curquiza changed the title feat(v1.10): Language settings & search parameter Add language settings & search parameter Aug 20, 2024
@curquiza curquiza added the enhancement New feature or request label Aug 20, 2024
Copy link
Member

@mdubus mdubus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @flevi29 👋

I've added a few comments below, don't hesitate if you need any help or guidande with this :)

We're also missing the following part:
Create new methods getLocalizedAttributes, updateLocalizedAttributes and resetLocalizedAttributes corresponding to the sub settings GET/PUT/DELETE routes

Do you think you could add them in this PR too?

Thanks a lot for your time and your work here, it's really appreciated 🙏 🙌

src/types/types.ts Outdated Show resolved Hide resolved
src/types/types.ts Outdated Show resolved Hide resolved
tests/search.test.ts Outdated Show resolved Hide resolved
tests/search.test.ts Outdated Show resolved Hide resolved
tests/search.test.ts Outdated Show resolved Hide resolved
src/types/types.ts Outdated Show resolved Hide resolved
src/types/types.ts Outdated Show resolved Hide resolved
src/types/types.ts Show resolved Hide resolved
@mdubus
Copy link
Member

mdubus commented Aug 21, 2024

Hey @flevi29 👋

Thanks for the changes and your patience 🙏
Could you also update the snapshots? I see that there are some differences related to this PR.
That would be amazing, thanks a lot 🙏 🚀

tests/search.test.ts Outdated Show resolved Hide resolved
@flevi29
Copy link
Collaborator Author

flevi29 commented Aug 21, 2024

I'm a little confused about snapshots. Trying to fix.

Copy link
Member

@mdubus mdubus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, and the CI is all green now 🤩

Thanks A LOT for your time and your patience, it's really helpful and appreciated that you took time to work on this 🙏

Invoking @curquiza in case she want to double-check, but it's now all good on my side 🙌

@mdubus mdubus requested review from curquiza and mdubus August 21, 2024 07:54
Copy link
Member

@mdubus mdubus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got the green light to merge, so doing it right now.

Great job 👏 🤩

@mdubus mdubus merged commit a2d46d5 into meilisearch:bump-meilisearch-v1.10.0 Aug 21, 2024
6 checks passed
@flevi29 flevi29 deleted the feature-lang-settings-search-params branch August 21, 2024 09:32
meili-bors bot added a commit that referenced this pull request Aug 26, 2024
1695: Update version for the next release (v0.42.0) r=brunoocasali a=meili-bot

_This PR is auto-generated._

The automated script updates the version of meilisearch-js to a new version: "v0.42.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.

## ⚠️ Breaking changes

* Improve errors (#1656) `@/flevi29`
More details [here](#1656 (comment))
* 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` 

```js
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` 
```js
index.updateDocumentsByFunction({
    context: { ctx: 'Harry' },
    filter: 'id = 4',
    function: 'doc.comment = `Yer a wizard, ${context.ctx}!`',
  })
)
```

* Add language settings (#1693) `@/flevi29` 
```js
client.index('INDEX_NAME').updateLocalizedAttributes([
    { attributePatterns: ['jpn'], locales: ['*_ja'] },
];)
```

* Add `locale` search parameter (#1693) `@/flevi29` 
```js
client.index('INDEX_NAME').search('進撃の巨人', { locales: ['jpn'] })
```

## ⚙️ Maintenance/misc

* Add JS hosted documentation (#1678) `@/amit-ksh`



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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.10.0] Language settings & search parameter
3 participants