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. Click Databases in the left tree menu. A list of databases appears.

  2. Click your target database.

  3. Under the database in which you want to create the field, click the Fields link.

  4. Click the Create tab. The Create Field in Database page appears.

  5. Enter a name for the field.

  6. By default, the field type is paths. 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 field paths

    Note

    In most cases, a path field will give you everything you need. However, to create a root field, skip to Step 9.

  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 the appropriate settings under 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.

  9. Alternately, if creating a root field, set 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.

  10. In the Include Root field, If you want the root field to include the root element of the document, even if it is not explicitly included, click true to 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.

  11. Scroll to the bottom of the screen and click OK. An Included Elements and Excluded Elements section are added to the bottom of the screen.

  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.

  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.

  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 by clicking Delete.