Bug description The .withIndex method of GemFireVectorStoreConfig is not used during the creation of the vectorDB URI
Environment Java21 Spring Boot 3.3.0 SpringAI 1.0.0-M1
Steps to reproduce Create a typical config
class InitConfig {
@Bean
public GemFireVectorStoreConfig gemFireVectorStoreConfig() {
return GemFireVectorStoreConfig.builder()
.withHost("localhost")
.withPort(7071)
.withIndex("movies") <-- index that should be used
.build();
}
@Bean
public VectorStore vectorStore(GemFireVectorStoreConfig config, EmbeddingModel embeddingModel) {
var mystore = new GemFireVectorStore(config, embeddingModel);
return mystore;
}
Expected behavior Using http://localhost:7071/gemfire-vectordb/v1/indexes/movies as url. It uses http://localhost:7071/gemfire-vectordb/v1/indexes/null instead
Workaround Set index after instantiation.
class InitConfig {
@Bean
public GemFireVectorStoreConfig gemFireVectorStoreConfig() {
return GemFireVectorStoreConfig.builder()
.withHost("localhost")
.withPort(7071)
.withIndex("movies")
.build();
}
@Bean
public VectorStore vectorStore(GemFireVectorStoreConfig config, EmbeddingModel embeddingModel) {
var mystore = new GemFireVectorStore(config, embeddingModel);
mystore.setIndexName("movies"); <-- set index after instantiation instead
return mystore;
}
}
Comment From: ilayaperumalg
Hi @spuchol81, I believe this issue is already fixed via https://github.com/spring-projects/spring-ai/commit/067a33dbe2b3fa24a4016c86464b80ef6cfbae1b. Could you check the latest milestone and confirm if you still see the issue? Thanks!
Comment From: markpollack
Looks to be fixed, please reopen @spuchol81 if something looks wrong.