Special sections are not recognized by tags. Currently the only special sections supported are sentence and paragraph. This enables you to search for combination of words within sentences or paragraphs.
The sentence and paragraph boundaries are determined by the lexer. For example, the BASIC_LEXER
recognizes sentence and paragraph section boundaries as follows:
Table 8-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, 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 searching within sentences within HTML documents:
begin ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP'); ctx_ddl.add_special_section('htmgroup', 'SENTENCE'); end;
You can also add zone sections to the group to enable zone searching in addition to sentence searching. The following example adds the zone section Headline
to the section group htmgroup
:
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;