Skip to content

Commit

Permalink
feat: implement index by date and city
Browse files Browse the repository at this point in the history
  • Loading branch information
evebrnd committed Dec 3, 2024
1 parent ad10bc8 commit 1a1d952
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/by_date.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"index": {
"fields": [
{"date": "desc"}
]
},
"name": "by_date",
"type": "json"
}
10 changes: 10 additions & 0 deletions backend/by_date_and_city.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"index": {
"fields": [
{"city": "desc"},
{"date": "desc"}
]
},
"name": "by_date_and_city",
"type": "json"
}
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ services:
command:
- |
curl -X POST http://backend:5984/helios/_bulk_docs -H "Content-Type: application/json" -d @/sample_data.json
depends_on:
accessible_backend:
condition: service_completed_successfully

index:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
volumes:
- ./backend/by_date.json:/by_date.json
- ./backend/by_date_and_city.json:/by_date_and_city.json
command:
- |
curl -X POST http://backend:5984/helios/_index -H "Content-Type: application/json" -d @/by_date.json -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'
curl -X POST http://backend:5984/helios/_index -H "Content-Type: application/json" -d @/by_date_and_city.json -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'
depends_on:
accessible_backend:
condition: service_completed_successfully

0 comments on commit 1a1d952

Please sign in to comment.