The projectdoc Toolbox makes it easy to search for documents with a given set of constraints in an ancestor context.
- Parent
- Audience
- Level of Experience
- Expected Duration
- 15 min
This tip shows how users of the projectdoc Toolbox for Confluence can constrain their searches to documents that have a property value that is in an ancestor context.
Ancestor Context
What is a property value in an ancestor context?
Documents can be set in a hierarchy. If documents are referenced as property values, the hierarchy of these documents may be of interest in queries.
It is important to note that we refer to the hierarchy of a property value of a document. The hierarchy the document is part of is not important for the ancestor context.
The ancestor context can be traversed from the root to the leaves (downstream) or from a node to its root (upstream).
Tags Example
Suppose you have a Tag document named 'Domain'. There you have subdocuments for 'Security', 'Performance', and 'Fault Tolerance'. Child tags of 'Security' are 'SSL', 'Authentication',and 'Authorization'.

Suppose you have created these topics, associated with the given tags:
| Topic Title | Tags |
|---|---|
| Secure Passwords | Authentication |
| Transport Security | SSL |
| Role Model for Application A | Authorization |
| Security Basics for Dummies | Security |
Now you want to list all documents related to 'Security':
$<Tags>=°Security°
This selects all documents tagged with 'Security' or one of its descendants.
Roles Example
Suppose you have Role documents for Customer, User, and Operations. Operations has child documents System Admin, Application Admin, and Support. Application Admin is subdivided into Application A Admin, Application B Admin, and Application C Admin.

Suppose further that you provide documentation for people in those roles. Therefore you create instances of the doctype Topic. A topic provides a document property called Audience to define the roles this topic is relevant for.
| Topic Title | Audience |
|---|---|
| Ops Basics | Operations |
| Support Topics | Support |
| Common Configuration Options for Applications | Application Admin |
| Configuration Options for Application B | Application B Admin |
Now you want to list all documents relevant for Application Admins. This should include all generic documents, but not documents for specific applications.
$<Audience>=^Application Admin^
This will select all documents for the Audience 'Application Admin' and its ancestors (Operations and Role).
Ancestor Definition
Ancestor queries are based on the property information in the blueprint of a document type. Document authors cannot define hierarchies based on document instances. It is the job of template authors to do this, using the property parameter of the Name List Macro (or its relatives).
If you encounter unexpected results with upstream queries, you may want to refresh the doctype cache. This cache collects the relation information from the blueprints. Please refer to Cache Refresh Actions for details on how to access this cache.
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.
- Subtree Queries
- The projectdoc Toolbox makes it easy to search for documents with a given set of constraints in a document tree with a given root.