@@ -99,6 +99,53 @@ Response Search::search(const std::string& collection_name, const std::map<std::
9999 return request_->execute (" GET" , path);
100100}
101101
102+ Response Search::samSearch (const std::string& collection_name, const std::string& query,
103+ const std::map<std::string, std::string>& params)
104+ {
105+ utils::validateCollectionName (collection_name);
106+
107+ if (query.empty ())
108+ {
109+ throw std::invalid_argument (" SAM query must be a non-empty string" );
110+ }
111+
112+ std::map<std::string, std::string> query_params = params;
113+ query_params[" collection" ] = collection_name;
114+ query_params[" q" ] = query;
115+
116+ std::string path = " /sam/search" ;
117+ std::string query_string = buildQueryString (query_params);
118+
119+ if (!query_string.empty ())
120+ {
121+ path += " ?" + query_string;
122+ }
123+
124+ return request_->execute (" GET" , path);
125+ }
126+
127+ Response Search::samSearchAll (const std::string& query, const std::map<std::string, std::string>& params)
128+ {
129+ if (query.empty ())
130+ {
131+ throw std::invalid_argument (" SAM query must be a non-empty string" );
132+ }
133+
134+ std::map<std::string, std::string> query_params = params;
135+ query_params[" q" ] = query;
136+ query_params[" all" ] = " true" ;
137+
138+ std::string path = " /sam/search" ;
139+ std::string query_string = buildQueryString (query_params);
140+
141+ if (!query_string.empty ())
142+ {
143+ path += " ?" + query_string;
144+ }
145+
146+ return request_->execute (" GET" , path);
147+ }
148+
102149Response Search::sql (const std::string& collection_name, const std::string& sql,
103150 const std::map<std::string, std::string>& params)
104151{
0 commit comments