Skip to content

Commit 17f121e

Browse files
authored
add upgrade sql (#197)
1 parent 2f89308 commit 17f121e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE FUNCTION "hybrid_search"(
2+
"job_name" TEXT, /* alloc::string::String */
3+
"query" TEXT, /* alloc::string::String */
4+
"api_key" TEXT DEFAULT NULL, /* core::option::Option<alloc::string::String> */
5+
"return_columns" TEXT[] DEFAULT ARRAY['*']::text[], /* alloc::vec::Vec<alloc::string::String> */
6+
"num_results" INT DEFAULT 10, /* i32 */
7+
"where_sql" TEXT DEFAULT NULL /* core::option::Option<alloc::string::String> */
8+
) RETURNS TABLE (
9+
"search_results" jsonb /* pgrx::datum::json::JsonB */
10+
)
11+
LANGUAGE c /* Rust */
12+
AS 'MODULE_PATHNAME', 'hybrid_search_wrapper';

extension/src/api.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ fn search(
137137
Ok(TableIterator::new(search_results.into_iter().map(|r| (r,))))
138138
}
139139

140+
/// EXPERIMENTAL: Hybrid search
141+
///
142+
/// This function is experimental and may change in future versions.
140143
#[pg_extern]
141144
fn hybrid_search(
142145
job_name: String,

0 commit comments

Comments
 (0)