Skip to content

Commit 4702dcd

Browse files
authored
add additional example and enumerate query params (#18307)
1 parent 04450ec commit 4702dcd

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

contributing/search.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,26 @@ To see all existing search-related issues and pull requests, visit [github.com/g
1414

1515
## How to search
1616

17-
The site search is part of every version of docs.github.com. On any page, you can use the search box to search the documents we've indexed.
18-
You can also query our search endpoint directly at: https://docs.github.com/search?version=dotcom&language=en&filters=topics:%27oauth%20apps%27+AND+topics:%27github%20apps%27&query=install
17+
The site search is part of every version of docs.github.com. This endpoint responds in JSON format, and fronts Algolia and Lunr. We recommend using this endpoint over directly integrating with Algolia or Lunr, as the endpoint will be more stable. On any page, you can use the search box to search the documents we've indexed.
18+
You can also query our search endpoint directly at:
19+
https://docs.github.com/search?version=<VERSION>&language=<LANGUAGE CODE>&filters=topics:<TOPIC>&query=<QUERY>
20+
21+
- The VERSION can be any numbered GitHub Enterprise Server version (e.g., `2.22`, `3.0`), GitHub AE (`ghae`), or the Free pro team plan (`dotcom`).
22+
- The LANGUAGE CODE can be: `cn`, `de`, `en`, `es`, `ja`, or `pt`.
23+
- TOPIC can be any topics in [the allowed list of topics](/data/allowed-topics.js). The values in the `topics` attribute are **not** case sensitive, so filtering on `GitHub actions` or `github actions` will return the same result. **Note:** Currently, the topics filter only works for the dotcom version in the English language. We plan to expand this search query to other languages and versions in the future.
24+
- Any search QUERY you'd like.
1925

20-
Using the attribute `topics` in your query will only return results that have the matching topic value. You can find a full list of topics in [the allowed topics file](/data/allowed-topics.js). The `topics` attribute is configured as a [`filter only` facet in Algolia](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). When the topic contains spaces, you must use quotes. For Algolia, [here](https://www.algolia.com/doc/api-reference/api-parameters/filters/#handle-attributes-with-spaces) is an example for filters containing spaces. Algolia also requires [boolean operators](https://www.algolia.com/doc/api-reference/api-parameters/filters) to combine more than one filter.
26+
For example, to filter on the topic `ssh` and the query `passphrases`, you'd use this search query:
2127

22-
This endpoint responds in JSON format, and fronts Algolia and Lunr. We recommend using this endpoint over directly integrating with Algolia or Lunr, as the endpoint will be more stable.
28+
https://docs.github.com/search?version=dotcom&language=en&filters=topics:ssh&query=passphrases
29+
30+
To filter for the topics `oauth apps` and `github apps` and the query `install`, you'd use this search query:
31+
32+
https://docs.github.com/search?version=dotcom&language=en&filters=topics:'oauth apps'+AND+topics:'github apps'&query=install
33+
34+
### Using the topics search filter
35+
36+
Using the attribute `topics` in your query will only return results that have the matching topic value. The `topics` attribute is configured as a [`filter only` facet in Algolia](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). When the topic contains spaces, you must use quotes. For Algolia, [here](https://www.algolia.com/doc/api-reference/api-parameters/filters/#handle-attributes-with-spaces) is an example for filters containing spaces. Algolia also requires [boolean operators](https://www.algolia.com/doc/api-reference/api-parameters/filters) to combine more than one filter.
2337

2438
## Production deploys
2539

0 commit comments

Comments
 (0)