Skip to main content

Administrating MarkLogic Server

Configuring Customized Word Query Settings

This section provides the procedure for customizing the word query settings. For details on what the meaning of the various configuration options in fields, see Understanding the Word Query Configuration. The following is the procedure for modifying the word query configuration for your database:

Note

When you modify the word query settings, those modifications apply to all queries that use the cts:word-query constructor, which is the default constructor for cts:search. If you want to be able to search on everything in a word query, but also want a special view of the content that includes and/or excludes some elements, consider creating a field instead of modifying the word query configuration. For details on fields, see Fields Database Settings.

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

  1. Access the Admin Interface in a browser.

  2. Navigate to and click the database for which you want to modify the word query configuration, either from one of the summary tables or in the left tree menu.

  3. Under the database in which you want to create the field, click the Word Query link. The Word Query Configuration page appears.

  4. If you want the word queries to include any extra index options from the database, check those index settings. Index settings shown in bold indicate the setting is inherited from the database setting. For details, see Understanding the Index Option Configuration.

  5. If you want the word queries to include the root element of the document, even if it is not explicitly included, leave the default of true for include document root button. Note that if you set this to false, you will need to include elements in the word query configuration in order to get any results from word queries. Typically, you would leave this set to true and choose some elements to explicitly exclude and some to explicitly include (optionally adding a scoring weight and/or an attribute value constraint).

  6. Click OK to save any changes you made. The configuration page refreshes with after the changes have been made to the MarkLogic Server configuration.

  7. If you want to exclude any elements from word queries, click the Excludes tab.

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

  9. Click OK.

  10. Repeat Step 7 - Step 9 for each element you want to exclude.

  11. Click the Includes tab to specify elements to include in the word query.

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

  13. [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.

  14. [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.

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

  16. Repeat Step 11 - Step 15 for each element you want to include.

  17. You can delete any included or excluded fields from the tables at the bottom of the Field Configuration page: