@@ -19,10 +19,10 @@ Definition
19
19
20
20
.. code-block:: php
21
21
22
- function createSearchIndex(
23
- array|object $definition,
24
- array $options = []
25
- ): string
22
+ function createSearchIndex(
23
+ array|object $definition,
24
+ array $options = []
25
+ ): string
26
26
27
27
.. include:: /includes/extracts/note-atlas-search-requirement.rst
28
28
@@ -37,28 +37,28 @@ Parameters
37
37
An array specifying the desired options.
38
38
39
39
.. list-table::
40
- :header-rows: 1
41
- :widths: 20 20 80
40
+ :header-rows: 1
41
+ :widths: 20 20 80
42
42
43
- * - Name
44
- - Type
45
- - Description
43
+ * - Name
44
+ - Type
45
+ - Description
46
46
47
- * - comment
48
- - mixed
49
- - .. include:: /includes/extracts/common-option-comment.rst
47
+ * - comment
48
+ - mixed
49
+ - .. include:: /includes/extracts/common-option-comment.rst
50
50
51
- * - name
52
- - string
53
- - | Name of the search index to create.
54
- | You cannot create multiple indexes with the same name on a single
55
- collection. If you do not specify a name, the index is named ``default``.
51
+ * - name
52
+ - string
53
+ - | Name of the search index to create.
54
+ | You cannot create multiple indexes with the same name on a single
55
+ collection. If you do not specify a name, the index is named ``default``.
56
56
57
- * - type
58
- - string
59
- - Type of index to create. Accepted values are ``'search'`` and
60
- ``'vectorSearch'``. If you omit this option, the default
61
- value is ``'search'`` and the method creates an Atlas Search index.
57
+ * - type
58
+ - string
59
+ - Type of index to create. Accepted values are ``'search'`` and
60
+ ``'vectorSearch'``. If you omit this option, the default
61
+ value is ``'search'`` and the method creates an Atlas Search index.
62
62
63
63
Return Values
64
64
-------------
@@ -95,8 +95,8 @@ to index all document fields containing
95
95
$collection = (new MongoDB\Client)->getCollection('test', 'articles');
96
96
97
97
$indexName = $collection->createSearchIndex(
98
- ['mappings' => ['dynamic' => true]],
99
- ['name' => 'test-search-index']
98
+ ['mappings' => ['dynamic' => true]],
99
+ ['name' => 'test-search-index']
100
100
);
101
101
102
102
var_dump($indexName);
0 commit comments