Special Sections

Special sections are not recognized by tags. Currently, sentence and paragraph are the only supported special sections, and they enable you to search for a combination of words within sentences or paragraphs.

The sentence and paragraph boundaries are determined by the lexer. For example, BASIC_LEXER recognizes sentence and paragraph section boundaries as follows:

Table 3 Sentence and Paragraph Section Boundaries for BASIC_LEXER

Special Section Boundary
SENTENCE
  • WORD/PUNCT/WHITESPACE

  • WORD/PUNCT/NEWLINE

PARAGRAPH
  • WORD/PUNCT/NEWLINE/WHITESPACE

  • WORD/PUNCT/NEWLINE/NEWLINE

If the lexer cannot recognize the boundaries, then no sentence or paragraph sections are indexed.

To add a special section, use the CTX_DDL.ADD_SPECIAL_SECTION procedure. For example, the following code enables searches within sentences in HTML documents:

begin
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
ctx_ddl.add_special_section('htmgroup', 'SENTENCE');
end;

To enable zone and sentence searches, add zone sections to the group. The following example adds the Headline zone section to the htmgroup section group:

begin
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
ctx_ddl.add_special_section('htmgroup', 'SENTENCE');
ctx_ddl.add_zone_section('htmgroup', 'Headline', 'H1');
end;