Skip to content

Commit 63cc861

Browse files
committed
Readme
1 parent 35f5bb7 commit 63cc861

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

docs/community-search/quick-start/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ This command checks the `mongodb-kubernetes-database-pods` service account to co
130130

131131
With the prerequisites and initial setup complete, you can now deploy MongoDB Community Edition and enable Search.
132132

133-
### 1. Create MongoDB User Secrets
133+
### 6. Create MongoDB User Secrets
134134

135135
MongoDB requires authentication for secure access. This step creates two Kubernetes secrets: `admin-user-password` and `search-user-password`. These secrets store the credentials for the MongoDB administrative user and a dedicated search user, respectively. These secrets will be mounted into the MongoDB pods.
136136

@@ -146,7 +146,7 @@ kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" --namespace "${MDB_NAMESPACE}"
146146
```
147147
Ensure these secrets are created in the same namespace where you plan to deploy MongoDB.
148148

149-
### 2. Create MongoDB Community Resource
149+
### 7. Create MongoDB Community Resource
150150

151151
Now, deploy MongoDB Community by creating a `MongoDBCommunity` custom resource named `mdbc-rs`. This resource definition instructs the MongoDB Kubernetes Operator to configure a MongoDB replica set with 3 members, running version 8.0.6. MongoDB Community Search is supported only from MongoDB Community Server version 8.0. It also defines CPU and memory resources for the `mongod` and `mongodb-agent` containers, and sets up two users (`admin-user` and `search-user`) with their respective roles and password secrets. User `search-user` will be used to restore, connect and perform search queries on the `sample_mflix` database.
152152

@@ -209,7 +209,7 @@ spec:
209209
EOF
210210
```
211211

212-
### 3. Wait for MongoDB Community Resource to be Ready
212+
### 8. Wait for MongoDB Community Resource to be Ready
213213

214214
After applying the `MongoDBCommunity` custom resource, the operator begins deploying the MongoDB nodes (pods). This step uses `kubectl wait` to pause execution until the `mdbc-rs` resource's status phase becomes `Running`, indicating that the MongoDB Community replica set is operational.
215215

@@ -223,7 +223,7 @@ echo; echo "Pods running in cluster ${K8S_CLUSTER_0_CONTEXT_NAME}"
223223
kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" get pods
224224
```
225225

226-
### 4. Create MongoDB Search Resource
226+
### 9. Create MongoDB Search Resource
227227

228228
Once your MongoDB deployment is ready, enable Search capabilities by creating a `MongoDBSearch` custom resource, also named `mdbc-rs` to associate it with the MongoDB instance. This resource specifies the CPU and memory resource requirements for the search nodes.
229229

@@ -261,7 +261,7 @@ requests:
261261
memory: 2G
262262
```
263263
264-
### 5. Wait for Search Resource to be Ready
264+
### 10. Wait for Search Resource to be Ready
265265
266266
Similar to the MongoDB deployment, the Search deployment needs time to initialize. This step uses `kubectl wait` to pause until the `MongoDBSearch` resource `mdbc-rs` reports a `Running` status in its `.status.phase` field, indicating that the search nodes are operational and integrated.
267267

@@ -272,7 +272,7 @@ kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" wait --f
272272
```
273273
This command polls the status of the `MongoDBSearch` resource `mdbc-rs`.
274274

275-
### 6. Verify MongoDB Community Resource Status
275+
### 11. Verify MongoDB Community Resource Status
276276

277277
Double-check the status of your `MongoDBCommunity` resource to ensure it remains healthy and that the integration with the Search resource is reflected if applicable.
278278

@@ -283,7 +283,7 @@ kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" wait --f
283283
```
284284
This provides a final confirmation that the core database is operational.
285285

286-
### 7. List Running Pods
286+
### 12. List Running Pods
287287

288288
View all the running pods in your namespace. You should see pods for the MongoDB replica set members, the MongoDB Kubernetes Operator, and the MongoDB Search nodes.
289289

@@ -301,7 +301,7 @@ kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" get pods
301301

302302
Now that your MongoDB Community database with Search is deployed, you can start using its search capabilities.
303303

304-
### 1. Deploy MongoDB Tools Pod
304+
### 13. Deploy MongoDB Tools Pod
305305

306306
To interact with your MongoDB deployment, this step deploys a utility pod named `mongodb-tools-pod`. This pod runs a MongoDB Community Server image and is kept running with a `sleep infinity` command, allowing you to use `kubectl exec` to run MongoDB client tools like `mongosh` and `mongorestore` from within the Kubernetes cluster. Running steps in a pod inside the cluster simplifies connectivity to mongodb without neeeding to expose the database externally (provided steps directly connect to the *.cluster.local hostnames).
307307

