Registry::Docset
Represents a single documentation set with metadata, symbol index, and search capabilities. Location:src/libs/registry/docset.h
Docset Types
Fromsrc/libs/registry/docset.h:71-75:
Public Interface
Internal Data
Fromsrc/libs/registry/docset.h:87-108:
Metadata Loading
Docsets use Dash-compatible format:- Info.plist: Property list with docset metadata
- meta.json: Additional Zeal-specific metadata
- icon.*: Docset icon in various formats
src/libs/registry/docset.cpp:41-51, the Info.plist keys include:
SQLite Database Schema
Docsets use SQLite databases for symbol storage and search. The database typically contains:- searchIndex table: Main symbol index with name, type, and path columns
- Custom indexes created by Zeal for performance optimization
Registry::DocsetRegistry
Manages the collection of all installed docsets. Location:src/libs/registry/docsetregistry.h
Interface
Internal Structure
Fromsrc/libs/registry/docsetregistry.h:66-74:
Search Threading
Search operations can be performed asynchronously:- Uses a dedicated thread (
m_thread) for intensive searches CancellationTokenallows canceling long-running searches- Results are emitted via
searchCompletedsignal
Registry::SearchQuery
Parses and represents search queries with optional docset filtering. Location:src/libs/registry/searchquery.h
Query Format
SearchQuery supports docset filtering using the: separator:
src/libs/registry/searchquery.h:29-37:
Interface
Registry::SearchResult
Represents a single search result with scoring and match positions. Location:src/libs/registry/searchresult.h
Structure
Fromsrc/libs/registry/searchresult.h:17-36:
Scoring Algorithm
Search results are scored based on:- Exact matches: Higher score
- Prefix matches: Medium score
- Fuzzy matches: Lower score with distance penalty
- Position of matches: Earlier matches score higher
Util::Fuzzy utility (from src/libs/util/fuzzy.h) implements fuzzy string matching with configurable algorithms.
Search Indexing
Index Creation
Fromsrc/libs/registry/docset.cpp:36-37, Zeal creates custom SQLite indexes:
SQLite Full-Text Search
Zeal uses SQLite’s FTS (Full-Text Search) capabilities:- Custom scoring function registered via
sqlite3_create_function - View creation for optimized queries
- Index management for fast symbol lookup
CancellationToken
Provides a mechanism to cancel long-running search operations. Location:src/libs/registry/cancellationtoken.h
Used throughout search operations to check if the user has initiated a new search, allowing early termination of outdated searches.
Database Utilities
Util::SQLiteDatabase
Location:src/libs/util/sqlitedatabase.h
Wrapper around SQLite C API providing:
- Connection management
- Query execution
- Error handling
- Resource cleanup
Symbol Types
Zeal supports various symbol types from Dash docsets:- Class/Type: Classes, interfaces, structs
- Method/Function: Functions and methods
- Property/Attribute: Properties and attributes
- Constant: Constants and enums
- Guide/Sample: Documentation pages and guides
- Namespace/Module: Namespaces and modules
See Also
- Core Component - Application foundation
- Browser Component - Rendering search results
- UI Component - Search interface