Skip to content

Commit 9f85d1c

Browse files
committed
init
1 parent d9c39bd commit 9f85d1c

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

sql/dbms_sendrequest_visionai_call_inline_function.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--This is a work in progress and only applicable to smaller image sizes
12
create or replace FUNCTION call_analyze_image_api_inline (
23
p_endpoint VARCHAR2,
34
p_compartment_ocid VARCHAR2,

sql/setup.sql

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,46 @@ CREATE TABLE aivision_results
2121
jsondata CLOB
2222
CONSTRAINT ensure_aivision_results_json CHECK (jsondata IS JSON));
2323

24+
create index airesultsindex on aivision_results(jsondata) indextype is ctxsys.context;
25+
26+
select index_name, index_type, status from user_indexes where index_name = 'AIRESULTSINDEX';
27+
select idx_name, idx_table, idx_text_name from ctx_user_indexes;
28+
select token_text from dr$airesultsindex$i;
29+
30+
select * from user_data
31+
32+
--CONTAINS operator
33+
select * from user_data
34+
where contains ( jsondata, 'john' ) > 0
35+
36+
--Mixed Queries
37+
select * from user_data
38+
where amount < 100
39+
and contains ( jsondata, 'smith' ) > 0
40+
41+
--An OR search
42+
select * from user_data
43+
where contains ( jsondata, 'john OR johnny' ) > 0
44+
45+
--Wildcards (% matches any string of characters, and an underscore _ character matches any single character)
46+
select * from user_data
47+
where contains ( jsondata, 'john%' ) > 0
48+
49+
--Phrase searches (an AND search similar to OR but implicit)
50+
select * from user_data
51+
where contains ( jsondata, 'first order' ) > 0
52+
53+
--Fuzzy searches (find not only the original search word, but also all those similar to it)
54+
select * from user_data
55+
where contains ( jsondata, 'fuzzy(popins)' ) > 0
56+
57+
--Near searches (words within specified distance of each other)
58+
select * from user_data
59+
where contains ( jsondata, 'near((order, smith), 1)' ) > 0
60+
61+
--Easy Text Search over Multiple Tables and Views with DBMS_SEARCH in 23c
62+
--workshop: https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3721
63+
2464
--CREATE TABLE image_storage (
2565
-- image_id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY,
2666
-- image_name VARCHAR2(255),

0 commit comments

Comments
 (0)