Download the zip and unzip it:
├── README.md
├── backend
│ ├── main.js
│ ├── package-lock.json
│ └── package.json
├── frontend
│ ├── index.html
│ ├── node_modules
└── package-lock.json
Directory structure.
Create Atlas Cluster in cloud.mongodb.com atleast M0.
Create Atlas Search Index with below definition:
{
"mappings": {
"dynamic": false,
"fields": {
"fullplot": [
{
"type": "string"
}
],
"title": [
{
"type": "autocomplete"
}
]
}
}
}
Setting up backend:
- cd MongoAFTS/backend
- npm init
- vi main.js edit the MongoDB connectivity Atlas connection string in the MongoClient() constructor.
- node main.js
hit localhost:3000 (search in server.listen() method if not 3000)
Setting up frontend: Simple and Easy step is host the index.html in realm
If not you can host in your system:
- cd ../frontend
- npm install serve
- npx serve
Follow the link that above command display
It will open an webpage where you can search title of the movie, you will get autocomplete option to select the desired movie once you select any movie name it will display details about it.