| This guide is currently still under development, some sections may be incomplete, please leave a comment if there is anything that is a bit confusing or if there are anything you wish to contribute to this guide. |
Table of Contents
Description
This guide details the ways in which you can search Confluence based on the metadata of Confluence content, and is targeted for advanced users of Confluence who wish to extend the capabilities of the search system beyond the standard notations.
| For normal usage of the Confluence searching system, please refer to the Atlassian documentation for the Confluence Search Syntax. |
| For a list of the currently available search fields, please refer to the Atlassian documentation for Confluence Search Fields. |
Advanced Searching
General Syntax
The general syntax used for searching metadata is quite straight-forward, simply use the field name followed by a colon, then followed by the search criteria, which varies depending on the data type of what you are searching for (refer to Searchable Fields for more information about the searching data types and what fields are available.
Example
If you want to search for all content with the label "mylabel", then simply put the field key "labelText", then a colon, and the label, note that with labels, the search is case sensitive, so you have to put "mylabel".
labelText:mylabel
Searchable Fields
Content Types
Personal Information
| Pages
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
News
|
Attachments
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mail Items
| Comments
|
Searching Types
Basics
This applies to all search types, some characters have special meanings or are not allowed, for example * and ? are reserved for wildcard/branched searching and ~ (which is used in personal spaces) is not allowed, in these cases you will have to escape the character by preceding it with a backslash ()
Date Type
To search on date types, you MUST to use the Range Searching syntax, the date format in Confluence by default is: MM/dd/yy, if you want to obtain content for a SINGLE day, you will need to specify an inclusive ranged search where the start of the range is equal to the end of the range.
Example
[10/26/08 TO 10/26/08] specifies anything on the 26th of October, 2008.
Free Text Type
This is basically identical to the standard usage of the quick search functionality in Confluence, it will match the criteria set by this type with any word contained within the specified field. This is not case sensitive
Example
title:confluence - Brings back all content with a title that contains the word "confluence".
contentBody:confluence - Brings back all content which contains the word "confluence" in its body.
Exact Text Type
These types does a very strict search, all results will be IDENTICAL to the string used for the search, it is case sensitive and does not accept partial matches.
Example
labelText:confluence_search - brings back all content with the "confluence_search" label
spaceKey:DOC - brings back all content which are part of the Space with the space key "DOC"
User Type
Searches on the username of the user, it is tokenised so you can search for parts of the name (for users with spaces in their username), note that this is not a case sensitive search.
You can also specify ranges to search though, please refer to Range Searching for more details.
Example
username:[aa TO az] - Gets all results which the username contains a token which starts with "aa" to "az"
lastModifiers:[aa TO az] - Gets all content where the last modifier's username contains a token which starts with "aa" to "az"
creatorName:[aa TO az] - Gets all content where the creator's username contains a token which starts with "aa" to "az"
Content Type
This is basically exactly like the "What" dropdown list in the Confluence search results screen, used to filter content by its type, the valid values are:
| Value | Type Filter |
|---|---|
| page | Pages |
| blogpost | New Items |
| comment | Comments |
| attachment | Attachments |
| userinfo | profiles |
| spacedesc | Space Descriptions |
| personalspacedesc | Personal Space Descriptions |
Example
type:comment - Filters all results to include comments ONLY
Sizes Type
This lets you filter on the size of attachments in Confluence, all numbers are measured in bytes and can be used in conjunction with the Range Searching functionality to grab all attachments which are between certain sizes.
Example
filesize:[0 TO 1000] - Gets all attachments that are between 0 and 1000 bytes
Boolean Type
Boolean types are the most straightforward, values can ONLY be true or false.
Example
hasPersonalSpace:true - Gets all users which has a personal space
Special Search Syntax
Range Searching
This is one of the more useful functionalities of the Confluence searcher, the ability to specify ranges for your search, these ranges can be anything, numbers, dates, even strings, the syntax is:
start TO end
Where start is the start of the range to search through and end is the end of the range to search through, please note that the TO in the middle of the 2 values MUST be capitalized, otherwise an error occurs.
There is one other thing required for ranged searches, and that is the type of the ranged search, this can be inclusive or exclusive, to specify an inclusive search, put your search query in square brackets ([]) and for exclusive, put your search query in curly brackets ({}).
Example
So lets say you want to find all content CREATED in 2008, the query to use would be:
created:[1/1/08 TO 12/31/08]