# sourcegraph-search-insights **Repository Path**: mirrors_sourcegraph/sourcegraph-search-insights ## Basic Information - **Project Name**: sourcegraph-search-insights - **Description**: Provides code insights from Sourcegraph searches - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-23 - **Last Updated**: 2026-01-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Provides interactive code insights on Sourcegraph directory pages from configurable [code searches](https://docs.sourcegraph.com/user/search). The insight shows the development of the number of matches over time for a configurable time frame up to now. Each data point links to a [diff search](https://docs.sourcegraph.com/user/search#commit-diff-search) between that data point and the previous to explain the changes between the two datapoints.

Screenshot

## Configuration To add a search insight, add an object like this to your user, organization or global settings: ```jsonc // Choose any name - only the prefix "searchInsights.insight." is mandatory. "searchInsights.insight.reactFunctionComponentMigration": { // Shown as the title of the insight. "title": "Migration to React function components", // The lines of the chart. "series": [ { // Name shown in the legend and tooltip. "name": "Function components", // The search query that will be run for the interval defined in "step". // Do not include the "repo:" filter as it will be added automatically for the current repsitory. "query": "patternType:regexp const\\s\\w+:\\s(React\\.)?FunctionComponent", // An optional color for the line. // Can be any hex color code, rgb(), hsl(), // or reference color variables from the OpenColor palette (recommended): https://yeun.github.io/open-color/ // The semantic colors var(--danger), var(--warning) and var(--info) are also available. "stroke": "var(--oc-teal-7)" }, { "name": "Class components", "query": "patternType:regexp extends\\s(React\\.)?(Pure)?Component", "stroke": "var(--oc-indigo-7)" } ], // The step between two data points. Supports days, months, hours, etc. "step": { "weeks": 2 } } ``` Multiple search insights can be defined by adding more objects under different keys, as long as they are prefixed with `searchInsights.insight.`.