Custom Search Field Examples
Custom search fields are a useful tool for administrators who want to track engagement with their content on a Confluence instance. This feature allows administrators to create custom search fields that match their specific needs and use cases, enabling them to quickly and easily search for and retrieve data that can help them track engagement with their content.
Custom Search Fields are components to CQL statements. For help with CQL, visit the Guide to CQL.
Administrators can use this feature to create custom search fields that help them track the popularity, activity, and engagement of their content on a Confluence site, providing them with valuable insights and information about the performance of their content. The examples on this page show ways to do that.
Included Code Snippets
All of the following code samples are available for pages on Administration > Custom Search Fields > Create Custom Search Fields > Show Snippets. Different scripts appear depending on which Assign Field To value is selected.
- Space
- Store the number of pages a space has
- Store who last modified the space
- Attachment
- Store a value if an attachment is a pdf created by admin
- Stores the size of an attachment
- Comment
- Store the number of likes a comment has
- Store the size of the comment body
- Store the number of outgoing links a comment has
- Page
- Store who last modified the page
- Store the size of all attachments a page has
- Store the year a page was created
- Store the number of incoming links a page has
- Store the number of likes a page has
- Store the number of comments a page has
- Store the number of attachments a page has
Number of comments on a page
You can sort pages by number of comments or likes to track the level of engagement and activity on a page. This can be useful if you want to measure the popularity of a page among users, and it can help to identify pages that are performing well or poorly.
- Enter a Note, like Number of comments on a page, to identify the custom search field for future use.
- Enter a Field Name, like NumberOfComments
- Select Number for the Value Type.
- Select Page for Assign Field To.
- Select Show Snippets once the Field Value field appears.
- Select Store the number of comments a page has and paste it into the field.
- Select Add.
To sort pages by the number of comments in your instance, follow these steps:
- Navigate to search.
- Enter type = page ORDER BY NumberOfComments ASC.
- Search and view the results.
Number of times a page has been linked or referenced by other pages
You can sort pages based on the number of times they have been linked to or referenced by other pages to track the popularity of a page among users. This can be useful if you want to measure the impact or influence of a page on a Confluence site, and it can help to identify pages that are important or relevant to other users.
- Enter a Note, like Number of times a page has been linked or referenced by other pages, to identify the custom search field for future use.
- Enter a Field Name, like NumberOfLinksAndReferences.
- Select Number for the Value Type.
- Select Page for Assign Field To.
- Select Show Snippets once the Field Value field appears.
- Select Store the number of incoming links a page has and paste it into the field.
- Select Add.
To sort pages based on the number of incoming links a page has in your instance, follow these steps:
- Navigate to search.
- Enter type = page ORDER BY NumberOfLinksAndReferences ASC.
- Search and view the results.
Number of attachments on a page
You can sort pages by the number of attachments they have, which helps you measure engagement with pages. Pages with a high level of engagement could have a large number of attachments because they are popular or frequently accessed by users.
- Enter a Note, like Number of attachments on a page, to identify the custom search field for future use.
- Enter a Field Name, like NumberOfAttachments.
- Select Number for the Value Type.
- Select Page for Assign Field To.
- Select Show Snippets once the Field Value field appears.
- Select Store the number of attachments a page has and paste it into the field.
- Select Add.
To sort the pages by the number of attachments they have, follow these steps:
- Navigate to search.
- Enter type = page ORDER BY NumberOfAttachments ASC.
- Search and view the results.
Number of pages in a space
You can track which spaces have the most user engagement by sorting them by the number of pages.
- Enter a Note, like Number of pages in a space, to identify the custom search field for future use.
- Enter a Field Name, like NumberOfPages.
- Select Number for the Value Type.
- Select Space for Assign Field To.
- Select Show Snippets once the Field Value field appears.
- Select Store the number of pages a space has and paste it into the field.
- Select Add.
To sort the spaces by the number of pages in each one, follow these steps:
- Navigate to search.
- Enter type = space ORDER BY NumberOfPages ASC.
- Search and view the results.