Class InfinispanContentRetriever
- All Implemented Interfaces:
ContentRetriever
ContentRetriever that uses full-text search (Ickle queries)
to retrieve relevant content. The query does not need an embedding model.
Built from an existing InfinispanEmbeddingStore, reusing its remote cache and
configuration. The store's schema must have full-text indexing enabled on the text field
(use InfinispanStoreConfiguration.TEXT_FIELD_ANNOTATION_FULLTEXT
when building the store).
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionInfinispanContentRetriever(InfinispanEmbeddingStore embeddingStore, int maxResults) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()retrieveAsync(Query query) Non-blocking counterpart ofContentRetriever.retrieve(Query), invoked by the asynchronous (CompletableFuture/CompletionStage) and reactive (Flow.Publisher) AI Service modes when RAG is configured.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentRetriever
addListener, addListeners
-
Constructor Details
-
InfinispanContentRetriever
-
-
Method Details
-
retrieve
Description copied from interface:ContentRetrieverRetrieves relevantContents using a givenQuery. TheContents are sorted by relevance, with the most relevantContents appearing at the beginning of the returnedList<Content>.- Specified by:
retrievein interfaceContentRetriever- Parameters:
query- TheQueryto use for retrieval.- Returns:
- A list of retrieved
Contents.
-
retrieveAsync
Description copied from interface:ContentRetrieverNon-blocking counterpart ofContentRetriever.retrieve(Query), invoked by the asynchronous (CompletableFuture/CompletionStage) and reactive (Flow.Publisher) AI Service modes when RAG is configured.The default implementation returns a failed future carrying
AsyncNotSupportedException: a retriever backed by blocking I/O (embedding-model call, vector-store query, web search, etc.) must opt in by overriding this method so it can return a genuinely non-blocking future instead of secretly tying up a worker thread. A retriever that cannot be made non-blocking is still usable from these modes viaDefaultRetrievalAugmentor, which offloads the blockingContentRetriever.retrieve(Query)to its executor.An implementation that honors cancellation should abort its in-flight I/O when the returned future is cancelled (best-effort); Java cannot safely interrupt arbitrary code, so this is not guaranteed.
An implementation must not throw and must not return
null: every failure, including an invalid argument, completes the returned future exceptionally.- Specified by:
retrieveAsyncin interfaceContentRetriever- Parameters:
query- TheQueryto use for retrieval.- Returns:
- A
CompletableFutureof the retrievedContents, sorted by relevance.
-
builder
-