Skip to main content

Administrating MarkLogic Server

Defining Attribute Word Lexicons

To define a lexicon for an attribute of a particular element, follow these steps:

  1. Click Databases in the left tree menu. A list of databases appears.

  2. Click your target database.

  3. Under the selected database, click Attribute Word Lexicons.

  4. Click the Add tab.

  5. In the Parent Namespace Uri field, enter the namespace URI of the XML element that contains the attribute you want to index into the field.

    Every XML element is associated with a namespace. For the description of the element to be precise, you must specify the namespace of the XML element. The asterisk (*) cannot be used to indicate namespace independence. Leaving the Parent Namespace Uri field blank specifies the universal unnamed namespace.

  6. Enter the element name in the Parent Localname field.

    The local name is the name of the XML element that contains the attribute to be indexed. If you have more than one element in the same namespace that contains the attribute you want to index, you can provide a comma-separated list of element names.

  7. Enter the namespace URI of the attribute that you want to index into the Namespace Uri field.

    Every XML attribute is associated with a namespace. For the description of the attribute to be precise, you must specify the namespace of the XML attribute. The asterisk (*) cannot be used to indicate namespace independence. Leaving the Namespace URI field blank specifies the universal unnamed namespace.

  8. Enter the attribute name into the Localname field.

    The local name is the name of the XML attribute to be indexed. If you have more than one attribute in the same namespace within the specified parent element(s) that you want to index, you can provide a comma-separated list of attribute names.

  9. The collation box appears with a default collation. If you want the lexicon to use a different collation than the default, enter the collation URI into the Collation field. Click the Collation Builder button to use a wizard that constructs the collation URI for you. For details about collations, see the Language Support in MarkLogic Server in the Search Developer’s Guide.

  10. To add more element-attribute word lexicons, click More Items and repeat Step 5 - Step 9 for each attribute index as needed.

  11. Scroll to the top or bottom and click OK.

The new attribute index or attribute word lexicon is added to the database. These rules are applied to XML documents loaded into the specified database from this point on.

Note

If you have reindexing enabled for the database and you specify an element-attribute pair that exists in a document, reindexing will run in the background. When the reindexing is complete, the new index will become available to queries.