Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
|
Using interMedia Text to Search and Retrieve Data from XML Documents, 18 of 22
To set the preference's attributes for XML_SECTION_GROUP, use the following procedures:
To set the preference's attributes for AUTO_SECTION_GROUP, use the following procedures:
There are corresponding CTX_DDL.drop sections and CTX_DDL.remove section syntax.
The syntax for CTX_DDL.add_zone_section follows:
CTX_DDL.Add_Zone_Section ( group_name => 'my_section_group' /* whatever you called it above */ section_name => 'author' /* what you want to call this section */ tag => 'my_tag' /* what represents it in XML */ );
where 'my_tag' implies opening with <my_tag> and closing with </my_tag>.
add_zone_section guidelines are listed here:
The syntax for CTX_DDL.add_attr_section follows:
CTX_DDL.Add_Attr_Section ( /* call this as many times as you need to describe the attribute sections */ group_name => 'my_section_group' /* whatever you did call it above */ section_name => 'author' /* what you want to call this section */ tag => 'my_tag' /* what represents it in XML */ );
where 'my_tag' implies opening with <my_tag> and closing with </my_tag>.
add_attr_section guidelines are listed here:
The more sections you add to your index, the longer your search will take.
add_attr_section adds an attribute section to an XML section group. This procedure is useful for defining attributes in XML documents as sections. This allows you to search XML attribute text with the WITHIN operator.
The section_name:
The tag specifies the name of the attribute in tag@attr format. This is case-sensitive.
The syntax for CTX_DDL.add_field_section follows:
CTX_DDL.Add_Field_Section ( group_name => 'my_section_group' /* whatever you called it above */ section_name => 'qq' /* what you want to call this section */ tag => 'my_tag' /* what represents it in XML */ ); visible => TRUE or FALSE );
add_field_section guidelines are listed here:
Consider again the query, "... CONTAINS cat...". You may not get a hit if you use VISIBLE=TRUE. If VISIBLE=FALSE, the index will be smaller. You may lose some functionality but your performance will be improved, compared to if you set VISIBLE =TRUE.
Attribute section differs from field section in the following ways:
WHERE CONTAINS (..., '... jeeves',...)...
does NOT find the document, somewhat like field sections. Unlike field sections, however, attribute section within searches can distinguish between occurrences. Consider the document:
<comment author="jeeves"> I really like interMedia Text </comment> <comment author="bertram"> Me too </comment>
the query:
WHERE CONTAINS (...,'(cryil and bertram) WITHIN author', ...)...
will NOT find the document, because "jeeves" and "bertram" do not occur within the SAME attribute text.
<!DOCTYPE foo [ <!ELEMENT foo (bar)> <!ELEMENT bar (#PCDATA)>
<!ATTLIST bar rev CDATA "8i">]> <foo> <bar>whatever</bar> </foo>
and attribute section:
ctx_ddl.add_attr_section('mysg','barrev','bar@rev');
the query:
8i within barrev does not hit the document, although in XML semantics, the "bar" element has a default value for its "rev" attribute.
The syntax for CTX_DDL.add_special_section follows:
CTX_DDL.Add_Special_Section ( group_name => 'my_section_group' /* whatever you called it above */ section_name => 'qq' /* what you want to call this section */ );
add_special_section guidelines are listed here:
Here the tag option is not present. A section not defined with an open and close tag has an implicit definition.Use this section when your document is composed, for example, of mostly non-tagged sentences and paragraphs that you need to search. These are explicitly defined.
For example, if your query could be "... CONTAINS cat and dog WITHIN sentence"...
CtX_DDL.Add_Stop_Section ( group_name => 'my_section_group' /* whatever you called it above */ section_name => 'qq' /* what you want to call this section */ );
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|