A deep dive on deep search | Figma Blog (opens in new tab)
Figma’s deep search lets users find files by searching text inside them rather than relying on file names or metadata. Building it required extending infrastructure originally created for Design System Analytics to process .fig files stored in Amazon S3. Because analyzing large file trees is expensive, Figma accepted briefly stale results and processed deduplicated changes hourly.
Deep Search in a Browser-Based Product
- Figma’s web-based architecture provides detailed access to files and usage data.
- This enables features such as:
- Component usage analytics
- File-view frequency
- Inspection of file structure
- Searching content inside files
- Deep search builds on the browser’s collaboration and discoverability advantages.
Reusing Design System Analytics Infrastructure
- Design System Analytics already opened recently edited files, retrieved them from storage, and traversed their contents.
- Analytics extracted shared-library usage information.
- Deep search applies the same general workflow to extract text from Figma files.
- The existing file-analyzer worker platform provided support for computationally intensive, periodic processing.
Regular Search vs. Deep Search
- Regular search indexes database metadata, including:
- File name
- Creator
- Folder ID
- Team ID
- Its pipeline:
- Database changes are streamed into a messaging system.
- Search indexers retrieve current records.
- The metadata is indexed in Elasticsearch.
- Deep search cannot rely on database metadata because the actual file contents are stored as
.figdocuments in Amazon S3. - A
.figfile is represented as a tree of nodes, such as frames, rectangles, vectors, ellipses, and text objects, each with its own properties.
Managing the Cost of File Analysis
- Retrieving and traversing a complete Figma file is significantly more expensive than reading database records.
- Files may contain thousands of nodes, and users can trigger saves approximately every 30 seconds.
- Re-indexing every save would produce substantial duplicated computation.
- Figma therefore:
- Deduplicates file changes over one-hour windows.
- Sends changed files to file-analyzer workers.
- Allows deep-search results to be temporarily stale.
- This tradeoff reduces server workload while maintaining useful search functionality.
Deep search demonstrates how content-aware features require different infrastructure from conventional metadata search. Periodic, deduplicated processing offers a practical balance between timely results and the high computational cost of analyzing complete design files.