Skip to main content

Administrating MarkLogic Server

Configuring a New Path or Root Field

Use the Admin Interface to add a new field configuration to a database:

  1. Navigate to and click the database for which you want to create a field, either from one of the summary tables or in the left tree menu.

  2. Under the database in which you want to create the field, click the Fields link. The Field Summary page appears:

    fieldsummary_v10.gif
  3. Click the Create tab. The Create Field in Database page appears.

  4. Enter a name for the field.

  5. By default, the field type is path. If creating a path field, enter the path expression. If you want to boost or lower the relevance contribution for matches within this path, specify a weight other than the default of 1.0. Weights greater than 1.0 will boost the relevance contribution and weights lower than 1.0 will lower the contribution. If you are defining multiple paths, click More Items.

    field-type-path_v10.gif
  6. Enter as many paths as you need.

    field-type-path2_v10.gif
  7. [OPTIONAL] Create any Field Range Indexes or Tokenizer overrides. You can also go back and add these later.

  8. If you want the field to include any extra index options from the database, or if you want to remove some index options from the field, check or uncheck those index settings. Index settings shown in bold indicate the setting is inherited from the database setting. You can uncheck an inherited index setting to not inherit the setting from the database-level configuration. For details, see Understanding the Index Option Configuration.

    fieldcreate_v10.gif
  9. Alternately, if creating a root field, set the field type to root. Note that in most cases, a path field will give you everything you need, and you are not likely to need to create a root field.

    field-type-root_v10.gif
  10. If you want the root field to include the root element of the document, even if it is not explicitly included, click the true button for include document root. Typically, you leave this set to the default of false, unless your field will include most of the elements in the database.

    field-root_v10.gif
  11. Click OK. The configuration page with the field appears, adding the following parts to the bottom of the configuration page:

    fieldbottom_v10.gif
  12. If you want to add a word lexicon for the field, enter the collation URI next in the add text box. The URI for the UCA Default Collation, http://marklogic.com/collation/, is useful for many applications. For details on collations, see Language Support in MarkLogic Server in the Search Developer’s Guide. Click the OK button to add the field word lexicon (if you want to create one). If you want to create other field word lexicons with different collations, repeat this step specifying a different collation URI for the new lexicon.

  13. Click the Includes tab to specify elements to include in the field.

    fieldinclude_v10.gif
  14. On the Included Element page, specify a local name for the element to include. If the element is in a namespace, specify the namespace URI for the element to include.

  15. [OPTIONAL] If you want to boost or lower the relevance contribution for matches within this element, specify a weight other than the default of 1.0. Weights greater than 1.0 will boost the relevance contribution and weights lower than 1.0 will lower the contribution.

  16. [OPTIONAL] If you want to only include elements that have an attribute with a specified value, enter the attribute namespace URI (if needed), the attribute local name, and a value for the attribute. Then only elements containing attributes with the specified value will be included. You must specify the exact value; no wildcard characters are used.

  17. When you have specified everything for this element, click OK.

  18. Repeat Step 13 - Step 17 for each element you want to include.

  19. If you want to exclude any elements from the field, click the Excludes tab.

  20. Enter the namespace URI (if needed) and the local name for the excluded element.

    fieldexcludes_v10.gif
  21. [OPTIONAL] If you want to only exclude elements that have an attribute with a specified value, enter the attribute namespace URI (if needed), the attribute local name, and a value for the attribute. Then only elements containing attributes with the specified value will be excluded. You must specify the exact value; no wildcard characters are used.

  22. Click OK.

  23. Repeat Step 19 - Step 22 for each element you want to exclude.

  24. You can delete any included or excluded fields from the tables at the bottom of the field configuration page.

    fielddelete_v10.gif