Skip to main content

Administrating MarkLogic Server

Defining Element Word Lexicons

To define a lexicon for an XML element or JSON property, 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. Click the Element Word Lexicons icon in the tree menu, under the selected database.

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

    el-word-lex-add_v10.gif
  6. If you are defining a lexicon on an XML element, enter the namespace URI of the XML element into the 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 namespace uri field blank specifies the universal unnamed namespace.

  7. Enter the XML element or JSON property name into the localname field.

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

  8. 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 Language Support in MarkLogic Server in the Search Developer’s Guide.

  9. To add more word lexicons, click More Items and repeat Step 6 - Step 8 for each lexicon as needed.

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

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

Note

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