1
1
Searching with Read the Docs
2
2
============================
3
3
4
- .. meta ::
5
- :description lang=en:
6
- Guide to use the powerful documentation search by Read the Docs to its full extent.
4
+ Read the Docs uses Elasticsearch to provide a better search experience.
5
+ This guide is intended to show that how to add "search as you type" feature to your documentation,
6
+ how to use advanced query syntax to get more accurate results and
7
+ many other search features that Read the Docs supports with example searches.
7
8
8
-
9
- This guide is intended to show that how to use the powerful search provided by Read the Docs.
10
- It is being powered by `Elasticsearch `_.
11
- You can find more information on the search architecture and how we index document on our
9
+ You can find information on the search architecture and how we index document on our
12
10
:doc: `Search <../development/search >` docs.
13
11
14
12
@@ -18,35 +16,39 @@ You can find more information on the search architecture and how we index docume
18
16
:depth: 3
19
17
20
18
21
- Why "Just" Sphinx Search Is Not Enough?
22
- ---------------------------------------
19
+ Improvements over Sphinx search
20
+ -------------------------------
23
21
24
- Sphinx already have built in search functionality,
25
- but it only supports a basic search across a single documentation.
26
- While Read the Docs supports a powerful documentation search.
22
+ Sphinx is designed to create a self-contained webpage and
23
+ all search indexing is done when the documentation is built.
24
+ As a result, it would be impossible for Sphinx to add features like searching translations
25
+ or subprojects or having analytics on common searches.
26
+ Read the Docs supports a powerful documentation search unlike
27
+ Sphinx which only have a basic search support.
27
28
28
29
Features of Read the Docs documentation search are:
29
30
30
31
- Search as you type feature supported.
32
+ - Search analytics.
31
33
- Search across multiple projects.
32
- - Advanced query syntax.
33
34
- Search inside subprojects.
35
+ - Advanced query syntax.
34
36
- Improved search result order.
35
- - Public Search API (Documentation pending).
37
+ - Public search API (documentation pending).
36
38
- Case insensitive search.
37
39
- Results from sections of the documentation.
38
40
- Code search.
39
- - Search analytics.
40
41
41
42
42
- Search Features for Project Admins
43
+ Search features for project admins
43
44
----------------------------------
44
45
45
- Enable "Search As You Type" In Your Documentation
46
+ Enable "search as you type" in your documentation
46
47
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47
48
48
- `readthedocs-sphinx-search `_ can be used to add a clean and minimal full page search UI
49
- to your documentation which supports **search as you type ** feature.
49
+ `readthedocs-sphinx-search `_ is a Sphinx extension which integrates your
50
+ documentation more closely with Read the Docs' search implementation.
51
+ It adds a clean and minimal full page search UI which supports **search as you type ** feature.
50
52
51
53
To get a glimpse of it, you can press :guilabel: `/ ` (forward slash) and start typing
52
54
or just visit these URLs:
@@ -55,7 +57,7 @@ or just visit these URLs:
55
57
- https://docs.readthedocs.io/?rtd_search=api/v3/projects/
56
58
57
59
58
- Search Analytics
60
+ Search analytics
59
61
~~~~~~~~~~~~~~~~
60
62
61
63
Search queries are recorded and are stored in database to provide valuable analytics to the project admins.
@@ -78,15 +80,15 @@ You can see these analytics in your project admin dashboard.
78
80
Search analytics demo
79
81
80
82
81
- Search Features For Readers
83
+ Search features for readers
82
84
---------------------------
83
85
84
- Search Across All Projects
86
+ Search across all projects
85
87
~~~~~~~~~~~~~~~~~~~~~~~~~~
86
88
87
89
Our `main site search `_ supports searching for projects and
88
90
searching across all projects.
89
- You can use it to select the specific project and version to narrow down the search results.
91
+ You can also use it to select the specific project and version to narrow down the search results.
90
92
91
93
Example queries:
92
94
@@ -96,7 +98,7 @@ Example queries:
96
98
- https://readthedocs.org/search/?q=celery._state&type=file&project=celery&version=master
97
99
98
100
99
- Search Inside Subprojects
101
+ Search inside subprojects
100
102
~~~~~~~~~~~~~~~~~~~~~~~~~
101
103
102
104
We allow projects to configured as subprojects of another project.
@@ -110,13 +112,13 @@ so if you search in Celery docs, then the results from Kombu will also be there.
110
112
Example: https://docs.celeryproject.org/en/master/search.html?q=utilities&check_keywords=yes&area=default
111
113
112
114
113
- Search Query Syntax
115
+ Search query syntax
114
116
~~~~~~~~~~~~~~~~~~~
115
117
116
118
Read the Docs uses `Simple Query String `_ feature of `Elasticsearch `_,
117
119
hence the search query can be made complex to get more accurate results.
118
120
119
- Exact Phrase Search
121
+ Exact phrase search
120
122
+++++++++++++++++++
121
123
122
124
If a query is wrapped in ``" ``,
@@ -128,7 +130,7 @@ Example queries:
128
130
- https://docs.readthedocs.io/?rtd_search=%22adding%20a%20subproject%22
129
131
- https://docs.readthedocs.io/?rtd_search=%22when%20a%20404%20is%20returned%22
130
132
131
- Exact Phrase Search With Slop Value
133
+ Exact phrase search with slop value
132
134
+++++++++++++++++++++++++++++++++++
133
135
134
136
``~N `` after a phrase signifies slop amount.
@@ -140,7 +142,7 @@ Example queries:
140
142
- https://docs.readthedocs.io/?rtd_search=%22single%20documentation%22~1
141
143
- https://docs.readthedocs.io/?rtd_search=%22read%20the%20docs%20story%22~5
142
144
143
- Prefix Query
145
+ Prefix query
144
146
++++++++++++
145
147
146
148
``* `` at the end of any term signifies a prefix query.
@@ -152,7 +154,7 @@ Example queries:
152
154
- https://docs.readthedocs.io/?rtd_search=single%20v*%20doc*
153
155
- https://docs.readthedocs.io/?rtd_search=build*%20and%20c*%20to%20doc*
154
156
155
- Fuzzy Query
157
+ Fuzzy query
156
158
+++++++++++
157
159
158
160
``~N `` after a word signifies edit distance (fuzziness).
@@ -167,7 +169,7 @@ Example queries:
167
169
- https://docs.readthedocs.io/?rtd_search=configurtion~1
168
170
169
171
170
- Using The Search Query Syntax To Build Complex Queries
172
+ Using the search query syntax to build complex queries
171
173
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172
174
173
175
The search query syntaxes described in the previous section
0 commit comments