
admin.databaseIndexExcludedPath( path-expression as String, collections as String[], directories as String[] ) as element(db.excludedPath)
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. |
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>