Monday, January 5, 2009

Create Oracle Text Index [CONTEXT Index]

Creating a CONTEXT Index:
Default CONTEXT Index Example,
CREATE INDEX myindex ON docs(text) INDEXTYPE IS CTXSYS.CONTEXT;
Deafult Values:
1. The text is to be stored in text column.column can be of type CLOB, BLOB, BFILE, VARCHAR2, or CHAR.
2. Language of the DB will be asumed to be same.
3.Default Spotlist will be used.
4.Enables fuzzy and stemming queries for your language.


Custom CONTEXT Index Example:
Indexing HTML Documents,

begin
ctx_ddl.create_preference('my_url','URL_DATASTORE');
ctx_ddl.set_attribute('my_url','HTTP_PROXY','www-proxy.us.oracle.com');
ctx_ddl.set_attribute('my_url','NO_PROXY','us.oracle.com');
ctx_ddl.set_attribute('my_url','Timeout','300');
end;

begin
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
ctx_ddl.add_zone_section('htmgroup', 'heading', 'H1');
end;

create index myindex on docs(htmlfile) indextype is ctxsys.context parameters('datastore my_url filter ctxsys.null_filter section group htmgroup');

No comments:

search engine

Custom Search