Class AzureAiSearchContentRetriever
java.lang.Object
dev.langchain4j.store.embedding.azure.search.AbstractAzureAiSearchEmbeddingStore
dev.langchain4j.rag.content.retriever.azure.search.AzureAiSearchContentRetriever
- All Implemented Interfaces:
ContentRetriever
,EmbeddingStore<TextSegment>
public class AzureAiSearchContentRetriever
extends AbstractAzureAiSearchEmbeddingStore
implements ContentRetriever
Represents Azure AI Search Service as a
This class supports 4
-
-
-
-
ContentRetriever
.
This class supports 4
AzureAiSearchQueryType
s:
-
VECTOR
: Uses the vector search algorithm to find the most similar TextSegment
s.
More details can be found here.
-
FULL_TEXT
: Uses the full text search to find the most similar TextSegment
s.
More details can be found here.
-
HYBRID
: Uses the hybrid search (vector + full text) to find the most similar TextSegment
s.
More details can be found here.
-
HYBRID_WITH_RERANKING
: Uses the hybrid search (vector + full text) to find the most similar TextSegment
s,
and uses the semantic re-ranker algorithm to rank the results.
More details can be found here.-
Nested Class Summary
-
Field Summary
Fields inherited from class dev.langchain4j.store.embedding.azure.search.AbstractAzureAiSearchEmbeddingStore
DEFAULT_FIELD_CONTENT, DEFAULT_FIELD_CONTENT_VECTOR, DEFAULT_FIELD_METADATA, DEFAULT_FIELD_METADATA_ATTRS, DEFAULT_FIELD_METADATA_SOURCE, DEFAULT_INDEX_NAME, filterMapper, searchClient, SEMANTIC_SEARCH_CONFIG_NAME, VECTOR_ALGORITHM_NAME, VECTOR_SEARCH_PROFILE_NAME
-
Constructor Summary
ConstructorDescriptionAzureAiSearchContentRetriever
(String endpoint, com.azure.core.credential.AzureKeyCredential keyCredential, com.azure.core.credential.TokenCredential tokenCredential, boolean createOrUpdateIndex, int dimensions, com.azure.search.documents.indexes.models.SearchIndex index, String indexName, EmbeddingModel embeddingModel, int maxResults, double minScore, AzureAiSearchQueryType azureAiSearchQueryType, AzureAiSearchFilterMapper filterMapper, Filter filter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddDocument
to the full text search engine.void
add
(TextSegment segment) AddTextSegment
to the full text search engine.void
Add content to the full text search engine.void
add
(List<TextSegment> segments) Add a list ofTextSegment
s to the full text search engine.builder()
Methods inherited from class dev.langchain4j.store.embedding.azure.search.AbstractAzureAiSearchEmbeddingStore
add, add, add, addAll, addAll, createOrUpdateIndex, deleteIndex, fromAzureScoreToRelevanceScore, fromAzureScoreToRelevanceScore, getEmbeddingMatches, initialize, remove, removeAll, removeAll, removeAll, search
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.store.embedding.EmbeddingStore
findRelevant, findRelevant, findRelevant, findRelevant
-
Constructor Details
-
AzureAiSearchContentRetriever
public AzureAiSearchContentRetriever(String endpoint, com.azure.core.credential.AzureKeyCredential keyCredential, com.azure.core.credential.TokenCredential tokenCredential, boolean createOrUpdateIndex, int dimensions, com.azure.search.documents.indexes.models.SearchIndex index, String indexName, EmbeddingModel embeddingModel, int maxResults, double minScore, AzureAiSearchQueryType azureAiSearchQueryType, AzureAiSearchFilterMapper filterMapper, Filter filter)
-
-
Method Details
-
add
Add content to the full text search engine. -
add
AddDocument
to the full text search engine. -
add
AddTextSegment
to the full text search engine. -
add
Add a list ofTextSegment
s to the full text search engine. -
retrieve
Description copied from interface:ContentRetriever
Retrieves relevantContent
s using a givenQuery
. TheContent
s are sorted by relevance, with the most relevantContent
s appearing at the beginning of the returnedList<Content>
.- Specified by:
retrieve
in interfaceContentRetriever
- Parameters:
query
- TheQuery
to use for retrieval.- Returns:
- A list of retrieved
Content
s.
-
builder
-