From a41d2d02c15abedd024b129a1faae0e8a2717197 Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Fri, 23 Aug 2024 15:03:33 +0200 Subject: [PATCH 1/3] search-jobs: update docs for GA - remove Beta callout - new screenshtos - update section "Disable Search Jobs" --- docs/code-search/types/search-jobs.mdx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/code-search/types/search-jobs.mdx b/docs/code-search/types/search-jobs.mdx index 5bcc05c06..3d23a2b65 100644 --- a/docs/code-search/types/search-jobs.mdx +++ b/docs/code-search/types/search-jobs.mdx @@ -2,7 +2,7 @@

Use Search Jobs to search code at scale for large-scale organizations.

- Search Jobs feature is in Beta stage and only available for Enterprise accounts. It is enabled by default since 5.3.0. + Search Jobs is enabled by default since 5.3.0. Search Jobs allows you to run search queries across your organization's codebase (all repositories, branches, and revisions) at scale. It enhances the existing Sourcegraph's search capabilities, enabling you to run searches without query timeouts or incomplete results. @@ -74,12 +74,12 @@ To use Search Jobs, you need to: - Run a search query from your Sourcegraph instance - Click the result menu below the search bar to see if your query is valid for the long search -![run-query-for-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/query-serach-jobs.png) +![run-query-for-search-jobs](https://storage.googleapis.com/sourcegraph-asseets/Docs/search-jobs/search-jobs-create.png) - If your query is valid, click **Run search job** to initiate the search job - You will be redirected to the "Search Jobs UI" page at `/search-jobs`, where you can view all your created search jobs. If you're a site admin, you can also view search jobs from other users on the instance -![view-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/view-search-jobs.png) +![view-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/search-jobs/search-jobs-manage.png) ## Supported result types @@ -99,20 +99,16 @@ The following result types are not supported: The following elements of our query language are not supported: - file predicates, such as `file:has.content`, `file:has.owner`, `file:has.contributor`, `file:contains.content` -- `.*` regexp search +- catch-all `.*` regexp search - Multiple `rev` filters - Queries with `index: filter` -The search bar already supports exhaustive searches with the `count:all` operator. However, these searches are subject to lower timeouts, making them harder to use in large codebases. -## Disable Search Jobs +The search bar supports the `count:all` operator which increases limits and timeouts. This works well if the search completes within a few minutes, which is true for cheap queries and a limited scope of repositories to search. For longer running searches, Search Jobs is the better choice. -Follow these steps to disable Search Jobs and to hide the feature in the Sourcegraph UI: +## Disable Search Jobs -- Login to your Sourcegraph instance and go to the site admin -- Next, click the site configuration -- From here, you'll see `experimentalFeatures` -- Set `searchJobs` to `false` and then refresh the page +To disable Search Jobs, set `DISABLE_SEARCH_JOBS=true` in your frontend and worker services. ## FAQ From f0425d71458d8951b02a3079200e8ead6c07e031 Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Fri, 23 Aug 2024 15:53:10 +0200 Subject: [PATCH 2/3] update screenshots, rearange sections --- docs/code-search/types/search-jobs.mdx | 39 +++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/code-search/types/search-jobs.mdx b/docs/code-search/types/search-jobs.mdx index 3d23a2b65..29af116fa 100644 --- a/docs/code-search/types/search-jobs.mdx +++ b/docs/code-search/types/search-jobs.mdx @@ -1,13 +1,25 @@ # Search Jobs -

Use Search Jobs to search code at scale for large-scale organizations.

- - Search Jobs is enabled by default since 5.3.0. +Use Search Jobs to search code at scale for large-scale organizations. Search Jobs allows you to run search queries across your organization's codebase (all repositories, branches, and revisions) at scale. It enhances the existing Sourcegraph's search capabilities, enabling you to run searches without query timeouts or incomplete results. With Search Jobs, you can start a search, let it run in the background, and then download the results from the Search Jobs UI when it's done. Site administrators can **enable** or **disable** the Search Jobs feature, making it accessible to all users on the Sourcegraph instance. +## Using Search Jobs + +To use Search Jobs, you need to: + +- Run a search query from your Sourcegraph instance +- Click the result menu below the search bar to see if your query is supported by Search Jobs + +![run-query-for-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/search-jobs/search-jobs-create.png) + +- If your query is valid, click **Create a search job** to initiate the search job +- You will be redirected to the "Search Jobs UI" page at `/search-jobs`, where you can view all your created search jobs. If you're a site admin, you can also view search jobs from other users on the instance + +![view-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/search-jobs/search-jobs-manage.png) + ## Search results format The downloaded results are formatted as [JSON lines](https://jsonlines.org). @@ -67,21 +79,6 @@ If you would like to allow your Sourcegraph instance to control the creation and - `SEARCH_JOBS_UPLOAD_MANAGE_BUCKET=true` -## Using Search Jobs - -To use Search Jobs, you need to: - -- Run a search query from your Sourcegraph instance -- Click the result menu below the search bar to see if your query is valid for the long search - -![run-query-for-search-jobs](https://storage.googleapis.com/sourcegraph-asseets/Docs/search-jobs/search-jobs-create.png) - -- If your query is valid, click **Run search job** to initiate the search job -- You will be redirected to the "Search Jobs UI" page at `/search-jobs`, where you can view all your created search jobs. If you're a site admin, you can also view search jobs from other users on the instance - -![view-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/search-jobs/search-jobs-manage.png) - - ## Supported result types Search jobs supports the following result types: @@ -104,7 +101,11 @@ The following elements of our query language are not supported: - Queries with `index: filter` -The search bar supports the `count:all` operator which increases limits and timeouts. This works well if the search completes within a few minutes, which is true for cheap queries and a limited scope of repositories to search. For longer running searches, Search Jobs is the better choice. + + Alternatively, the search bar supports the `count:all` operator which increases result limits and timeouts. + This works well if the search completes within a few minutes and the number of results is less than the configured display limit. + For longer running searches and searches with huge results sets, Search Jobs is the better choice. + ## Disable Search Jobs From 08aac22ed2963add459ac196f2a7bd0ca38d2a8a Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Fri, 23 Aug 2024 17:44:49 +0200 Subject: [PATCH 3/3] typo --- docs/code-search/types/search-jobs.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/code-search/types/search-jobs.mdx b/docs/code-search/types/search-jobs.mdx index 29af116fa..f8323cd2a 100644 --- a/docs/code-search/types/search-jobs.mdx +++ b/docs/code-search/types/search-jobs.mdx @@ -104,7 +104,7 @@ The following elements of our query language are not supported: Alternatively, the search bar supports the `count:all` operator which increases result limits and timeouts. This works well if the search completes within a few minutes and the number of results is less than the configured display limit. - For longer running searches and searches with huge results sets, Search Jobs is the better choice. + For longer running searches and searches with huge result sets, Search Jobs is the better choice. ## Disable Search Jobs