Skip to content

Commit fee1259

Browse files
committed
code fixes
1 parent 2f9b58a commit fee1259

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/fundamentals/read-operations.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ retrieve documents in which the ``plot`` field contains the phrase
269269
IMDB Rating: 6.1
270270
IMDB Votes: 223
271271
Plot: A girl. A boy. A love story ...
272+
273+
...
272274

273275
.. note::
274276

docs/includes/fundamentals/read-operations/ReadOperationsTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ protected function setUp(): void
2626
['year' => 1999, 'countries' => ['Indonesia'], 'title' => 'Title 4'],
2727
['year' => 1999, 'countries' => ['Canada'], 'title' => 'Title 5'],
2828
['year' => 1999, 'runtime' => 30],
29-
['title' => 'movie_a', 'fullplot' => 'this is a love story'],
30-
['title' => 'movie_b', 'fullplot' => 'love is a long story'],
31-
['title' => 'movie_c', 'fullplot' => 'went on a trip'],
29+
['title' => 'movie_a', 'plot' => 'this is a love story'],
30+
['title' => 'movie_b', 'plot' => 'love is a long story'],
31+
['title' => 'movie_c', 'plot' => 'went on a trip'],
3232
]);
3333
}
3434

@@ -119,6 +119,11 @@ public function testText(): void
119119
*/
120120
public function testTextRelevance(): void
121121
{
122+
123+
$collection = MongoDB::connection('mongodb')->collection('movies');
124+
$index = ['plot' => 'text'];
125+
$collection->createIndex($index);
126+
122127
// start-text-relevance
123128
$movies = Movie::where('$text', ['$search' => "\"" . 'love story' . "\""])
124129
->orderBy('score', ['$meta' => 'textScore'])

0 commit comments

Comments
 (0)