Skip to content

Conversation

@dev-jonghoonpark
Copy link
Contributor

@dev-jonghoonpark dev-jonghoonpark commented Jun 16, 2025

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

  • Added a new property: spring.ai.vectorstore.weaviate.content-field-name

@sobychacko sobychacko self-assigned this Jun 17, 2025
@dev-jonghoonpark dev-jonghoonpark force-pushed the GH-3535-make-content-field-configurable branch from 47e5bca to fa25f52 Compare June 17, 2025 02:49
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())
Copy link

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.

Suggested change
.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.

Copy link
Contributor Author

@dev-jonghoonpark dev-jonghoonpark Jun 17, 2025

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.

  1. What exactly does this class refer to in your comment?
  2. 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.

Copy link

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The configurable METADATA_FIELD_PREFIX implemented in #3585 @jPhy

@sobychacko
Copy link
Contributor

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants