/创建Context索引
CREATE INDEX myindex ON TestLob(charlob) INDEXTYPE IS CTXSYS.CONTEXT parameters ('DATASTORE CTXSYS.DEFAULT_DATASTORE');
create index myindex on TestLob(charlob) indextype is ctxsys.context parameters('filter ctxsys.null_filter section group charlob');
drop index mydocs_text_index;
begin 
  Ctx_Ddl.Drop_Preference ('my_datastore_prefs'); 
end; 

BEGIN
ctx_ddl.create_preference ('my_datastore_prefs', 'FILE_DATASTORE');
ctx_ddl.set_attribute ('my_datastore_prefs', 'path', 'D:\Tools\Oracle');
END;
/CREATE TABLE mydocs( id NUMBER PRIMARY KEY, title VARCHAR2(255), thefile
VARCHAR2(255) );INSERT INTO mydocs( id, title, thefile ) VALUES( 1, 'Document1', 'test.doc');
INSERT INTO mydocs( id, title, thefile ) VALUES( 2, 'Document2', 'test.pdf');
INSERT INTO mydocs( id, title, thefile ) VALUES( 3, 'Document3', 'index.html');
COMMIT;CREATE INDEX mydocs_text_index ON mydocs(thefile) INDEXTYPE IS ctxsys.context
PARAMETERS('datastore my_datastore_prefs Filter ctxsys.INSO_FILTER Lexer my_lexer');
SELECT id,title
FROM mydocs
WHERE contains( thefile, '你好' ) > 0;
CREATE INDEX mydocs_text_index ON mydocs(thefile) INDEXTYPE IS ctxsys.context
PARAMETERS('datastore my_datastore_prefs Filter ctxsys.INSO_FILTER Lexer my_lexer');
BEGIN
ctx_ddl.create_preference ('my_lexer', 'chinese_vgram_lexer');
END;
/drop index chinese_lexer_idx;begin 
  Ctx_Ddl.Drop_Preference ('chinese_lexer_pref'); 
end; 
/ begin 
  Ctx_Ddl.Create_Preference ('chinese_lexer_pref','CHINESE_VGRAM_LEXER'); 
end;
/
 
create index chinese_lexer_idx on testlob ( charlob ) 
  indextype is ctxsys.context 
  parameters ( 'LEXER CHINESE_LEXER_PREF' );