Skip to content

Commit 64d4d3f

Browse files
authored
Merge pull request #6825 from zdover23/master
2 parents 0508805 + f5cd306 commit 64d4d3f

File tree

1 file changed

+32
-39
lines changed

1 file changed

+32
-39
lines changed

docs/guides/searching-with-readthedocs.rst

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ Searching with Read the Docs
22
============================
33

44
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.
5+
This guide explains how to add a "search as you type" feature to your documentation,
6+
how to use advanced query syntax to get more accurate results,
7+
and how to use other search features that Read the Docs supports.
8+
Where appropriate, example searches are provided.
89

9-
You can find information on the search architecture and how we index document on our
10+
You can find information on the search architecture and how we index document in our
1011
:doc:`Search <../development/search>` docs.
1112

1213

@@ -19,16 +20,13 @@ You can find information on the search architecture and how we index document on
1920
Improvements over Sphinx search
2021
-------------------------------
2122

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.
23+
Sphinx is designed to create a self-contained webpage and all search indexing is performed at the time when the documentation is built.
24+
This means that it is not possible for Sphinx to add features such as searching translations or subprojects or providing analytics on common searches.
25+
Read the Docs supports a powerful documentation search, unlike Sphinx, which has support only for a basic search function.
2826

2927
Features of Read the Docs documentation search are:
3028

31-
- Search as you type feature supported.
29+
- Search-as-you-type feature supported.
3230
- Search analytics.
3331
- Search across multiple projects.
3432
- Search inside subprojects.
@@ -46,12 +44,12 @@ Search features for project admins
4644
Enable "search as you type" in your documentation
4745
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4846

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.
47+
`readthedocs-sphinx-search`_ is a Sphinx extension that integrates your
48+
documentation more closely with the search implementation of Read the Docs.
49+
It adds a clean and minimal full-page search UI that supports a **search as you type** feature.
5250

53-
To get a glimpse of it, you can press :guilabel:`/` (forward slash) and start typing
54-
or just visit these URLs:
51+
To try this feature,
52+
you can press :guilabel:`/` (forward slash) and start typing or just visit these URLs:
5553

5654
- https://docs.readthedocs.io/?rtd_search=contributing
5755
- https://docs.readthedocs.io/?rtd_search=api/v3/projects/
@@ -60,16 +58,16 @@ or just visit these URLs:
6058
Search analytics
6159
~~~~~~~~~~~~~~~~
6260

63-
Search queries are recorded and are stored in database to provide valuable analytics to the project admins.
64-
These analytics makes it easy to know what your users are looking for in your documentation.
61+
Search queries are recorded and stored in a database in order to provide analytics to the project admins.
62+
These analytics make it easy to know what your users are looking for in your documentation.
6563
You can see these analytics in your project admin dashboard.
6664

6765
.. note::
6866

69-
Currently, this feature is in beta state and is available under a
67+
Currently, this feature is in beta and is available under a
7068
:ref:`feature flag <guides/feature-flags:Available Flags>`.
7169
We plan to make this available for everyone soon.
72-
If you want to test this feature out and help giving us feedback,
70+
If you want to test this feature and help the project by providing feedback,
7371
please contact us via `GitHub issues`_.
7472

7573
.. figure:: /_static/images/guides/search-analytics-demo.png
@@ -86,8 +84,7 @@ Search features for readers
8684
Search across all projects
8785
~~~~~~~~~~~~~~~~~~~~~~~~~~
8886

89-
Our `main site search`_ supports searching for projects and
90-
searching across all projects.
87+
Our `main site search`_ supports searching for projects and searching across all projects.
9188
You can also use it to select the specific project and version to narrow down the search results.
9289

9390
Example queries:
@@ -101,27 +98,25 @@ Example queries:
10198
Search inside subprojects
10299
~~~~~~~~~~~~~~~~~~~~~~~~~
103100

104-
We allow projects to configured as subprojects of another project.
101+
We allow projects to be configured as subprojects of another project.
105102
You can read more about this in our :doc:`Subprojects <../subprojects>` documentation.
106103

107-
If a search is made in a project which have one or more subprojects under it,
108-
the search results then also includes the results from subprojects because
109-
they share a search index with their parent and sibling projects.
110-
For example: `Kombu`_ is one of the subprojects of `Celery`_,
111-
so if you search in Celery docs, then the results from Kombu will also be there.
104+
If a search is made in a project which has one or more subprojects under it,
105+
the search results include the results from those subprojects: projects share search indexes with their parent- and sibling-projects.
106+
For example: If `Kombu`_ is a subproject of `Celery`_ and you search in Celery docs, then the results from Kombu will also be there.
112107
Example: https://docs.celeryproject.org/en/master/search.html?q=utilities&check_keywords=yes&area=default
113108

114109

115110
Search query syntax
116111
~~~~~~~~~~~~~~~~~~~
117112

118-
Read the Docs uses `Simple Query String`_ feature of `Elasticsearch`_,
119-
hence the search query can be made complex to get more accurate results.
113+
Read the Docs uses the `Simple Query String`_ feature of `Elasticsearch`_.
114+
This means that as the search query becomes more complex, the results yielded become more specific.
120115

121116
Exact phrase search
122117
+++++++++++++++++++
123118

124-
If a query is wrapped in ``"``,
119+
If a query is wrapped in ``"`` (double quotes),
125120
then only those results where the phrase is exactly matched will be returned.
126121

127122
Example queries:
@@ -133,8 +128,8 @@ Example queries:
133128
Exact phrase search with slop value
134129
+++++++++++++++++++++++++++++++++++
135130

136-
``~N`` after a phrase signifies slop amount.
137-
It can be used to match words which are near one another.
131+
``~N`` (tilde N) after a phrase signifies slop amount.
132+
It can be used to match words that are near one another.
138133

139134
Example queries:
140135

@@ -145,7 +140,7 @@ Example queries:
145140
Prefix query
146141
++++++++++++
147142

148-
``*`` at the end of any term signifies a prefix query.
143+
``*`` (asterisk) at the end of any term signifies a prefix query.
149144
It returns the results containg the words with specific prefix.
150145

151146
Example queries:
@@ -158,9 +153,8 @@ Fuzzy query
158153
+++++++++++
159154

160155
``~N`` after a word signifies edit distance (fuzziness).
161-
This type of query is helpful when spelling of the actual keyword is unsure.
162-
It returns results that contain terms similar to the search term,
163-
as measured by a `Levenshtein edit distance`_.
156+
This type of query is helpful when the exact spelling of the keyword is unknown.
157+
It returns results that contain terms similar to the search term as measured by a `Levenshtein edit distance`_.
164158

165159
Example queries:
166160

@@ -172,8 +166,7 @@ Example queries:
172166
Using the search query syntax to build complex queries
173167
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174168

175-
The search query syntaxes described in the previous section
176-
can be used with one another to build complex queries.
169+
The search query syntaxes described in the previous section can be used with one another to build complex queries.
177170

178171
Example queries:
179172

0 commit comments

Comments
 (0)