You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code-search/working/search_contexts.mdx
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,14 +37,35 @@ You can also search across multiple contexts at once using the `OR` [boolean ope
37
37
38
38
To organize your search contexts better, you can use a specific context as your default and star any number of contexts. This affects what context is selected when loading Sourcegraph and how the list of contexts is sorted.
39
39
40
-
### Default context
40
+
### Default search context
41
+
42
+
#### For users
41
43
42
44
Any authenticated user can use a search context as their default. To set a default, go to the search context management page, open the "..." menu for a context, and click on "Use as default". If the user doesn't have a default, `global` will be used.
43
45
44
46
If a user ever loses access to their default search context (eg. the search context is made private), they will see a warning at the top of the search contexts dropdown menu list and `global` will be used. If a user's default search context is deleted, `global` will immediately be set as their default.
45
47
46
48
The default search context is always selected when loading the Sourcegraph webapp. The one exception is when opening a link to a search query that does not contain a `context:` filter, in which case the `global` context will be used.
47
49
50
+
#### For site admins
51
+
52
+
Site admins can set a default search context for all users on the Sourcegraph instance. This helps teams improve onboarding and search quality by focusing searches on the most relevant parts of the codebase rather than the entire indexed set of repositories.
53
+
54
+
An admin can set a default search context via:
55
+
56
+
- Click the **More** button from the top menu of the Sourcegraph web app
57
+
- Next, go to **Search Contexts**
58
+
- For the existing context list, click on the **...** menu and select **[Site admin only] Set as default for all users**
59
+
- Alternatively, you can create a new context and then set it for all users via the same option
- If a user already has a personal default search context set, it will not be overridden
66
+
- The admin-set default will apply automatically if a user only uses the global context
67
+
- Individual users can see the instance-wide default and override it with their own default if they choose
68
+
48
69
### Starred contexts
49
70
50
71
Any authenticated user can star a search context. To star a context, click on the star icon in the search context management page. This will cause the context to appear near the top of their search contexts list. The `global` context cannot be starred.
0 commit comments