-
Notifications
You must be signed in to change notification settings - Fork 2k
Make the meta field prefix configurable in Weaviate vector store properties
#3585
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 meta field prefix configurable in Weaviate vector store properties
#3585
Conversation
b02e7e5 to
063af91
Compare
| public String getMetaFieldPrefix() { | ||
| return metaFieldPrefix; | ||
| } | ||
|
|
||
| public void setMetaFieldPrefix(String metaFieldPrefix) { | ||
| Assert.notNull(metaFieldPrefix, "metaFieldPrefix can be empty but not null"); | ||
| this.metaFieldPrefix = metaFieldPrefix; | ||
| } |
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.
These methods are newly created, but since the class Javadoc already includes the @since 1.1.0 tag, the @since tag was not added to the methods.
063af91 to
af2e107
Compare
|
fixed conflict with #3582 |
...main/java/org/springframework/ai/vectorstore/weaviate/WeaviateFilterExpressionConverter.java
Outdated
Show resolved
Hide resolved
|
|
||
| @ParameterizedTest(name = "{0} : {displayName} ") | ||
| @ValueSource(strings = { "custom_", "" }) | ||
| public void addAndSearchWithCustomMetaFieldPrefix(String metaFieldPrefix) { |
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.
Could you help me understand where the configurable metadata prefix is used in this test and then assert that it takes effect?
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.
In this test, the following behavior is expected:
- Verify that data is stored and retrieved correctly using a
customVectorStorewith a modified prefix. - Confirm that data cannot be retrieved using a
vectorStorewith the default prefix (as the prefixes differ, retrieval should fail). - Remove the data from the
customVectorStoreto ensure it does not affect subsequent tests.
If there’s a better approach, I’m open to suggestions for improvement. 👍
|
@dev-jonghoonpark Some minor comments. In your description above, I see a note that the white spaces are also allowed with the metadata prefix. I don't see that in the code. Could you point me to where that is addressed? Thanks! |
|
In To verify that this works as expected, a test case with an empty metaFieldPrefix ( Is there anything I might have missed? |
…erties Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
af2e107 to
3d0455d
Compare
…erties (spring-projects#3585) Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
…erties (spring-projects#3585) Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
related issue: #3535
Currently, the
meta field prefixin 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.meta-field-prefix