SET_SECTION_ATTRIBUTE
Use SET_SECTION_ATTRIBUTE to specify attributes or properties for a given section.
The attribute names listed under “Syntax” are supported. Note that some attributes only apply to sections that are tokenized. The following section types are tokenized:
-
Field sections
-
Zone sections
-
SDATA sections
Syntax
CTX_DDL.SET_SECTION_ATTRIBUTE(
group_name IN VARCHAR2,
section_name IN VARCHAR2,
attribute IN VARCHAR2,
value IN VARCHAR2
);
group_name
Specify the name of the section group.
section_name
Specify the name of the section.
attribute
Specify this attribute for SDATA sections:
-
Visiblesection attributeThis attribute works with FIELD sections only. For FIELD sections:
Specify TRUE to make the text visible within the rest of the document. By default, the visible flag is FALSE. This means that Oracle Text indexes the text within field sections as a sub-document separate from the rest of the document. However, you can set the visible flag to TRUE if you want text within the field section to be indexed as part of the enclosing document.
For field sections, attribute will override the value specified in CTX_DDL.ADD_FIELD_SECTION.
An error is thrown if you try to set the
visibleattribute for a zone section.An error is thrown if the
visibleattribute is set on a non-tokenized section. -
save_copy. Set to True or False. Thesave_copyoption is valid for all types of sections, but only SDATA attributes are fetched from $D table. The rest of the sections are stored for display purposes only (depending on value ofsave_copy). SDATA sections are never stored for display purposes, but are stored independently (in a separate column of $D table) for efficient fetching (depending on value ofsave_copy). For all sections (except for SDATA sections): A section is either displayed or discarded during document service procedures (snippet, markup, highlight) depending on the value ofsave_copy. -
optimized_forsection attributeThis attribute makes an SDATA section optimal for search, optimal for sort, or optimal for both search and sort. These are achieved by setting the attribute value to
search,sort, orsort_and_search.-
searchprovides efficient searching on SDATA sections. -
sortprovides efficient sorting on SDATA sections. This is the default value. -
sort_and_searchprovides efficient searching and sorting on SDATA sections.
-
value
Specify the attribute value. Specify boolean values as TRUE or FALSE, T or F, YES or NO, Y or N, ON or OFF, or 1 or 0.
Example
The following example creates a basic section group called sg, adds a SDATA section to it and marks that SDATA section to be searchable by using the ctx_ddl.set_section_attribute:
begin
exec ctx_ddl.create_section_group('sg', 'basic_section_group');
exec ctx_ddl.add_sdata_section('sg', 'sec1', 'sec1', 'varchar2');
exec ctx_ddl.set_section_attribute('sg', 'sec1', 'optimized_for', 'search');
end;
Notes
Like CTX_DDL.SET_ATTRIBUTE, this procedure issues a commit.
Related Topic
See also the “Searching Document Sections in Oracle Text” chapter of Oracle Text Application Developer’s Guide.