projectdoc Toolbox

The projectdoc Toolbox makes it easy to search for documents with a given set of constraints in a document tree with a given root.

Parent
Audience
Level of Experience
Expected Duration
15 min

This tip shows how users of the projectdoc Toolbox can constrain their searches to documents that have a given ancestor page.

Summary

If you need to constrain the search result to documents with a given ancestor, you can take advantage of artificial properties like AncestorNames and AncestorIds.

Usage Examples

The following examples can be used with macros that execute searches like the Display Table Macro or the Transclude Documents Macro.

Subtree Search

Suppose you have a Component document "Server" with documents for sub components. Now you need to list all documents of type View that are associated with the component or any of its subordinate documents.

To limit your search to all documents that have the document named "Server" as their ancestor add

$<AncestorNames>=[Server]

to your where clause.

To filter on the doctype View, you need to append another constraint so that the final where clause looks like this:

$<AncestorNames>=[This Root Page] AND Doctype=view

Search for own Descendants

If you need to list the descendants of a document on that document, you can use the AncestorIds property.This is especially helpful for template authors since the ID is unique, whereas the name might not be.

The projectdoc Toolbox adds the page identifier as artificial property. So the where clause for this search looks like this:

$<AncestorIds> = [${Page ID}]

Resources

Here is more information related to searches with the projectdoc Toolbox.

Search Tips
Tips on specifying search queries for Lucene. This also applies to projectdoc's query macros.
Artificial Properties
In addition to the properties specified in the document properties table, projectdoc provides additional properties drawn from Confluence or metadata.
Ancestor Queries
The projectdoc Toolbox makes it easy to search for documents with a given set of constraints in an ancestor context.