forked from maksrom/javascript-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb
More file actions
executable file
·27 lines (19 loc) · 869 Bytes
/
db
File metadata and controls
executable file
·27 lines (19 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Delete all
curl -XDELETE 'http://localhost:9200/*'
# Partial delete
# curl -XDELETE 'http://localhost:9200/js'
curl -XPUT 'http://localhost:9200/js' -d @db-js.json
# River will deliver from Mongo -> to index
# Index must be empty (deleted above)!
# Partial delete
# curl -XDELETE 'http://localhost:9200/_river/articles'
curl -XPUT 'http://localhost:9200/_river/articles/_meta' -d @river-articles.json
# curl -XDELETE 'http://localhost:9200/_river/tasks'
curl -XPUT 'http://localhost:9200/_river/tasks/_meta' -d @river-tasks.json
# get river status
#curl -X GET 'localhost:9200/_river/articles/_status?pretty'
# get indexed docs count
#curl -X GET 'localhost:9200/js/articles/_count?pretty'
# check
# curl 'http://localhost:9200/js/articles/_search?pretty=true' -d '{"query": {"query_string": {"query": "title:события"}}, "fields":["_id"]}'