We want to use a ctxsys.context
index type for full text search. But I was quite surprised, that an index of this type is not automatically updated. We have 3 million documents with about 10k updates/inserts/deletes per day.
What are your recommendations for syncing and optimizing an Oracle Text index?
What do you mean by "not automatically updated"?
The index can be synchronized on commit or periodically.
I you don't need real-time search accuracy our DBA recommended to sync the index periodically, say each 2 min. If you can afford to do it overnight, then even better. What is best depends on your load and the size of the document.
These links can probably provide you with more information:
For DBA advice, maybe serverfault is better?
I think 'SYNC EVERY' option, as described in previous answer only available in Oracle 10g or newer. If you're using older version of Oracle you would have to run sync operation periodically. For example, you can create following stored procedure:
and then schedule it run via DBMS_JOB:
As for index optimization, following command can be used (also can be scheduled with DBMS_JOB or via cron):
There is also CTX_* package with similar function available.
Putting this here as an update for Oracle 12C users. If you use the index in real time mode, then it keeps items in memory, and periodicially pushes to the main tables, which keeps fragmentation down and enables NRT search on streaming content. Here's how to set it up
this will set up the index in NRT mode. It's pretty sweet.