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. Navigate to and click the database for which you want to create a field range index, either from one of the summary tables or in the left tree menu.

  2. Click Field Range Index in the left tree menu.

    Note

    Creating a Range Index automatically configures a Field Range Index on the field being created or updated.

  3. Click the Add tab. The Add Field Range Indexes page appears.

  4. Select the type for the range index.

  5. Enter the name of an existing field.

  6. Optionally, specify if you want the index to store position data. (Metadata fields are positionless, so position settings have no impact.)

  7. For Invalid Values, 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.

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