Section attributes are the settings related to the Oracle Text sections of tokenized type, such as, Field, Zone, Hybrid, and SDATA. Section attributes improve the query performance due to the finer control at the section level, rather than at the document level or index level.
By using the section attributes, you can:
specify lexer preferences on certain sections of a document. This is useful for part-name searches, where a certain section of a document containing a part-name needs to be lexed differently than the rest of the document. The lexer preference can also be used for handling multi-lingual documents, where there is a section to language mapping.
specify a substring index only on certain sections of a document. This helps in reducing the index size.
specify creating prefix tokens only on certain sections of a document. The prefix tokens are used to improve the performance of right-truncated queries, but can also cause the index size to grow rapidly. Specifying prefix indexing only on certain sections provides improved performance for the right-truncated queries on the specific sections, without rapidly growing the size of the index.
specify stoplists for certain sections of a document.
specify creating a new section type that combines the flexibility of Zone sections with the performance of Field sections. Currently, Zone sections have poor performance compared to Field sections. However, Field sections do not support nested section search.
Section attributes are set using the procedure CTX_DDL.SET_SECTION_ATTRIBUTE
.
Table 8-4 lists the section attributes that you can use:
Section Attribute | Description |
---|---|
|
You can use the Specify Default is For the Field section type, the visible attribute overrides the value specified in the |
|
You can use the Specify the lexer preference name to decide the tokenization of an SDATA section. Default is The lexer preference must be valid at the time of calling the |
|
You can use the Specify the wordlist preference name for a section to enable section specific prefix indexing and substring indexing. Default is The wordlist preference must be valid at the time of calling the |
|
You can use the Specify the stoplist preference name for enabling section specific stoplist. Default is The stoplist preference must be valid at the time of calling the |
The following example enables the visible
attribute of a Field section:
begin ctx_ddl.create_section_group(‘fieldgroup', ‘BASIC_SECTION_GROUP'); ctx_ddl.add_field_section(‘fieldgroup', ‘author', ‘AUTHOR'); ctx_ddl.set_section_attribute(‘fieldgroup', ‘author', ‘visible', ‘true'); end;
Oracle Text Reference for the syntax of CTX_DDL.SET_SECTION_ATTRIBUTE
procedure.