Loading TOC...

tieredstorage.partitionSetExclusionEnabled

tieredstorage.partitionSetExclusionEnabled(
   schema-database-id as (Number|String),
   partition-number as Number,
   safe-to-exclude as Boolean
) as null

Summary

By default, when a search query is given to MarkLogic, all query partitions are searched, regardless of the query assignment policy set on the partition. This function enables you to avoid this overhead, so that the query partition will not be searched if the search query does not match the query assignment policy set for that partition.

For details, see Isolating a Query Partition in the Administrator's Guide

Parameters
schema-database-id The schema database used by the content database holding the query partition.
partition-number The number of the query partition.
safe-to-exclude Set to fn:true() to enable exclusion or fn:false() (the default) to disable.

Usage Notes

The query partition must have a query set (for example, by tieredstorage:partition-set-query) before enabling partition-set-safe-to-exclude. If no query is configured for the partition, TS-NOPARTITIONQUERY is thrown.

Example

// Enables safe-to-exclude on Query Partition 3 in the Schemas database. 

const ts = require('/MarkLogic/tieredstorage');

declareUpdate();
ts.partitionSetExclusionEnabled(
   xdmp.database('Schemas'),
   3,
   true
);
   

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