BREAKING CHANGE - Change vector store initialize-schema to false

* Change default schema initialization of vector stores from `true` to `false.`
  Users need to explicitly opt-in for schema initialization by setting the
  `initialize-schema` property on the corresponding vector store.
* Update integration tests
* Update docs

Fixes #907
This commit is contained in:
Soby Chacko
2024-06-21 12:37:36 -04:00
committed by Mark Pollack
parent edf943ec97
commit 50d34b8a48
57 changed files with 329 additions and 167 deletions

View File

@@ -40,7 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringJUnitConfig
@Testcontainers
@TestPropertySource(properties = "spring.ai.vectorstore.chroma.store.collectionName=TestCollection")
@TestPropertySource(properties = { "spring.ai.vectorstore.chroma.store.collectionName=TestCollection",
"spring.ai.vectorstore.chroma.initialize-schema=true" })
class ChromaContainerConnectionDetailsFactoryTest {
@Container

View File

@@ -40,7 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringJUnitConfig
@Testcontainers
@TestPropertySource(properties = "spring.ai.vectorstore.chroma.store.collectionName=TestCollection")
@TestPropertySource(properties = { "spring.ai.vectorstore.chroma.store.collectionName=TestCollection",
"spring.ai.vectorstore.chroma.initialize-schema=true" })
class ChromaWithToken2ContainerConnectionDetailsFactoryTest {
@Container

View File

@@ -40,7 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringJUnitConfig
@Testcontainers
@TestPropertySource(properties = "spring.ai.vectorstore.chroma.store.collectionName=TestCollection")
@TestPropertySource(properties = { "spring.ai.vectorstore.chroma.store.collectionName=TestCollection",
"spring.ai.vectorstore.chroma.initialize-schema=true" })
class ChromaWithTokenContainerConnectionDetailsFactoryTest {
@Container

View File

@@ -45,7 +45,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@Testcontainers
@TestPropertySource(properties = { "spring.ai.vectorstore.milvus.metricType=COSINE",
"spring.ai.vectorstore.milvus.indexType=IVF_FLAT", "spring.ai.vectorstore.milvus.embeddingDimension=384",
"spring.ai.vectorstore.milvus.collectionName=myTestCollection" })
"spring.ai.vectorstore.milvus.collectionName=myTestCollection",
"spring.ai.vectorstore.milvus.initialize-schema=true" })
class MilvusContainerConnectionDetailsFactoryTest {
@Container

View File

@@ -44,6 +44,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
@SpringBootTest(properties = {
"spring.ai.vectorstore.opensearch.index-name=" + OpenSearchContainerConnectionDetailsFactoryTest.DOCUMENT_INDEX,
"spring.ai.vectorstore.opensearch.initialize-schema=true",
"spring.ai.vectorstore.opensearch.mapping-json="
+ OpenSearchContainerConnectionDetailsFactoryTest.MAPPING_JSON })
@Testcontainers

View File

@@ -43,7 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringJUnitConfig
@Testcontainers
@TestPropertySource(properties = "spring.ai.vectorstore.qdrant.collectionName=test_collection")
@TestPropertySource(properties = { "spring.ai.vectorstore.qdrant.collectionName=test_collection",
"spring.ai.vectorstore.qdrant.initialize-schema=true" })
public class QdrantContainerConnectionDetailsFactoryTest {
@Container

View File

@@ -43,7 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringJUnitConfig
@Testcontainers
@TestPropertySource(properties = "spring.ai.vectorstore.qdrant.collectionName=test_collection")
@TestPropertySource(properties = { "spring.ai.vectorstore.qdrant.collectionName=test_collection",
"spring.ai.vectorstore.qdrant.initialize-schema=true" })
public class QdrantContainerWithApiKeyConnectionDetailsFactoryTest {
@Container

View File

@@ -29,6 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringJUnitConfig
@TestPropertySource(properties = { "spring.ai.vectorstore.typesense.embeddingDimension=384",
"spring.ai.vectorstore.typesense.initialize-schema=true",
"spring.ai.vectorstore.typesense.collectionName=myTestCollection" })
@Testcontainers
class TypesenseContainerConnectionDetailsFactoryTest {

View File

@@ -46,7 +46,8 @@ import static org.assertj.core.api.Assertions.assertThat;
@TestPropertySource(properties = { "spring.ai.vectorstore.weaviate.filter-field.country=TEXT",
"spring.ai.vectorstore.weaviate.filter-field.year=NUMBER",
"spring.ai.vectorstore.weaviate.filter-field.active=BOOLEAN",
"spring.ai.vectorstore.weaviate.filter-field.price=NUMBER" })
"spring.ai.vectorstore.weaviate.filter-field.price=NUMBER",
"spring.ai.vectorstore.weaviate.initialize-schema=true" })
class WeaviateContainerConnectionDetailsFactoryTest {
@Container