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
AzureAiSearchQueryTypes:
-
VECTOR: Uses the vector search algorithm to find the most similar TextSegments.
More details can be found here.
-
FULL_TEXT: Uses the full text search to find the most similar TextSegments.
More details can be found here.
-
HYBRID: Uses the hybrid search (vector + full text) to find the most similar TextSegments.
More details can be found here.
-
HYBRID_WITH_RERANKING: Uses the hybrid search (vector + full text) to find the most similar TextSegments,
and uses the semantic re-ranker algorithm to rank the results.
More details can be found here.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class 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
ConstructorsConstructorDescriptionAzureAiSearchContentRetriever(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 TypeMethodDescriptionvoidAddDocumentto the full text search engine.voidadd(TextSegment segment) AddTextSegmentto the full text search engine.voidAdd content to the full text search engine.voidadd(List<TextSegment> segments) Add a list ofTextSegments to the full text search engine.builder()Methods inherited from class AbstractAzureAiSearchEmbeddingStore
add, add, add, addAll, addAll, createOrUpdateIndex, deleteIndex, fromAzureScoreToRelevanceScore, fromAzureScoreToRelevanceScore, getEmbeddingMatches, initialize, remove, removeAll, removeAll, removeAll, searchMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingStore
addAll, generateIds
-
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
AddDocumentto the full text search engine. -
add
AddTextSegmentto the full text search engine. -
add
Add a list ofTextSegments to the full text search engine. -
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.
-
builder
-