@@ -3,8 +3,9 @@ CREATE INDEX <index-name>
3
3
ON < table- name> (< column- name> )
4
4
INDEXTYPE IS CTXSYS .CONTEXT
5
5
PARAMETERS (' DATASTORE <datastore-name>
6
- STOPLIST <stoplist-name>
7
- WORDLIST <wordlist-name>' )
6
+ WORDLIST <wordlist-name>
7
+ LEXER <lexer-name>
8
+ STOPLIST <stoplist-name>' )
8
9
9
10
-- Synchronize index contents
10
11
exec CTX_DDL .SYNC_INDEX (:index_name);
@@ -14,19 +15,35 @@ exec CTX_DDL.OPTIMIZE_INDEX(:index_name, 'REBUILD');
14
15
alter index < index- name> rebuild;
15
16
16
17
-- Parameters
18
+ -- Datastore — indexing more than one column or function
19
+ -- Stoplist — list of tokens to ignore
20
+ -- Wordlist — weird preferences (fuzzy search, substring indexing, etc)
21
+ -- Lexer - token preferences (printjoins, etc)
22
+ BEGIN
23
+ CTX_DDL .CREATE_PREFERENCE (:wordlist_name, ' BASIC_WORDLIST' );
24
+ CTX_DDL .SET_ATTRIBUTE (:wordlist_name, ' SUBSTRING_INDEX' , ' YES' );
25
+ END;
26
+ /
27
+
28
+ BEGIN
29
+ CTX_DDL .CREATE_PREFERENCE (:lexer_name, ' BASIC_LEXER' );
30
+ -- do not 'tokenize' by '/'
31
+ CTX_DDL .SET_ATTRIBUTE (:lexer_name, ' PRINTJOINS' , ' /' );
32
+ END;
33
+ /
17
34
18
35
-- Commands for creating and dropping stoplists
19
36
BEGIN
20
37
CTX_DDL .CREATE_STOPLIST (
21
38
stoplist_name => :stoplist_name,
22
39
stoplist_type => ' BASIC_STOPLIST' );
23
40
END;
24
-
41
+ /
25
42
BEGIN
26
43
CTX_DDL .DROP_STOPLIST (
27
44
stoplist_name => :stoplist_name);
28
45
END;
29
-
46
+ /
30
47
-- Create and index without a stoplist first.
31
48
-- Check the most common tokens in dr$<index-name>$i.
32
49
-- Add stopwords
35
52
stoplist_name => :stoplist_name,
36
53
stopword => :token);
37
54
END;
38
-
55
+ /
39
56
-- If you want to check existing stopwords, query CTX_STOPWORDS
40
57
select *
41
58
from CTX_STOPWORDS
0 commit comments