@@ -329,7 +329,7 @@ echo "Waiting for the mongodb-tools to be ready..."
329329
kubectl wait --for=condition=Ready pod/mongodb-tools-pod -n "${MDB_NAMESPACE}" --context "${K8S_CLUSTER_0_CONTEXT_NAME}" --timeout=60s
330330
```
331331

332-
### 2. Import Sample Data
332+
### 14. Import Sample Data
333333

334334
To test the search functionality, this step imports the `sample_mflix.movies` collection. It downloads the sample dataset and uses `mongorestore` to load the data into the `sample_mflix` database in your MongoDB deployment, connecting as the `search-user`.
335335

@@ -347,7 +347,7 @@ EOF
347347
```
348348
This command uses `mongoimport` from the `mongodb-tools-pod` to load data from the downloaded `sample_mflix.archive` file.
349349

350-
### 3. Create Search Index
350+
### 15. Create Search Index
351351

352352
Before performing search queries, create a search index. This step uses `kubectl exec` to run `mongosh` in the `mongodb-tools-pod`. It connects to the `sample_mflix` database as `search-user` and calls `db.movies.createSearchIndex()` to create a search index named "default" with dynamic mappings on the `movies` collection. Dynamic mapping automatically indexes all fields with supported types. MongoDB Search offers flexible index definitions, allowing for dynamic and static field mappings, various analyzer types (standard, language-specific, custom), and features like synonyms and faceted search.
353353

@@ -361,7 +361,7 @@ kubectl exec --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" mon
361361
--eval 'db.movies.createSearchIndex("default", { mappings: { dynamic: true } });'
362362
```
363363

364-
### 4. Wait for Search Index to be Ready
364+
### 16. Wait for Search Index to be Ready
365365

366366
Creating a search index is an asynchronous operation. This script polls periodically the status by executing `db.movies.getSearchIndexes("default")`.
367367

@@ -389,7 +389,7 @@ if [[ "${search_index_status}" != "READY" ]]; then
389389
fi
390390
```
391391

392-
### 5. Execute a Search Query
392+
### 17. Execute a Search Query
393393

394394
Once the search index is ready, execute search queries using the `$search` aggregation pipeline stage. MongoDB Search supports a query language, allowing for various types of queries such as text search, autocomplete, faceting, and more. You can combine `$search` with other aggregation stages to further refine and process your results.
395395

docs/community-search/quick-start/README.md.j2

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This command checks the `mongodb-kubernetes-database-pods` service account to co
7676

7777
With the prerequisites and initial setup complete, you can now deploy MongoDB Community Edition and enable Search.
7878

79-
### 1. Create MongoDB User Secrets
79+
### 6. Create MongoDB User Secrets
8080

8181
MongoDB requires authentication for secure access. This step creates two Kubernetes secrets: `admin-user-password` and `search-user-password`. These secrets store the credentials for the MongoDB administrative user and a dedicated search user, respectively. These secrets will be mounted into the MongoDB pods.
8282

@@ -86,7 +86,7 @@ MongoDB requires authentication for secure access. This step creates two Kuberne
8686
```
8787
Ensure these secrets are created in the same namespace where you plan to deploy MongoDB.
8888

89-
### 2. Create MongoDB Community Resource
89+
### 7. Create MongoDB Community Resource
9090

9191
Now, deploy MongoDB Community by creating a `MongoDBCommunity` custom resource named `mdbc-rs`. This resource definition instructs the MongoDB Kubernetes Operator to configure a MongoDB replica set with 3 members, running version 8.0.6. MongoDB Community Search is supported only from MongoDB Community Server version 8.0. It also defines CPU and memory resources for the `mongod` and `mongodb-agent` containers, and sets up two users (`admin-user` and `search-user`) with their respective roles and password secrets. User `search-user` will be used to restore, connect and perform search queries on the `sample_mflix` database.
9292

@@ -95,7 +95,7 @@ Now, deploy MongoDB Community by creating a `MongoDBCommunity` custom resource n
9595
{% include "code_snippets/0310_create_mongodb_community_resource.sh" %}
9696
```
9797

98-
### 3. Wait for MongoDB Community Resource to be Ready
98+
### 8. Wait for MongoDB Community Resource to be Ready
9999

100100
After applying the `MongoDBCommunity` custom resource, the operator begins deploying the MongoDB nodes (pods). This step uses `kubectl wait` to pause execution until the `mdbc-rs` resource's status phase becomes `Running`, indicating that the MongoDB Community replica set is operational.
101101

@@ -104,7 +104,7 @@ After applying the `MongoDBCommunity` custom resource, the operator begins deplo
104104
{% include "code_snippets/0315_wait_for_community_resource.sh" %}
105105
```
106106

107-
### 4. Create MongoDB Search Resource
107+
### 9. Create MongoDB Search Resource
108108

109109
Once your MongoDB deployment is ready, enable Search capabilities by creating a `MongoDBSearch` custom resource, also named `mdbc-rs` to associate it with the MongoDB instance. This resource specifies the CPU and memory resource requirements for the search nodes.
110110

@@ -129,7 +129,7 @@ requests:
129129
memory: 2G
130130
```
131131

