pub struct AzureSearchClient { /* private fields */ }Expand description
Azure Search API client
Implementations§
Source§impl AzureSearchClient
impl AzureSearchClient
Sourcepub fn from_connection(conn: &SearchConnection) -> Result<Self, ClientError>
pub fn from_connection(conn: &SearchConnection) -> Result<Self, ClientError>
Create client from a workspace search connection.
Sourcepub fn from_service_config(
service: &SearchServiceConfig,
) -> Result<Self, ClientError>
pub fn from_service_config( service: &SearchServiceConfig, ) -> Result<Self, ClientError>
Create client from a specific search service config (legacy).
Sourcepub fn with_auth(
base_url: String,
api_version: String,
preview_api_version: String,
auth: Box<dyn AuthProvider>,
) -> Result<Self, ClientError>
pub fn with_auth( base_url: String, api_version: String, preview_api_version: String, auth: Box<dyn AuthProvider>, ) -> Result<Self, ClientError>
Create with a custom auth provider and explicit versions (tests).
Sourcepub async fn list(&self, kind: ResourceKind) -> Result<Vec<Value>, ClientError>
pub async fn list(&self, kind: ResourceKind) -> Result<Vec<Value>, ClientError>
List all resources of a given kind
Sourcepub async fn get(
&self,
kind: ResourceKind,
name: &str,
) -> Result<Value, ClientError>
pub async fn get( &self, kind: ResourceKind, name: &str, ) -> Result<Value, ClientError>
Get a specific resource
Sourcepub async fn create_or_update(
&self,
kind: ResourceKind,
name: &str,
definition: &Value,
) -> Result<Option<Value>, ClientError>
pub async fn create_or_update( &self, kind: ResourceKind, name: &str, definition: &Value, ) -> Result<Option<Value>, ClientError>
Create or update a resource
Returns the response body if the API returns one. Some APIs (especially
preview endpoints like Knowledge Sources) return 204 No Content on
successful update, which yields Ok(None).
Sourcepub async fn delete(
&self,
kind: ResourceKind,
name: &str,
) -> Result<(), ClientError>
pub async fn delete( &self, kind: ResourceKind, name: &str, ) -> Result<(), ClientError>
Delete a resource
Sourcepub async fn indexer_run(&self, name: &str) -> Result<(), ClientError>
pub async fn indexer_run(&self, name: &str) -> Result<(), ClientError>
Trigger an indexer run now (202 Accepted, no body).
Sourcepub async fn indexer_reset(&self, name: &str) -> Result<(), ClientError>
pub async fn indexer_reset(&self, name: &str) -> Result<(), ClientError>
Clear an indexer’s change-tracking state (the next run reprocesses every document).
Sourcepub async fn indexer_status(&self, name: &str) -> Result<Value, ClientError>
pub async fn indexer_status(&self, name: &str) -> Result<Value, ClientError>
Execution state and history for an indexer.
Sourcepub async fn index_stats(&self, name: &str) -> Result<Value, ClientError>
pub async fn index_stats(&self, name: &str) -> Result<Value, ClientError>
Document count and storage size for an index.
Sourcepub async fn search_docs(
&self,
index: &str,
body: &Value,
) -> Result<Value, ClientError>
pub async fn search_docs( &self, index: &str, body: &Value, ) -> Result<Value, ClientError>
Run a search query against an index’s documents.
Sourcepub async fn kb_retrieve(
&self,
kb: &str,
body: &Value,
) -> Result<Value, ClientError>
pub async fn kb_retrieve( &self, kb: &str, body: &Value, ) -> Result<Value, ClientError>
Agentic retrieval against a knowledge base (the retrieve action).
A 206 Partial response (some knowledge sources errored) still carries
a usable body and is returned as success.
Sourcepub async fn exists(
&self,
kind: ResourceKind,
name: &str,
) -> Result<bool, ClientError>
pub async fn exists( &self, kind: ResourceKind, name: &str, ) -> Result<bool, ClientError>
Check if a resource exists
Sourcepub fn auth_method(&self) -> &'static str
pub fn auth_method(&self) -> &'static str
Get the authentication method being used