-
Notifications
You must be signed in to change notification settings - Fork 123
Add AI-powered search features #827
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
Open
Strift
wants to merge
29
commits into
main
Choose a base branch
from
feat/add-ai-powered-search
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cb480aa
to
c8647ec
Compare
5467c2f
to
4306308
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds AI-powered search capabilities to Meilisearch by introducing new embedders settings, hybrid search parameters, and vector search support.
- Updated the settings API to include embedders configuration.
- Enhanced search and similar document endpoints with hybrid and vector search features.
- Added and updated tests for embedders, hybrid search, and vector search.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/test/java/com/meilisearch/sdk/SimilarDocumentRequestTest.java | Added tests for SimilarDocumentRequest with various parameters including embedder and vector retrieval. |
src/test/java/com/meilisearch/sdk/SearchRequestTest.java | Introduced hybrid search and retrieveVectors tests. |
src/test/java/com/meilisearch/integration/TasksTest.java | Improved assertions for tasks retrieval. |
src/test/java/com/meilisearch/integration/SettingsTest.java | Added tests verifying get, update, and reset embedders settings. |
src/test/java/com/meilisearch/integration/SearchTest.java | Added integration tests for vector search and retrieveVectors feature. |
src/main/java/com/meilisearch/sdk/model/Settings.java | Updated embedders type from Embedders to Embedder. |
src/main/java/com/meilisearch/sdk/model/SearchResult.java | Added _vectors field to support vector search responses. |
src/main/java/com/meilisearch/sdk/model/Hybrid.java | Introduced a new Hybrid class for hybrid search configuration. |
src/main/java/com/meilisearch/sdk/model/Embedder.java | New file defining Embedder configurations with embedders related fields. |
src/main/java/com/meilisearch/sdk/SimilarDocumentRequest.java | Refactored JSON conversion using null-safe putOpt. |
src/main/java/com/meilisearch/sdk/SettingsHandler.java | Added methods to get, update, and reset embedders settings. |
src/main/java/com/meilisearch/sdk/SearchRequest.java | Extended to support hybrid search, vector search, and retrieveVectors. |
src/main/java/com/meilisearch/sdk/IndexSearchRequest.java | Enhanced to include retrieveVectors parameter in search requests. |
src/main/java/com/meilisearch/sdk/Index.java | Added wrapper methods for embedders settings management. |
.github/workflows/tests.yml | Minor update to enable more verbose Gradle output during tests. |
Co-authored-by: Copilot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Related issue
Fixes #817
What does this PR do?
Update settings to handle embedders
Docs: https://www.meilisearch.com/docs/reference/api/settings#embedders
Update the methods
getEmbedders
,updateEmbedders
,resetEmbedders
. Also, the methodupdateSettings
should be able to accept the newembedders
parameter.Here is the list of fields in the
embedders
object:source
sub field is available and accepts:ollama
,rest
,openAI
,huggingFace
anduserProvided
apiKey
sub field is available (string) - optional because not compatible with all sources. Only foropenAi
,ollama
,rest
.model
sub field is available (string) - optional because not compatible with all sources. Only forollama
,openAI
,huggingFace
documentTemplate
sub field is available (string) - optionaldimensions
- optional because not compatible with all sources. Only foropenAi
,huggingFace
,ollama
, andrest
distribution
- optionalrequest
- mandatory only if usingrest
embedderresponse
- mandatory only if usingrest
embedderdocumentTemplateMaxBytes
- optionalrevision
- optional, only forhuggingFace
headers
- optional, only forrest
binaryQuantized
- optionalUpdate search to handle vector search and hybrid search
Docs: https://www.meilisearch.com/docs/reference/api/search
Update the
search
method::hybrid
search parameter, with sub fieldssemanticRatio
andembedder
.embedder
is mandatory ifhybrid
is set.vector
parameter is availableretrieveVectors
parameter availablesemanticHitCount
in search responseAccept_semanticScore
in the search response (optional)vector
should be returned in the search response, but optional (because depends on search parameters)_vectors
present in the search response, but optionalAdd similar documents endpoint
Docs: https://www.meilisearch.com/docs/reference/api/similar
searchSimilarDocuments
associated with thePOST /indexes/:uid/similar
. Do NOT implement withGET
.PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!