Skip to main content

Administrating MarkLogic Server

Creating a Range Index on a Field

You can create a range index on a field for faster searches on the field data. You must first create a field before creating a range index on the field. The usual trade-offs between query speed and ingestion speed and server resources described in Understanding Range Indexes apply to field range index.

To create a range index on a field, follow these steps:

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

  2. Click your target database.

  3. Click Field Range Indexes in the left tree menu.

  4. Click the Add tab.

  5. Select a value from the Scalar Type field.

  6. Enter the name of an existing field.

  7. In the Range Value Positions field, select true if you want the index to store position data. (Metadata fields are positionless, so position settings have no impact.)

  8. In the Invalid Values list, select reject to prevent the ingestion of documents with fields that do not match the type specified for the range index. Select ignore to allow the ingestion of non-matching documents.

  9. Click OK.

The index is created. If the reindexer enable setting is true for that database, then reindexing will begin immediately. The new index is not available for use in range and lexicon queries until the reindexing operation is complete.