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

  2. Click your target database.

  3. Under the target database, click Word Query.

  4. in the Include Root field, leave the default setting of true selected If you want the word query to include the root element of the document,

    Note

    If you select 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).

  5. Under Index Settings, check any index settings to include in the word query. Index settings shown in bold indicate the setting is inherited from the database setting. For details, see Understanding the Index Option Configuration.

  6. Click OK to save any changes .

  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, in the Weight field, 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, complete the Attribute Namespace Uri (if needed), the Attribute Localname, and Attribute Value fields. 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 configuration page.