- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2k
 
          Make the content field configurable in Weaviate vector store properties
          #3555
        
          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
  
    Make the content field configurable in Weaviate vector store properties
  
  #3555
              Conversation
        
          
                ...org/springframework/ai/vectorstore/weaviate/autoconfigure/WeaviateVectorStoreProperties.java
          
            Show resolved
            Hide resolved
        
              
          
                ...org/springframework/ai/vectorstore/weaviate/autoconfigure/WeaviateVectorStoreProperties.java
          
            Show resolved
            Hide resolved
        
              
          
                ...ate-store/src/main/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStore.java
          
            Show resolved
            Hide resolved
        
              
          
                ...ate-store/src/main/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStore.java
          
            Show resolved
            Hide resolved
        
              
          
                ...re/src/main/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStoreOptions.java
          
            Show resolved
            Hide resolved
        
              
          
                ...ate-store/src/main/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStore.java
          
            Show resolved
            Hide resolved
        
      Signed-off-by: jonghoonpark <[email protected]>
47e5bca    to
    fa25f52      
    Compare
  
    | searchWeaviateFieldList.add(Field.builder().name(this.options.getContentFieldName()).build()); | ||
| searchWeaviateFieldList.add(Field.builder().name(METADATA_FIELD_NAME).build()); | ||
| searchWeaviateFieldList.addAll(this.filterMetadataFields.stream() | ||
| .map(mf -> Field.builder().name(METADATA_FIELD_PREFIX + mf.name()).build()) | 
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.
To be able to use this class, we would need to define metadata without the "meta_"-prefix here.
Our Database has metadata, but they don't have a special prefix.
| .map(mf -> Field.builder().name(METADATA_FIELD_PREFIX + mf.name()).build()) | |
| .map(mf -> Field.builder().name(mf.name()).build()) | 
Having METADATA_FIELD_PREFIX customizable just like CONTENT_FIELD_NAME would also be fine for us, we could set it to an empty string.
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.
@jPhy
Thank you for sharing your thoughts.
- What exactly does 
this classrefer to in your comment? - It seems that your comment is suggesting additional functionality. Is that correct? If so, perhaps it might be more appropriate to address this in a separate PR.
 
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.
this class refers to WeaviateVectorStore.
I saw it as answering Question 1  slightly differently compared to @sp-yang: We would need, in addition to CONTENT_FIELD_NAME, also METADATA_FIELD_PREFIX to be configurable.
I can also open a separate issue if you think that would be better.
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.
Depending on the maintainer’s decision, the structure might change slightly,
so I think it’s better to proceed after this PR is completed.
After that, I will also try to work on your suggestion.
So, it’s not necessary to open an issue,
but feel free to open one if you think it's needed.
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.
| 
           @dev-jonghoonpark Merged the PR via 24de06e. I didn't backport the PR due to the deprecation and the new API in the builder. Thanks for the PR!  | 
    
related issue: #3535
Currently, the content field in the Weaviate vector store cannot be modified.
This PR has been improved to make it configurable, and relevant tests have been added.
changes
spring.ai.vectorstore.weaviate.content-field-name