Forward Index with Save Copy
Using Forward Index with Save Copy
To use the forward index effectively, you should store copies of the documents in the $D table, either in plain-text format or filtered format, depending upon the CTX_DOC package procedure that you use. For example, store the document in plain-text when you use the SNIPPET procedure and store it in the filtered format when you use the MARKUP or HIGHLIGHT procedure.
You should use the Save Copy feature of Oracle Text to store the copies of the documents in the $D table. Implement the feature by using the save_copy attribute or the save_copy column parameter.
-
save_copybasic storage attribute:The following example sets the
save_copyattribute value of theBASIC_STORAGEstorage type toPLAINTEXT.This example enables Oracle Text to save a copy of the text document in the$Dtable while it searches for a word in that document.exec ctx_ddl.create_preference('mystore', 'BASIC_STORAGE'); exec ctx_ddl.set_attribute('mystore','save_copy','PLAINTEXT'); -
save_copy columnindex parameter:The following example uses the
save_copy columnindex parameter to save a copy of a text document into the$Dtable. Thecreate indexstatement creates the$Dtable and copies document 1 ( “hello world”) into the$Dtable.create table docs( id number, txt varchar2(64), save varchar2(10) ); insert into docs values(1, 'hello world', 'PLAINTEXT'); create index idx on docs(txt) indextype is ctxsys.context parameters('save_copy column save');
For the save_copy attribute or column parameter, you can specify one of the following values:
-
PLAINTEXTsaves the copy of the document in a plain-text format in the$Dindex table. The plain-text format is defined as the output format of the sectioner. Specify this value when you use theSNIPPETprocedure. -
FILTEREDsaves a copy of a document in a filtered format in the$Dindex table. The filtered format is defined as the output format of the filter. Specify this value when you use theMARKUPorHIGHLIGHTprocedure. -
NONEdoes not save the copy of the document in the$Dindex table. Specify this value when you do not use theSNIPPET, MARKUP,orHIGHLIGHTprocedure and when the indexed column is eitherVARCHAR2orCLOB.