Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(global-search-regex-escape): escape reserved characters which break global search query (#4135)
ivor-juspay4f8461b2a949
diff --git a/crates/analytics/src/search.rs b/crates/analytics/src/search.rsindex d9b8433ba6..4c42e96250 100644--- a/crates/analytics/src/search.rs+++ b/crates/analytics/src/search.rs@@ -81,7 +81,7 @@ pub async fn msearch_results(for index in SearchIndex::iter() {msearch_vector.push(json!({"index": search_index_to_opensearch_index(index,&config.indexes)}).into());- msearch_vector.push(json!({"query": {"bool": {"must": {"query_string": {"query": req.query}}, "filter": {"match_phrase": {"merchant_id": merchant_id}}}}}).into());+ msearch_vector.push(json!({"query": {"bool": {"filter": [{"multi_match": {"type": "phrase", "query": req.query, "lenient": true}},{"match_phrase": {"merchant_id": merchant_id}}]}}}).into());}let response = client@@ -128,7 +128,7 @@ pub async fn search_results(.search(SearchParts::Index(&[&search_index_to_opensearch_index(req.index.clone(),&config.indexes)])).from(search_req.offset).size(search_req.count)- .body(json!({"query": {"bool": {"must": {"query_string": {"query": search_req.query}}, "filter": {"match_phrase": {"merchant_id": merchant_id}}}}}))+ .body(json!({"query": {"bool": {"filter": [{"multi_match": {"type": "phrase", "query": search_req.query, "lenient": true}},{"match_phrase": {"merchant_id": merchant_id}}]}}})).send().await.map_err(|_| AnalyticsError::UnknownError)?;