Skip to content

Commit 6595341

Browse files
authored
Clarify that english is the default; add reference for more info (#6081) (#6126)
* Clarify that english is the default; add refernce for more info * update references * links can not start with $ * how many times can I mess up a ref?
1 parent 130c44c commit 6595341

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

source/core/indexes/index-types/index-text/specify-language-text-index/create-text-index-multiple-languages.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,15 @@ The following operation creates a text index on the ``original`` and
9393

9494
.. code-block:: javascript
9595

96-
db.quotes.createIndex( { original: "text", "translation.quote": "text" } )
96+
db.quotes.createIndex({ original: "text", "translation.quote": "text", "default_language" : "fr" })
97+
98+
.. note::
99+
100+
English is the default language for indexes. If you do not specify the
101+
:ref:`default_language <createIndexes-default-language>`, your query must
102+
specify the language with the :ref:`$language <language-field>` parameter.
103+
For more information, refer to :ref:`<specify-default-text-index-language>`.
104+
97105

98106
Results
99107
-------

source/reference/command/createIndexes.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,14 @@ Each document in the ``indexes`` array can take the following fields:
300300
:ref:`control-text-search-results` to adjust the scores.
301301
The default value is ``1``.
302302

303-
304-
303+
305304
* - ``default_language``
306305

307306
- string
308307

309-
- Optional. For :ref:`text <index-type-text>` indexes, the language that
308+
- .. _createIndexes-default-language:
309+
310+
Optional. For :ref:`text <index-type-text>` indexes, the language that
310311
determines the list of stop words and the rules for the stemmer and
311312
tokenizer. See :ref:`text-search-languages` for the available
312313
languages and

source/reference/operator/query/text.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ following fields:
6868

6969
* - ``$language``
7070
- string
71-
- Optional. The language that determines the list of stop words for the search and
71+
72+
- .. _language-field:
73+
74+
Optional. The language that determines the list of stop words for the search and
7275
the rules for the stemmer and tokenizer. If not specified, the search
7376
uses the default language of the index. For supported languages, see
7477
:ref:`text-search-languages`.

0 commit comments

Comments
 (0)