MarkLogic 12 Product Documentation
admin.databaseIndexExcludedPath

admin.databaseIndexExcludedPath(
   path-expression as String,
   collections as String[],
   directories as String[]
) as element(db.excludedPath)

Summary

This function constructs an index-excluded-path specification. Excluded paths allow users to exclude specific parts of documents from being indexed, reducing resource consumption for content that does not need to be searched.

Parameters
path-expression A valid and indexable XPath expression identifying the content to be excluded from indexing.
collections A set of collection URIs.
directories A set of directory URIs.

Example

  
  const admin = require('/MarkLogic/admin.xqy');

  admin.databaseIndexExcludedPath("/root/embeddings", 
                                   ["vector", "vector-json"], 
                                   ["/vec/"])
  =>
    <excluded-path xmlns="http://marklogic.com/xdmp/database">
      <excluded-path-expression>/root/embeddings</excluded-path-expression>
      <excluded-collections>
        <excluded-collection>vector</excluded-collection>
        <excluded-collection>vector-json</excluded-collection>
      </excluded-collections>
      <excluded-directories>
        <excluded-directory>/vec/</excluded-directory>
      </excluded-directories>
    </excluded-path>
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy