# Search your code

> Find code across your repositories in the browser, read the results, narrow them and ask Corfedo about what you found.

Source: https://docs.corfedo.ai/use/search/

Search finds code across every repository you can read. Describe what you are looking for, type an identifier, or match exact text.

## Before you begin

At least one repository you can read shows **Searchable**. The empty search page says how many are searchable.

## Run a search

Select **Code search** in the sidebar, type a query and press Enter. Describe the code or name it: `where are webhooks verified`, `retry policy`, `RefundPolicy`. Press Shift+Enter instead to ask Corfedo AI.

**Check:** the line above the results reads, for example, "214 files in 3 repositories". "2,175+ files" means at least that many, because counting stopped before it covered everything. Counts beside the results end in `+` for the same reason.

## How results are ordered

Files that use your words in their code, symbol names, paths and file names come first. A file that defines a name you typed, and files in the folders that match your words best, rank higher. Tests, generated files and vendored code rank lower, unless your words mention them.

Put text in double quotes to match it exactly, `"connection refused"`, or write a pattern between slashes, `/retry_\w+/`. Combine conditions with uppercase `AND`, `OR` and `NOT`. [Search syntax](https://docs.corfedo.ai/reference/search-syntax/) has the whole grammar.

## Search symbol names

To search symbol names instead of code, select the **Symbols** tab. `discount policy` finds `DiscountPolicy`, `discount_policy` and `DISCOUNT_POLICY`. The count and the filters beside the results count all matching symbols, not only those on the page, such as "134 symbols in 22 repositories".

## Narrow the results

Select a repository, owner or language beside the results to search only there. Each choice is written into the query. You can also type filters such as `lang:go` or `-file:test`. See [search filters and examples](https://docs.corfedo.ai/use/search/filters/).

**Ask about this search** opens a conversation about the results. Select files first to ask about those.

Someone you share the page URL with sees the results their own access allows.

## What search covers

Each repository is searched at one commit, its **Indexed commit** on the repository's **Overview**. Other branches, pull requests and commits pushed since are not searched until the next index is ready, while the repository shows **Updating**. Links and citations name their commit, so they keep pointing at the same code.

Third-party directories such as `node_modules` and `vendor`, binary files, symbolic links and very large files are left out. Lockfiles, generated files and data files are found by their path only.

## When results are missing

| What you see | What to do |
| --- | --- |
| **N not indexed** next to the count | Those repositories are not searched yet. Select it to see them. **Index it** starts indexing if you may index repositories. |
| Code you just pushed is missing | The newer commit is not indexed yet. Wait while the repository shows **Updating**. |
| "No results in N repositories" | Check the spelling of quoted text, or describe the code in other words |
| **N not counted** next to the count | Those repositories could not be counted, so the real counts may be higher. |
| "repo:… matches nothing you can access and was ignored", or the same for org: or context: | Check the name. If the repository should be there, ask a workspace administrator to [add it](https://docs.corfedo.ai/workspace/sources/). |
| "Search stopped at the time limit" | Select **Retry**, or narrow the query |
| "Search reached its work limit" | Add a literal term, such as a function or type name, or narrow the scope |
| "N repositories could not be searched" | Select **Try again**. If it stays, tell whoever runs Corfedo. |

A message under the search box means the query has a syntax error.

## Related

- [Search filters and examples](https://docs.corfedo.ai/use/search/filters/), including searching a set of repositories.
- [Search syntax](https://docs.corfedo.ai/reference/search-syntax/) is the complete query language.
