Loading TOC...

alert.makeConfig

alert.makeConfig(
   uri as String,
   name as String,
   description as String,
   options as Object
) as Object

Summary

Create an alerting configuration associated with a particular URI. The URI will be used to create a protected collection when the config is inserted into the database with alert.configInsert. This URI will also be used as a directory for all documents (config, actions, and rules) associated with the config.

Parameters
uri The URI for this alerting config.
name The name for this alerting configuration.
description A description for this alerting configuration.
options Additional options available to an alerting application for extra state.

Required Privileges

The alert-admin role is required to run this function (or all of the privileges in the alert-admin role).

Usage Notes

If you add the "unfiltered":"true" option to the $options parameter, it will cause all cts.search operations that use this config to run unfiltered. This applies to the functions in the Alerting API that use cts.search (for example, alert.findMatchingRules). The default is for them to run filtered. Unfiltered searches skip the filtering stage of query processing, relying on the index resolution for the accuracy of the results. The unfiltered option can give a performance boost to configurations whose index settings do not require results to be filtered.

Example

  const alert = require("/MarkLogic/alert.xqy");

  alert.makeConfig(
	 "http://acme.com/alert/message-board",
         "Message Board",
         "Alerting config for messages on the message board",
         {"unfiltered":"true"})
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.