Field Section
A field section is similar to a zone section in that it is a region of text delimited by start and end tags. Field sections are more efficient from zone sections and are different than zone sections in that the region is indexed separately from the rest of the document. You can create an unlimited number of field sections.
Because field sections are indexed differently, you can also get better query performance over zone sections when a large number of documents are indexed.
Field sections are more suited to a single occurrence of a section in a document, such as a field in a news header. Field sections can also be made visible to the rest of the document.
Unlike zone sections, field sections have the following restrictions:
-
They cannot overlap.
-
They cannot repeat.
-
They cannot nest.
Visible and Invisible Field Sections
By default, field sections are indexed as a sub-document separate from the rest of the document. As such, field sections are invisible to the surrounding text and can only be queried by explicitly naming the section in the WITHIN clause.
You can make field sections visible if you want the text within the field section to be indexed as part of the enclosing document. You can query text within a visible field section with or without the WITHIN operator.
The following example shows the difference using invisible and visible field sections. The code defines a basicgroup section group of the BASIC_SECTION_GROUP type. It then creates a field section in basicgroup called Author for the <A> tag. It also sets the visible flag to FALSE to create an invisible section.
begin
ctx_ddl.create_section_group('basicgroup', 'BASIC_SECTION_GROUP');
ctx_ddl.add_field_section('basicgroup', 'Author', 'A', FALSE);
end;
Because the Author field section is not visible, to find text within the Author section, you must use the WITHIN operator.
'(Martin Luther King) WITHIN Author'
A query ofMartin Luther King without the WITHIN operator does not return instances of this term in field sections. If you want to query text within field sections without specifying WITHIN, you must set the visible flag to TRUE when you create the section, as follows:
begin
ctx_ddl.add_field_section('basicgroup', 'Author', 'A', TRUE);
end;
Nested Field Sections
You cannot nest field sections. For example, if you define a field section to start with <TITLE> and define another field section to start with <FOO>, you cannot nest the two sections as follows:
<TITLE> dog <FOO> cat </FOO> </TITLE>
To work with nested sections, define them as zone sections.
Repeated Field Sections
Repeated field sections are allowed, but WITHIN queries treat them as a single section. Here is an example of a repeated field section in a document:
<TITLE> cat </TITLE>
<TITLE> dog </TITLE>
The query dog and cat within title returns the document, even though these words occur in different sections.
To have WITHIN queries distinguish repeated sections, define them as zone sections.