Skip to main content
The SearchEngine class provides powerful search capabilities across your repository.

Import

Constructor

Methods

General-purpose search.
Parameters: Options:
Returns:
Example:

searchCommits()

Search commit messages.
Options:
Returns:
Example:

searchFiles()

Search for files by name.
Options:
Returns:
Example:

searchContent()

Search file contents.
Options:
Returns:
Example:

searchBlame()

Find who last modified specific lines.
Returns:
Example:

Advanced Examples

Search and Replace Across Repository

Find Dead Code

Commit History Analysis

Find Sensitive Information

Performance Tips

Use specific search typesIf you only need commits, use searchCommits() instead of search() with type: 'commits'. Direct methods are faster.
Limit resultsAlways set a reasonable limit for large repositories:
Use path filtersNarrow searches to specific directories:
Cache the SearchEngineCreate one instance and reuse it: