@@ -21,6 +21,46 @@ CREATE TABLE aivision_results
21
21
jsondata CLOB
22
22
CONSTRAINT ensure_aivision_results_json CHECK (jsondata IS JSON));
23
23
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
+
24
64
-- CREATE TABLE image_storage (
25
65
-- image_id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY,
26
66
-- image_name VARCHAR2(255),
0 commit comments