Yes, you must create an environment before you can create domain indexes. To create it, you need the ctxsys user and the necessary ctxapp previliges. Follow the steps in the link below to have one for your environment. This user is not created by default when installing oracle.
http://www.oraclebin.com/2012/12/creating-environment-for-ctxsys.html
Once you have all the grants and packages, you can create the settings and indexes as shown.
SQL> begin 2 ctx_ddl.create_preference('SUBSTRING_PREF', 'BASIC_WORDLIST'); 3 ctx_ddl.set_attribute('SUBSTRING_PREF', 'SUBSTRING_INDEX','TRUE'); 4 end; 5 /
Now create the domain index as shown.
SQL> create index test_idx on test(object_name) 2 indextype is ctxsys.context parameters ('wordlist SUBSTRING_PREF MEMORY 50M'); Index created. select * from test where contains( object_name,'%EXEC%') > 0;
See the link below that explains this with the execution plan.
Links: http://www.oraclebin.com/2012/12/oracle-text-and-domain-indexes.html
source share