Skip to content

Conversation

@dev-jonghoonpark
Copy link
Contributor

This PR addresses the issue of creating a new DocumentRowMapper instance on every call to the doSimilaritySearch() method.

DocumentRowMapper is a stateless RowMapper and does not need to be created repeatedly.
In this PR, DocumentRowMapper has been declared as a final field of the class, initialized once during instance creation, and reused across subsequent calls.

Additionally, the unused variable COLUMN_EMBEDDING, defined in the DocumentRowMapper class, has been removed.
This variable became unused as a result of #1826 and the corresponding ebd29e0.

@dev-jonghoonpark dev-jonghoonpark force-pushed the reuse-document-row-mapper-instance branch 2 times, most recently from 8847f2c to 95550e6 Compare June 17, 2025 07:47
@dev-jonghoonpark dev-jonghoonpark force-pushed the reuse-document-row-mapper-instance branch from 95550e6 to 017d8f3 Compare June 17, 2025 07:57
@ilayaperumalg ilayaperumalg self-assigned this Jun 17, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.x milestone Jun 17, 2025
spring-builds pushed a commit that referenced this pull request Jun 17, 2025
Fixes #3564

Signed-off-by: jonghoonpark <[email protected]>
(cherry picked from commit af1ce67)
@ilayaperumalg
Copy link
Member

@dev-jonghoonpark Thanks for the PR cleaning up the code.

scionaltera pushed a commit to scionaltera/spring-ai that referenced this pull request Sep 3, 2025
chedim pushed a commit to couchbaselabs/spring-ai that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants