Creating date indexes
You create date indexes in the Index Definition document. To be able to do so, you must check the Index Definition document out and save it on your hard drive.
Date indexes index the whole content of XML elements or attributes that contain dates.
TEXTML Server can index dates from year 1 to year 9999.
To ensure that the indexing engine recognizes dates accurately, you can specify:
- date formats
- validation rules
- specific years as turning point between centuries, for years expressed with two digits.
All formats are listed in the DATETIME_FORMATS.XML document located in TEXTML Server’s default repository, as a system document.
For conceptual information on date indexes, refer to the TEXTML Server Administration Guide.
To create a date index:
- Open the Index Definition document with any XML editor.
- Under the root element <indexdefinition> add an <indexes> element, which will hold each defined index.
Under <indexes> add an <index> element, which represents one index.
Specify the name of the index in the NAME attribute of <index>.
<index NAME="My Date Index"> </index>
- Under <index> specify the type of index you are defining. To define a date index add a <dateindex> element. You may add an <admindescription> element to enter a description for your index.
- Under <dateindex> add a <dateindexproperties> element to specify date properties.
- Under <dateindex> add an <elements> element to hold the list of elements whose content you want indexed.
Under <elements> add an <element> element, which represents one XML
element of your documents whose content you want indexed.
You may add as many <element> elements as XML elements you want indexed.
- Specify the XPath of the element as value to the XPATH attribute of <element>
You may specify an integer or INFINITE as value to the DEPTH attribute
to specify to which extend the content must be indexed.
0 means the content of the element itself is indexed, his children are ignored. 1 means the content of the element and its immediate child are indexed. 2 refers to the next level of child elements, and so on. INFINITE means that the content of all children of the element must be indexed. If you do not specify a depth, the default INFINITE value is implied.
<elements> <element XPATH="//prolog/created" DEPTH="0"/> </elements>
- If you want to add date properties for a specific element only, add a <formats> element under <element>.