- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2k
 
GH-513 fix: Support custom field names for Milvus VectorStore collection #1616
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
Conversation
…orStore collection - Add configuration properties to override the default field names for doc_id, content, metadata and embedding - Add support to allow auto-id when enabled - Add tests Resolves spring-projects#513
| */ | ||
| @Testcontainers | ||
| @EnabledIfEnvironmentVariable(named = "OPENAI_API_KEY", matches = ".+") | ||
| public class MilvusVectorStoreCustomFieldNamesIT { | 
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.
We can drop the public modifier and keep it at default access.
| 
               | 
          ||
| @ParameterizedTest(name = "{0} : {displayName} ") | ||
| @ValueSource(strings = { "COSINE" }) | ||
| public void searchWithCustomFieldNames(String metricType) { | 
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.
No need for public.
| 
               | 
          ||
| @ParameterizedTest(name = "{0} : {displayName} ") | ||
| @ValueSource(strings = { "COSINE" }) | ||
| public void searchWithoutMetadataFieldOverride(String metricType) { | 
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.
No need for public.
| 
               | 
          ||
| @ParameterizedTest(name = "{0} : {displayName} ") | ||
| @ValueSource(strings = { "COSINE" }) | ||
| public void searchWithAutoIdEnabled(String metricType) { | 
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.
no need for public.
| 
               | 
          ||
| @SpringBootConfiguration | ||
| @EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class }) | ||
| public static class TestApplication { | 
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.
no need for public.
| private String metadataFieldName; | ||
| 
               | 
          ||
| @Bean | ||
| public VectorStore vectorStore(MilvusServiceClient milvusClient, EmbeddingModel embeddingModel) { | 
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.
no need for public.
| } | ||
| 
               | 
          ||
| @Bean | ||
| public MilvusServiceClient milvusClient() { | 
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.
no need for public.
| } | ||
| 
               | 
          ||
| @Bean | ||
| public EmbeddingModel embeddingModel() { | 
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.
no need for public.
| } | ||
| 
               | 
          ||
| @Test | ||
| public void searchWithCustomFields() { | 
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.
Author tag needs to be updated for this class.
…orStore collection (spring-projects#1616) * spring-projectsGH-513 fix: Support custom field names for Milvus VectorStore collection - Add configuration properties to override the default field names for doc_id, content, metadata and embedding - Add support to allow auto-id when enabled - Add tests Resolves spring-projects#513 * Fix package modifier Signed-off-by: leijendary <[email protected]>
…orStore collection (spring-projects#1616) * spring-projectsGH-513 fix: Support custom field names for Milvus VectorStore collection - Add configuration properties to override the default field names for doc_id, content, metadata and embedding - Add support to allow auto-id when enabled - Add tests Resolves spring-projects#513 * Fix package modifier Signed-off-by: leijendary <[email protected]>
Resolves #513