How to limit search to a file type in Confluence
Problem
Too many attachments uploaded
User wants to search for files with a specific file type (e.g. PDF, DOCX, etc.)
User wants to search for the content within the attachments of a specific file type
User wants to search files contained in the current page
Proposed Solution
To use the file.extension to limit the result of search
Example
1. The image below shows how to search for a list of jpeg files which the file name contains the keyword “Figure”
CQL:
sitesearch ~ "file.extension:jpeg" AND title ~ $$query$$
2. The image below shows how to search for a list of pdf files which the content contains the keyword “guide”
CQL:
sitesearch ~ "file.extension:pdf" AND text ~ $$query$$
3. The image below shows how to search attachments contained in the current page
This CQL includes the attachments in the child pages
CQL:
container = $$id$$ AND type = attachment AND text ~ $$query$$
This CQL excludes the attachments in the child pages
CQL:
container = $$id$$ AND container not in(4096179,4096078) AND type = attachment AND text ~ $$query$$