mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
chore(analytics): opensearch client creation based on config (#7810)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -2245,7 +2245,10 @@ pub mod routes {
|
||||
.collect();
|
||||
|
||||
analytics::search::msearch_results(
|
||||
&state.opensearch_client,
|
||||
state
|
||||
.opensearch_client
|
||||
.as_ref()
|
||||
.ok_or_else(|| error_stack::report!(OpenSearchError::NotEnabled))?,
|
||||
req,
|
||||
search_params,
|
||||
SEARCH_INDEXES.to_vec(),
|
||||
@ -2392,9 +2395,16 @@ pub mod routes {
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
analytics::search::search_results(&state.opensearch_client, req, search_params)
|
||||
.await
|
||||
.map(ApplicationResponse::Json)
|
||||
analytics::search::search_results(
|
||||
state
|
||||
.opensearch_client
|
||||
.as_ref()
|
||||
.ok_or_else(|| error_stack::report!(OpenSearchError::NotEnabled))?,
|
||||
req,
|
||||
search_params,
|
||||
)
|
||||
.await
|
||||
.map(ApplicationResponse::Json)
|
||||
},
|
||||
&auth::JWTAuth {
|
||||
permission: Permission::ProfileAnalyticsRead,
|
||||
|
||||
Reference in New Issue
Block a user