-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(global-search): dashboard globalsearch apis #3831
Conversation
crates/analytics/src/search.rs
Outdated
let client = get_opensearch_client(url.to_owned()) | ||
.await | ||
.map_err(|_| AnalyticsError::UnknownError)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add our own wrapper struct around the opensearch client?
such that it will accept all the domain new types & opensearch client specific things like generating a json request etc will be restricted to that client implementation...
this will also help us provide the opensearch index name from env,
can refer to the kafka implementation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add this in the next PR
.body(json!({"query": {"bool": {"must": {"query_string": {"query": req.query}}, "filter": {"match_phrase": {"merchant_id": merchant_id}}}}})) | ||
.send() | ||
.await | ||
.map_err(|_| AnalyticsError::UnknownError)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add proper error variants here ig...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add this in the next PR with the wrapper struct
{"count":2,"index":"payment_intents","hits":[{"payment_id":"pay_sj8aVNPLFrctjkOF3UoT","merchant_id":"postman_merchant_GHAction_11f62d0d-df98-4b35-8629-a1eee1edfa92","status":"succeeded","amount":6540,"currency":"USD","amount_captured":6540,"customer_id":"StripeCustomer","description":"Its my first payment request","return_url":"https://duck.com/","connector_id":null,"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","created_at":1709032037,"modified_at":1709032039,"last_synced":1709032037,"setup_future_usage":null,"off_session":null,"client_secret":"pay_sj8aVNPLFrctjkOF3UoT_secret_xKyu8zgVxB6K0lzVXqqq","active_attempt_id":"pay_sj8aVNPLFrctjkOF3UoT_1","business_country":null,"business_label":"default","attempt_count":1,"sign_flag":1},{"payment_id":"pay_4rcoPWbtWs1DghxR29Ur","merchant_id":"postman_merchant_GHAction_11f62d0d-df98-4b35-8629-a1eee1edfa92","status":"succeeded","amount":6540,"currency":"USD","amount_captured":6540,"customer_id":"StripeCustomer","description":"Its my first payment request","return_url":"https://duck.com/","connector_id":null,"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","created_at":1709027992,"modified_at":1709027994,"last_synced":1709027992,"setup_future_usage":null,"off_session":null,"client_secret":"pay_4rcoPWbtWs1DghxR29Ur_secret_FbviEUdG7FNMf3S7socJ","active_attempt_id":"pay_4rcoPWbtWs1DghxR29Ur_1","business_country":null,"business_label":"default","attempt_count":1,"sign_flag":1}]``` |
[{"count":0,"index":"payment_attempts","hits":[]},{"count":2,"index":"payment_intents","hits":[{"payment_id":"pay_sj8aVNPLFrctjkOF3UoT","merchant_id":"postman_merchant_GHAction_11f62d0d-df98-4b35-8629-a1eee1edfa92","status":"succeeded","amount":6540,"currency":"USD","amount_captured":6540,"customer_id":"StripeCustomer","description":"Its my first payment request","return_url":"https://duck.com/","connector_id":null,"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","created_at":1709032037,"modified_at":1709032039,"last_synced":1709032037,"setup_future_usage":null,"off_session":null,"client_secret":"pay_sj8aVNPLFrctjkOF3UoT_secret_xKyu8zgVxB6K0lzVXqqq","active_attempt_id":"pay_sj8aVNPLFrctjkOF3UoT_1","business_country":null,"business_label":"default","attempt_count":1,"sign_flag":1},{"payment_id":"pay_4rcoPWbtWs1DghxR29Ur","merchant_id":"postman_merchant_GHAction_11f62d0d-df98-4b35-8629-a1eee1edfa92","status":"succeeded","amount":6540,"currency":"USD","amount_captured":6540,"customer_id":"StripeCustomer","description":"Its my first payment request","return_url":"https://duck.com/","connector_id":null,"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","created_at":1709027992,"modified_at":1709027994,"last_synced":1709027992,"setup_future_usage":null,"off_session":null,"client_secret":"pay_4rcoPWbtWs1DghxR29Ur_secret_FbviEUdG7FNMf3S7socJ","active_attempt_id":"pay_4rcoPWbtWs1DghxR29Ur_1","business_country":null,"business_label":"default","attempt_count":1,"sign_flag":1}]},{"count":0,"index":"refunds","hits":[]}]
|
Type of Change
Description
Search APIs for dashboard global search
Additional Changes
Motivation and Context
Search APIs for dashboard global search
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy