Product DocsMenu

Adding and Modifying XML Elements to a Document Definition

Each XML element details the content of a single XML document type (ex.: a thesaurus or bank of employee resumes). It lists the fields from which CES extracts information. Note that all document types found in a repository must have a corresponding element (otherwise, they are not indexed).

To add an XML element

  1. On the Coveo server, access the Administration Tool (see Opening the Administration Tool).

  2. Select Configuration > XML.

  3. In the XML Document Definitions page, click the appropriate XML document definition.

  4. In the Record Definitions page, click Add.

  5. In the Add a Record Definition page:

    1. In the Root XML Path box, enter the path of the XML node corresponding to the document (in the form RootElementNode/ElementNode). Each root XML path must be unique within an XML document definition.

    2. Under Properties, enter XML relative paths in the form %[xmlNodePath@attributeName] to build the value for each property. 

      For a description of the property fields, refer to the table below.

      Property Definition
      Title Identifies the title of the document.

      Example: If %[@Title] is entered, CES searches for an XML node attribute entitled Title from which to extract the information.

      Author Identifies the author of the document.

      Example: If %[@Author] is entered, CES searches for an XML node attribute entitled Author from which to extract the information.

      Content Identifies the content of the document.

      Example: If %[@Description] is entered, CES searches for an XML node attribute entitled Description from which to extract the information.

      Summary Identifies the summary of the document.

      Example: If %[@Summary] is entered, CES searches for an XML node attribute entitled Summary from which to extract the information. If this field is left empty a summary is automatically extracted by CES.

      Date Identifies the date of the document (creation or modification date).

      Example: If %[@CreationDate] is entered, CES searches for an XML node attribute entitled CreationDate from which to extract the information. If those fields are left empty, the parent XML document date is issued.

      Address Identifies the link to open when a search result is clicked.

      Example: If %[@URI] is entered, CES searches for an XML node attribute entitled URI from which to extract the information.

      When a user clicks the search result, the value of the metadata is used to open the document. If this field is left empty, the parent XML document is opened when the search result is clicked.

      Unique ID Only identifies the record within the XML document. This information is used to construct the URL of the document and is useful to locate a particular record on big XML documents. If this field is left empty, a sequential number is used as the unique ID.

      Example: If %[@ID] is entered, CES searches for an XML node attribute entitled ID from which to extract the information.

    3. In the Date Format box, enter the format of the dates contained in the XML document (see Specifying a Date Format).

    4. Click Save.

Example: The following XML document regroups employee resumes. Its root element is Department and its record node is Employee; therefore, its root XML path is Department/Employee.

<?xml version="1.0" ?>
<Department>
  <Employee ID="123" URI="http://svr-db/companyinfo/employees?ID=123">
    <CreatedBy>Mary Smith</CreatedBy>
    <Name>
      <First>Jack</First>
      <Last>Jackson</Last>
    </Name>
    <Address Street="123, Main Avenue" City="Cityville" Zip="12345"/>
    <HiringDate>2004/02/01 00:00:00</HiringDate>
    <Resume>A dynamic administrator with a strong record of achievement combining skills in diverse areas of organizational development, group/staff leadership, program development and project management, building partnerships and community relations. Experienced in the operation of a successful consulting practice, the turn around of a second small business, and the administration of several non-profit organizations. Highly motivated and intuitive, effective at human relations, and able to manage both time and resources to maximize productivity</Resume>
  </Employee>
  <Employee ID="456">
    <CreatedBy>Mary Smith</CreatedBy>
    <Name>
      <First>John</First>
      <Last>Johnson</Last>
    </Name>
    <Address Street="123, Generic Street" City="Urbanville" Zip="12345"/>
    <HiringDate>2003/02/07 00:00:00</HiringDate>
    <Resume>Twelve years successful experience in direct sales of a range of products and services. Extensive practical hands-on experience as co-owner and manager of a small business. Motivated and enthusiastic about developing good relations with clients. Effective working alone or as a cooperative team member. Professional in appearance and presentation.</Resume>
  </Employee>
</Department>  

The XML element corresponding to this document is:

 

What's Next?

Rebuild the source (see Applying an Action to a Collection or a Source).

People who viewed this topic also viewed