Oracle Text Section Attributes

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:


Table 8-4 Section Attributes

Section Attribute Description

visible

You can use the visible attribute for all the section types that are tokenized, except the zone section type. Thus, the visible attribute can be used for Field, Hybrid, and SDATA section types.

Specify TRUE to make the text visible within a document. This makes the text within the field section to be indexed as part of the enclosing document.

Default is FALSE. This makes the text within the field section to be indexed separately from the rest of the document.

For the Field section type, the visible attribute overrides the value specified in the CTX_DDL.ADD_FIELD_SECTION procedure.

lexer

You can use the lexer attribute for all the section types that are tokenized, that is, Field, Zone, Hybrid, and SDATA sections.

Specify the lexer preference name to decide the tokenization of an SDATA section. Default is NULL and the lexer for the main document is used.

The lexer preference must be valid at the time of calling the set_section_attribute procedure. If you try to drop one of the preferences when a field section still exists that refers to a lexer preference, the drop_preference procedure will fail.

wordlist

You can use the wordlist attribute for all the section types that are tokenized, that is, Field, Zone, Hybrid, and SDATA sections.

Specify the wordlist preference name for a section to enable section specific prefix indexing and substring indexing. Default is NULL and the wordlist for the main document is used.

The wordlist preference must be valid at the time of calling the set_section_attribute procedure. If you try to drop one of the preferences when a field section still exists that refers to a wordlist preference, the drop_preference procedure will fail.

stoplist

You can use the stoplist attribute for all the section types that are tokenized, that is, Field, Zone, Hybrid, and SDATA sections.

Specify the stoplist preference name for enabling section specific stoplist. Default is NULL and the stoplist for the main document is used.

The stoplist preference must be valid at the time of calling the set_section_attribute procedure. If you try to drop one of the preferences when a field section still exists that refers to a stoplist preference, the drop_preference procedure will fail.


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;

See Also:

Oracle Text Reference for the syntax of CTX_DDL.SET_SECTION_ATTRIBUTE procedure.