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 the Databases icon on the left tree menu.

  2. Locate the database for which you want to create a lexicon, either in the tree menu or in the Database Summary table.

  3. Click the name of the database for which you want to create a lexicon.

  4. Under the selected database, click the Attribute Word Lexicon icon.

  5. Click the Add tab. The Element-Attribute Word Lexicon Configuration page appears:

    att-word-lex_v10.gif
  6. Enter the namespace URI of the XML element that contains the attribute you want to index into the Parent Namespace URI 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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. You can click the Collation Builder button for a wizard that constructs the collation URI for you based on the language and other parameters you enter. For details about collations, see the Language Support in MarkLogic Server in the Search Developer’s Guide.

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

  12. 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.