What better way to understand concepts than to implement it in a project! Elasticsearch is specifically designed for high-speed, real-time search and retrieval of large amounts of data. In order to gain the ability to build robust search functionality into any future work, I decided to embark on a simple project that puts what I've learnt to practice.
Also, as a Singaporean there are places in Singapore that are still undiscovered by me, so this was a really interesting project to work on!
PUT attractions
{
"mappings": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"type": {
"type": "keyword"
},
"tags": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"description": {
"type": "text"
},
"body": {
"type": "text"
},
"rating": {
"type": "float"
},
"block" :{
"type": "text"
},
"streetName" :{
"type": "text"
},
"floorNumber" :{
"type": "text"
},
"unitNumber" :{
"type": "text"
},
"buildingName" :{
"type": "text"
},
"postalCode" :{
"type": "text"
},
"categoryDescription" :{
"type": "keyword"
},
"pricing":{
"type": "float"
},
"businessHour": {
"type": "date"
},
"officialWebsite": {
"type": "text"
},
"temporarilyClosed": {
"type": "keyword"
},
"nearestMrtStation": {
"type": "text"
}
}
}
}
Referenced: https://dev.to/lisahjung/beginners-guide-to-building-a-full-stack-app-nodejs-react-with-elasticsearch-5347