Skip to content

Commit 245e6ad

Browse files
authored
Clarify that english is the default; add reference for more info (#6081) (#6125)
* 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 6325f6e commit 245e6ad

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
@@ -75,7 +75,10 @@ following fields:
7575

7676
* - ``$language``
7777
- string
78-
- Optional. The language that determines the list of stop words for the search and
78+
79+
- .. _language-field:
80+
81+
Optional. The language that determines the list of stop words for the search and
7982
the rules for the stemmer and tokenizer. If not specified, the search
8083
uses the default language of the index. For supported languages, see
8184
:ref:`text-search-languages`.

0 commit comments

Comments
 (0)