Document * Introduced “score” attribute in Document API. It stores the similarity score. * Consolidate “distance” metadata for Documents. It stores the distance measurement. * Adopted prefix-less naming convention in Document.Builder and deprecated old methods. * Deprecated the many overloaded Document constructors in favour of Document.Builder.
Vector Stores * Every vector store implementation now configures a “score” attribute with the similarity score of the Document embedding. It also includes the “distance” metadata with the distance measurement. * Fixed error in Elasticsearch where distance and similarity were mixed up. * Added missing integration tests for SimpleVectorStore. * The Azure Vector Store and HanaDB Vector Store do not include those measurements because the product documentation do not include information about how the similarity score is returned, and without access to the cloud products I could not verify that via debugging. * Improved tests to actually assert the result of the similarity search based on the returned score.
Comment From: ThomasVitale
PR updated after https://github.com/spring-projects/spring-ai/pull/1822 was merged
Comment From: markpollack
I removed usage of deprecated methods and some other minor cleanup. Sorry it took a while. We need another pass at improving Document as you noted in #1838
merged in fe58fd30ebd649985d459200fe23469b1077798e
Comment From: iAMSagar44
@ThomasVitale - Regarding the scores returned by Azure AI Search, please have a read of my latest comment here - 517.
Depending on the type of search you carry out in Azure AI Search, the score might be different and its usage will be different.