-Added content type to gendb to support elastic search 6.+ comms.
This commit is contained in:
parent
16ee96a883
commit
e9ee65be33
1 changed files with 3 additions and 3 deletions
6
gendb.sh
6
gendb.sh
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash
|
||||
if [ "$(curl -IHEAD -w '%{http_code}' 'localhost:9200/claims' -o /dev/null --connect-timeout 3 --max-time 5)" == "200" ] ;
|
||||
if [ "$(curl -IHEAD -w '%{http_code}' 'localhost:9200/claims' -o /dev/null --connect-timeout 3 --max-time 5)" == "200" ] ;
|
||||
then
|
||||
echo "Index already exists." ;
|
||||
exit 1;
|
||||
else
|
||||
echo "Index did not exist, creating..." ;
|
||||
curl -X PUT http://localhost:9200/claims -d '{ "settings" : { "number_of_shards" : 1 }, "mappings" : { "claim" : { "properties" : { "value" : { "type" : "nested" }, "suggest_name": { "type": "completion" }, "suggest_desc": { "type": "completion" } } } } }';
|
||||
curl -X PUT http://localhost:9200/claims -H '"Content-Type: application/json"'-d '{ "settings" : { "number_of_shards" : 1 }, "mappings" : { "claim" : { "properties" : { "value" : { "type" : "nested" }, "suggest_name": { "type": "completion" }, "suggest_desc": { "type": "completion" } } } } }';
|
||||
exit 0;
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue