Step 3: Index Content (with Oracle Text)
Now comes the really exciting part. You will instruct Oracle to crawl your documents and index them. To index the binary documents you just loaded with your PL/SQL routine, execute the following code using Oracle Text's BASIC_LEXER:
ctx_ddl.set_attribute('doc_lexer', 'printjoins', '_-');
create index idxContentMgmtBinary on CMDEMO.CONTENT_INVENTORY(TEXT) indextype is ctxsys.context
parameters ('lexer doc_lexer sync (on commit)');
Depending on your system's speed, the preceding statement may take a minute to process. The new transactional parameter "sync (on commit)" in Oracle 10g enables you to have your index immediately refresh when changes occur to your base table. Previously, you most likely would have done this periodically via a DBMS_JOB.
To index your URLs, both internal and external sites, you use a different statement and different preferences:
drop index idxContentMgmtURL;
create index idxContentMgmtURL on content_inventory(url) indextype is ctxsys.context;
That does it. You have now indexed the content in each of these files and the content from your internal and external Web sites.