You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
The projectdoc Toolbox makes it easy to search for documents with a given set of constraints in a document tree with a given root.
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 the artificial properties 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
Name |
Short Description |
| Tips on specifying search queries for Lucene. This also applies to projectdoc's query macros. |
| In addition to the properties specified in the document properties table, projectdoc provides additional properties drawn from Confluence or metadata. |