Class IndexerBuilder
EasyIndexer that knows how to put them there.
Analogy: this is the "choose your destination" screen. Like calling
DriverManager.getConnection(url) before you can run any SQL, you first say
.toMilvus(...) to get something you can actually index(...) into.
Separating the two steps keeps the door open for future destinations (pgvector,
Chroma, ...) without changing how callers start the chain.
You never construct this directly — start from EasyAI.indexer():
EasyAI.indexer()
.toMilvus("localhost", 19530, "documents")
.index("file:/data/policy.pdf");
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiontoMilvus()Targets a Milvus collection configured entirely fromeasyai.properties(keyseasyai.milvus.*).toMilvus(MilvusConfig config) Targets a Milvus collection using a fully builtMilvusConfig.Targets a Milvus collection using explicit connection settings, with the default embeddingdimension(384).withEventListener(EasyAIListener eventListener) Registers a listener that receives a liveEasyAIEventstream as documents are loaded, embedded, and upserted into the vector store.
-
Method Details
-
withEventListener
Registers a listener that receives a liveEasyAIEventstream as documents are loaded, embedded, and upserted into the vector store.Call this before
toMilvus(...)so the destination indexer inherits it. The indexer emitsEasyAIEvent.Phase.STARTEDwhen indexing begins, aEasyAIEvent.Phase.PROGRESSevent per source document and one for the store-upsert step, thenEasyAIEvent.Phase.FINISHED(orEasyAIEvent.Phase.ERROR).Familiar analogy: a parcel-tracking page for a bulk shipment — instead of only learning "all 200 boxes delivered" at the end, you watch each box move through the depot.
int n = EasyAI.indexer() .withEventListener(e -> log.info("{}", e)) .toMilvus("localhost", 19530, "documents") .index("file:/data/policy.pdf", "classpath:faq.txt");- Parameters:
eventListener- the listener to receive ingestion events (may benull)- Returns:
- this builder
- See Also:
-
toMilvus
Targets a Milvus collection using explicit connection settings, with the default embeddingdimension(384).Called as the first link after
EasyAI.indexer(); returns the configuredEasyIndexeron which you callindex(...).- Parameters:
host- Milvus server hostname (e.g."localhost")port- Milvus server port (typically 19530)collectionName- the target collection- Returns:
- an
EasyIndexerbound to that collection
-
toMilvus
Targets a Milvus collection using a fully builtMilvusConfig.Use this overload when you need a non-default dimension or credentials.
- Parameters:
config- the Milvus connection settings- Returns:
- an
EasyIndexerbound to that collection
-
toMilvus
Targets a Milvus collection configured entirely fromeasyai.properties(keyseasyai.milvus.*).The zero-argument, "it's all in config" path — ideal for Jakarta EE apps that keep environment settings out of code.
- Returns:
- an
EasyIndexerbound to the collection described in properties - See Also:
-