132-
### 5. Wait for Search Resource to be Ready
132+
### 10. Wait for Search Resource to be Ready
133133

134134
Similar to the MongoDB deployment, the Search deployment needs time to initialize. This step uses `kubectl wait` to pause until the `MongoDBSearch` resource `mdbc-rs` reports a `Running` status in its `.status.phase` field, indicating that the search nodes are operational and integrated.
135135

@@ -139,7 +139,7 @@ Similar to the MongoDB deployment, the Search deployment needs time to initializ
139139
```
140140
This command polls the status of the `MongoDBSearch` resource `mdbc-rs`.
141141

142-
### 6. Verify MongoDB Community Resource Status
142+
### 11. Verify MongoDB Community Resource Status
143143

144144
Double-check the status of your `MongoDBCommunity` resource to ensure it remains healthy and that the integration with the Search resource is reflected if applicable.
145145

@@ -149,7 +149,7 @@ Double-check the status of your `MongoDBCommunity` resource to ensure it remains
149149
```
150150
This provides a final confirmation that the core database is operational.
151151

152-
### 7. List Running Pods
152+
### 12. List Running Pods
153153

154154
View all the running pods in your namespace. You should see pods for the MongoDB replica set members, the MongoDB Kubernetes Operator, and the MongoDB Search nodes.
155155

@@ -162,7 +162,7 @@ View all the running pods in your namespace. You should see pods for the MongoDB
162162

163163
Now that your MongoDB Community database with Search is deployed, you can start using its search capabilities.
164164

165-
### 1. Deploy MongoDB Tools Pod
165+
### 13. Deploy MongoDB Tools Pod
166166

167167
To interact with your MongoDB deployment, this step deploys a utility pod named `mongodb-tools-pod`. This pod runs a MongoDB Community Server image and is kept running with a `sleep infinity` command, allowing you to use `kubectl exec` to run MongoDB client tools like `mongosh` and `mongorestore` from within the Kubernetes cluster. Running steps in a pod inside the cluster simplifies connectivity to mongodb without neeeding to expose the database externally (provided steps directly connect to the *.cluster.local hostnames).
168168

@@ -171,7 +171,7 @@ To interact with your MongoDB deployment, this step deploys a utility pod named
171171
{% include "code_snippets/0410_run_mongodb_tools_pod.sh" %}
172172
```
173173

174-
### 2. Import Sample Data
174+
### 14. Import Sample Data
175175

176176
To test the search functionality, this step imports the `sample_mflix.movies` collection. It downloads the sample dataset and uses `mongorestore` to load the data into the `sample_mflix` database in your MongoDB deployment, connecting as the `search-user`.
177177

@@ -181,7 +181,7 @@ To test the search functionality, this step imports the `sample_mflix.movies` co
181181
```
182182
This command uses `mongoimport` from the `mongodb-tools-pod` to load data from the downloaded `sample_mflix.archive` file.
183183

184-
### 3. Create Search Index
184+
### 15. Create Search Index
185185

186186
Before performing search queries, create a search index. This step uses `kubectl exec` to run `mongosh` in the `mongodb-tools-pod`. It connects to the `sample_mflix` database as `search-user` and calls `db.movies.createSearchIndex()` to create a search index named "default" with dynamic mappings on the `movies` collection. Dynamic mapping automatically indexes all fields with supported types. MongoDB Search offers flexible index definitions, allowing for dynamic and static field mappings, various analyzer types (standard, language-specific, custom), and features like synonyms and faceted search.
187187

@@ -190,7 +190,7 @@ Before performing search queries, create a search index. This step uses `kubectl
190190
{% include "code_snippets/0430_create_search_index.sh" %}
191191
```
192192

193-
### 4. Wait for Search Index to be Ready
193+
### 16. Wait for Search Index to be Ready
194194

195195
Creating a search index is an asynchronous operation. This script polls periodically the status by executing `db.movies.getSearchIndexes("default")`.
196196

@@ -199,7 +199,7 @@ Creating a search index is an asynchronous operation. This script polls periodic
199199
{% include "code_snippets/0440_wait_for_search_index_ready.sh" %}
200200
```
201201

202-
### 5. Execute a Search Query
202+
### 17. Execute a Search Query
203203

204204
Once the search index is ready, execute search queries using the `$search` aggregation pipeline stage. MongoDB Search supports a query language, allowing for various types of queries such as text search, autocomplete, faceting, and more. You can combine `$search` with other aggregation stages to further refine and process your results.
205205

0 commit comments

Comments
 (0)