search_files
Search for terms in files using advanced query syntax, filtering by file type, properties, and directory to locate specific content quickly.
Instructions
Search for terms in files using KDE baloosearch.
Query Syntax Examples:
Simple search: "project plan"
Multiple terms: "budget AND marketing" (finds files with both terms)
OR search: "report OR presentation" (finds files with either term)
Phrase search: ""strategic plan"" (finds exact phrase)
Exclusion: "financial -tax" (finds files with "financial" but not "tax")
Wildcard: "report*" (finds files with words starting with "report")
Property search: "Artist:"Coldplay"" (finds audio files by artist)
File type search: "type:Audio" (finds audio files)
Combined expressions: "(type:Audio AND Artist:"Coldplay") OR (type:Document AND subject:"music")"
Input Schema
Name | Required | Description | Default |
---|---|---|---|
directory | No | Limit search to specified directory (absolute path) | |
limit | No | Maximum number of results to return (default: 10) | |
offset | No | Offset from which to start the search (default: 0) | |
query | Yes | The search query terms. Supports advanced search syntax: - Basic search: Simple terms like "project plan" - AND queries: "budget AND marketing" (requires both terms) - OR queries: "report OR presentation" (requires either term) - NOT queries: "financial -tax" or "financial NOT tax" (excludes terms) - Phrase searches: "\"exact phrase\"" (matches exact phrases) - Wildcards: "report*" (matches partial words) - Property searches: "Artist:\"Coldplay\"" or "Author:\"Smith\"" - File type filters: "type:Audio", "type:Document", "type:Image", etc. - Grouping: Use parentheses "(term1 AND term2) OR term3" - Property comparisons: "rating>3", "modified>2024-01-01" Supported file types: - "Archive" (zip, tar, etc.) - "Folder" (directories) - "Audio" (mp3, wav, etc.) - "Video" (mp4, avi, etc.) - "Image" (jpg, png, etc.) - "Document" (pdf, doc, etc.) - "Spreadsheet" (xls, xlsx, etc.) - "Presentation" (ppt, pptx, etc.) - "Text" (txt, etc.) Common properties for all files: - filename (name of the file) - modified (last modification date) - mimetype (MIME type of file) - tags (user-defined tags) - rating (numeric rating 0-10) - userComment (user comments) Audio-specific properties: - Artist, Album, AlbumArtist, Composer, Lyricist - Genre, Duration, BitRate, Channels, SampleRate - TrackNumber, ReleaseYear, Comment Document-specific properties: - Author, Title, Subject, Keywords - PageCount, WordCount, LineCount - Language, Copyright, Publisher - CreationDate, Generator Media-specific properties (Video/Images): - Width, Height, AspectRatio, FrameRate Image-specific properties: - ImageMake, ImageModel, ImageDateTime - PhotoFlash, PhotoFNumber, PhotoISOSpeedRatings - PhotoGpsLatitude, PhotoGpsLongitude, PhotoGpsAltitude | |
type | No | Type of data to be searched. Common types include: - "Archive" (zip, tar, etc.) - "Folder" (directories) - "Audio" (mp3, wav, etc.) - "Video" (mp4, avi, etc.) - "Image" (jpg, png, etc.) - "Document" (pdf, doc, etc.) - "Spreadsheet" (xls, xlsx, etc.) - "Presentation" (ppt, pptx, etc.) - "Text" (txt, etc.) Note: This parameter is an alternative to using "type:" in the query. |