Problem crating text index with PREFIX_INDEX option
482033Jun 12 2006 — edited Jun 12 2006I am trying to create a text index with prefixes option for use in wildcard search scenarios.
Here is the code I use:
connect CTXSYS/*******
BEGIN
ctx_ddl.create_preference('wildcard_pref', 'BASIC_WORDLIST');
ctx_ddl.set_attribute('wildcard_pref','PREFIX_INDEX','TRUE');
ctx_ddl.set_attribute('wildcard_pref','PREFIX_MIN_LENGTH',3);
ctx_ddl.set_attribute('wildcard_pref','PREFIX_MAX_LENGTH',8);
ctx_ddl.set_attribute('wildcard_pref','SUBSTRING_INDEX','YES');
END;
And preference is created
SELECT PRE_OWNER, PRE_NAME FROM CTXSYS.CTX_PREFERENCES;
PRE_OWNER PRE_NAME
------------------------------ ------------------------------
CTXSYS WILDCARD_PREF
CTXSYS DEFAULT_STORAGE
CTXSYS DEFAULT_CLASSIFIER
Now when I log as one of the database users and try to create the index,
I got this:
create index wildcard_idx on MY_Table(Name)
indextype is ctxsys.context
parameters ('WORDLIST wildcard_pref') ;
create index wildcard_idx on MY_Table(Name)
*
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: wildcard_pref
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364
What I am doing wrong ? Keep in mind that I was able to create a text index without the prefixes, but a lot of the searches will be based on patial word search.
Eventualy I would also like to make those indexes be tansactional and work as a datastore (multiple column search)
Thanks.
Stefan