1
0
mirror of synced 2025-12-19 18:10:59 -05:00

add screenshots + updates based on reviews

This commit is contained in:
Sarita Iyer
2022-11-02 15:31:17 -04:00
parent bd33100cba
commit e6707ea53a
11 changed files with 32 additions and 18 deletions

View File

@@ -37,7 +37,7 @@ Once you are given access to the the new code search and code view beta, you can
## Limitations
We have indexed more than 10 million public repositories for the new code search (beta). Additionally, the private repositories of GitHub users in the beta are indexed and searchable by beta participants that already have access to those private repositories on GitHub.com. However, very large repositories may not be indexed at this time, and not all code is indexed.
We have indexed many public repositories for the new code search (beta), and continue to index more. Additionally, the private repositories of GitHub users in the beta are indexed and searchable by beta participants that already have access to those private repositories on GitHub.com. However, very large repositories may not be indexed at this time, and not all code is indexed.
The current limitations on indexed code are:
- Vendored and generated code is excluded (as determined by [Enry](https://github.com/go-enry/go-enry))
@@ -47,9 +47,10 @@ The current limitations on indexed code are:
We currently only support searching for code on the default branch of a repository.
Results for any search with the new code search (beta) are restricted to 100 results (10 pages). This limitation only applies to searching code with the new code search (beta) and does not apply to other types of searches.
Results for any search with the new code search (beta) are restricted to 100 results (10 pages). Sorting is not supported for code search results at this time. This limitation only applies to searching code with the new code search (beta) and does not apply to other types of searches.
The new code search (beta) supports searching for symbol definitions in code, such as function or class definitions, using the `symbol:` qualifier. However, note that the `symbol:` qualifier only searches for definitions and not references, and not all symbol types or languages are fully supported yet. For a list of what languages are supported, see "[Symbol qualifier](/search-github/github-code-search/understanding-github-code-search-syntax#symbol-qualifier)."
## Feedback and support
You can view and share feedback about the new code search (beta) in our [discussion forum](https://github.com/orgs/community/discussions/categories/code-search-and-navigation).

View File

@@ -1,6 +1,6 @@
---
title: GitHub Code Search (beta)
intro: 'You can use a wide range of syntax to search {% data variables.product.product_name %}. You can adjust the scope of your search, build and troubleshoot queries, and sort search results with qualifiers.'
intro: 'You can use a wide range of syntax to search {% data variables.product.product_name %}. You can adjust the scope of your search, build and troubleshoot queries, and narrow down search results with qualifiers.'
allowTitleToDifferFromFilename: true
versions:
feature: github-code-search

View File

@@ -40,7 +40,7 @@ For example, the following query:
sparse index
```
The search results would include all documents containing both the terms `sparse` and `index`, in any order. As examples, it would match a file containing `SparseIndexVector`, or even the phrase `index for sparse trees`.
The search results would include all documents containing both the terms `sparse` and `index`, in any order. As examples, it would match a file containing `SparseIndexVector`, a file with the phrase `index for sparse trees`, and even a file named `index.txt` that contains the term `sparse`.
Searching for multiple terms separated by whitespace is the equivalent to the search `hello AND world`. Other boolean operations, such as `hello OR world`, are also supported in the new code search (beta). For more information about boolean operations, see "[Using boolean operations](#using-boolean-operations)."
@@ -48,7 +48,7 @@ The new code search (beta) also supports searching for an exact string, includin
You can narrow your code search with specialized qualifiers, such as `repo:`, `language:` and `path:`. For more information on the qualifiers you can use in the new code search (beta), see "[Using qualifiers](#using-qualifiers)."
You can also use regular expressions in your searches by surrounding the expression in slashes. For more information on using regular expressions, see "[Using regular expressions](#using-regular-expressions)."
You can also use regular expressions in your searches by surrounding the expression in backslashes. For more information on using regular expressions, see "[Using regular expressions](#using-regular-expressions)."
## Query for an exact match
@@ -285,6 +285,4 @@ Note that you'll have to escape any forward slashes within the regular expressio
```
/^App\/src\//
```
```

View File

@@ -35,27 +35,42 @@ For more information about the search syntax of the new code search (beta), see
1. In the top navigation of {% data variables.product.prodname_dotcom_the_website %}, click the search bar.
1. Under the search bar, you will see a list of suggestions organized by category, including recent searches and suggested repositories, teams, and projects that you have access to. You can also see a list of saved searches that you have created. For more information on saved searches, see "[Creating and managing saved searches](#creating-and-managing-saved-searches)."
![Search bar with suggestions and saved searches](/assets/images/help/search/code-search-beta-search-bar.png)
If you click on any of the specific suggestions, you will be taken directly to the page for that suggestion (for example, the repository or project page). If you click on a recent or saved search, you will be taken to the search results view for that search query.
1. Once you start typing a search query, you will see a list of completions and suggestions that match your query. You can click on a suggestion to jump to a specific location. As you type more qualifiers, you will see more specific suggestions, such as code files you can jump to directly.
1. After typing your query, you can also hit Enter to be taken to the full search results view. For more information, see "[Using the search results view](#using-the-search-results-view)."
![Search bar with a query and code suggestions](/assets/images/help/search/code-search-beta-search-bar-code-suggestions.png)
1. After typing your query, you can also press Enter to go to the full search results view, where you can see each match and a visual interface for applying filters. For more information, see "[Using the search results view](#using-the-search-results-view)."
## Creating and managing saved searches
1. In the top navigation of {% data variables.product.prodname_dotcom_the_website %}, click the search bar and start typing a search query (or any letter).
2. Under the search bar, the "Saved searches" section should now appear. Click **Create saved search**.
3. In the pop-up window, fill out the name you want for your query and the query that you want to save. Click **Create saved search**.
1. Under the search bar, the "Saved searches" section should now appear. Click {% octicon "plus-circle" aria-label="The plus-circle icon" %} **Create saved search**.
If you click again on the search bar, you can now see your saved search in the "Saved searches" section under the search bar. Clicking on a saved search entry will add the query to the search bar and filter the suggestions accordingly.
- To edit a saved search, in the "Saved searches" section, click {% octicon "pencil" aria-label="The pencil icon" %} to the right of the saved search.
- To delete a saved search, click {% octicon "trash" aria-label="The trash icon" %} to the right of the saved search.
!["Create saved search" button in search bar](/assets/images/help/search/code-search-beta-create-saved-search.png)
1. In the pop-up window, fill out the name you want for your query and the query that you want to save. Click **Create saved search**.
!["Create saved search" window](/assets/images/help/search/code-search-beta-create-saved-search-window.png)
1. If you click again on the search bar, you can now see your saved search in the "Saved searches" section under the search bar. Clicking on a saved search entry will add the query to the search bar and filter the suggestions accordingly.
![Use saved search in search bar](/assets/images/help/search/code-search-beta-saved-search-in-search-bar.png)
- To edit a saved search, in the "Saved searches" section, click {% octicon "pencil" aria-label="The pencil icon" %} to the right of the saved search.
- To delete a saved search, click {% octicon "trash" aria-label="The trash icon" %} to the right of the saved search.
![Buttons to edit or delete a saved search](/assets/images/help/search/code-search-beta-edit-or-delete-saved-search.png)
## Using the search results view
This search results view already existed for the current search on GitHub, and the functionality for most search types, except code, is the same. With the new code search beta enabled, the search results page has a redesigned UI and includes filters that are part of the new code search engine, such as path and symbol filters.
The search results view already exists for the classic search on GitHub, and the functionality for most search types, except code, is the same. With the new code search beta enabled, the search results page has a redesigned UI and includes filters that are supported in the new code search engine, such as path and symbol filters.
To construct a search query and view, sort, and filter results using a visual interface, you can use {% data variables.search.search_page_url %} or {% data variables.search.advanced_url %}.
To construct a search query, as well as view and filter results, using a visual interface, you can use the {% data variables.search.search_page_url %} or {% data variables.search.advanced_url %}. If you press Enter after typing a search query in the search bar, you will also be taken to the search results view.
If you press Enter after typing a search query in the search bar, you will also be taken to the search results view.
On the search results view, you can navigate between different types of search results, including code, issues, pull request, repositories, and more. You can also view and ues filters.
On the search results view, you can navigate between different types of search results, including code, issues, pull request, repositories, and more. You can also view and click on filters, and sort results.
![Search results view](/assets/images/help/search/code-search-beta-results-view.png)