-------
Example on how to index documents stored on filesystem.
SCOPE & APPLICATION
-------------------
Testing intermedia text features.
EXAMPLE
-------
#create user and grant some privs
connect ctxsys/ctxsys
create user ctxdemo identified by ctxdemo default tablespace tls temporary
tablespace tmp; grant connect, resource, ctxapp to ctxdemo;
#connect to user
connect ctxdemo/ctxdemo
#create table to store document reference
create table imtdoc(id number primary key, docname varchar2(100));
#create preference
execute ctx_ddl.create_preference('imtdoc','file_datastore');
#insert some values
#be sure that you have this file on specified path
insert into imtdoc values (1,'/tmp/mydoc.doc');
commit;
#create the index on target table
create index idx_imtdoc on imtdoc(docname) indextype is ctxsys.context
parameters ('datastore imtdoc');
#query our document
select id, docname from imtdoc where contains(docname,'Oracle') > 0;
#where the document contains the word 'oracle'
Partager