dnet-applications/dhp-broker-application/.svn/pristine/3b/3bc580deb75b4e02decdf0ed891...

61 lines
1.5 KiB
Bash

#!/bin/bash
echo
echo "Fixing events index..."
curl -XPUT -H 'Content-Type: application/json' 'http://localhost:9200/events/_mapping' -d '
{
"properties" : {
"map": {
"type": "nested",
"properties": {
"target_datasource_id": {
"type": "keyword",
"index": true
},
"target_datasource_name": {
"type": "keyword",
"index": true
}
}
}
}
}'
echo
echo
echo "Fixing notifications index..."
curl -XPUT -H 'Content-Type: application/json' 'http://localhost:9200/notifications/_mapping' -d '
{
"properties" : {
"map": {
"type": "nested",
"properties": {
"target_datasource_id": {
"type": "keyword",
"index": true
},
"target_datasource_name": {
"type": "keyword",
"index": true
}
}
}
}
}'
echo
echo
echo "Registering topic type: ENRICH/<cond>/<field>..."
curl "http://localhost:8080/api/topic-types/add" -d "name=ENRICH&expression=ENRICH%2F%3Ccond%3E%2F%3Cfield%3E&producerId=OpenAIRE&mapKeys=target_datasource_name"
echo
echo
echo "Registering topic type: ENRICH/<cond>/<field>/<subfield>..."
curl "http://localhost:8080/api/topic-types/add" -d "name=ENRICH_WITH_SUBFIELD&expression=ENRICH%2F%3Ccond%3E%2F%3Cfield%3E%2F%3Csubfield%3E&producerId=OpenAIRE&mapKeys=target_datasource_name"
echo
echo
echo "Registering topic type: ADD/<field>..."
curl "http://localhost:8080/api/topic-types/add" -d "name=ADD&expression=ADD%2F%3Cfield%3E&producerId=OpenAIRE&mapKeys=target_datasource_name"
echo
echo
echo