-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename indexer mapping to content mapping to be consistent with OS_In…
…dexInit.sh; Add mapping files and OS_IndexInit.sh to archetype to have it in a generated project without the need to copy paste from the SC OS Jar file _or_ copy paste from soure. Update archetype xml config to include *.sh and *.mapping Signed-off-by: Richard Zowalla <[email protected]>
- Loading branch information
Showing
5 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
external/opensearch/archetype/src/main/resources/archetype-resources/OS_IndexInit.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
OSHOST=${1:-"http://localhost:9200"} | ||
OSCREDENTIALS=${2:-"-u opensearch:passwordhere"} | ||
|
||
for name in status content | ||
do | ||
curl $OSCREDENTIALS -s -XDELETE "$OSHOST/$name/" > /dev/null | ||
echo "Deleted '$name' index, now recreating it..." | ||
curl $OSCREDENTIALS -s -XPUT "$OSHOST/$name" -H 'Content-Type: application/json' --upload-file src/main/resources/$name.mapping | ||
echo "" | ||
done | ||
|
||
### metrics | ||
|
||
curl $OSCREDENTIALS -s -XDELETE "$OSHOST/metrics*/" > /dev/null | ||
|
||
echo "Deleted 'metrics' index, now recreating it..." | ||
|
||
# http://localhost:9200/metrics/_mapping/status?pretty | ||
curl $OSCREDENTIALS -s -XPOST "$OSHOST/_template/metrics-template" -H 'Content-Type: application/json' --upload-file src/main/resources/metrics.mapping | ||
|
||
echo "" |
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
...earch/archetype/src/main/resources/archetype-resources/src/main/resources/metrics.mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"index_patterns": "metrics*", | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 1, | ||
"refresh_interval": "30s" | ||
}, | ||
"number_of_replicas": 0 | ||
}, | ||
"mappings": { | ||
"_source": { "enabled": true }, | ||
"properties": { | ||
"name": { | ||
"type": "keyword" | ||
}, | ||
"stormId": { | ||
"type": "keyword" | ||
}, | ||
"srcComponentId": { | ||
"type": "keyword" | ||
}, | ||
"srcTaskId": { | ||
"type": "short" | ||
}, | ||
"srcWorkerHost": { | ||
"type": "keyword" | ||
}, | ||
"srcWorkerPort": { | ||
"type": "integer" | ||
}, | ||
"timestamp": { | ||
"type": "date", | ||
"format": "date_optional_time" | ||
}, | ||
"value": { | ||
"type": "double" | ||
} | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...search/archetype/src/main/resources/archetype-resources/src/main/resources/status.mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 10, | ||
"number_of_replicas": 1, | ||
"refresh_interval": "5s" | ||
} | ||
}, | ||
"mappings": { | ||
"dynamic_templates": [{ | ||
"metadata": { | ||
"path_match": "metadata.*", | ||
"match_mapping_type": "string", | ||
"mapping": { | ||
"type": "keyword" | ||
} | ||
} | ||
}], | ||
"_source": { | ||
"enabled": true | ||
}, | ||
"properties": { | ||
"key": { | ||
"type": "keyword", | ||
"index": true | ||
}, | ||
"nextFetchDate": { | ||
"type": "date", | ||
"format": "date_optional_time" | ||
}, | ||
"status": { | ||
"type": "keyword" | ||
}, | ||
"url": { | ||
"type": "keyword" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"settings": { | ||
"index": { | ||
"number_of_shards": 5, | ||
"number_of_replicas": 1, | ||
"refresh_interval": "60s" | ||
} | ||
}, | ||
"mappings": { | ||
"_source": { | ||
"enabled": true | ||
}, | ||
"properties": { | ||
"content": { | ||
"type": "text" | ||
}, | ||
"description": { | ||
"type": "text" | ||
}, | ||
"domain": { | ||
"type": "keyword" | ||
}, | ||
"format": { | ||
"type": "keyword" | ||
}, | ||
"keywords": { | ||
"type": "keyword" | ||
}, | ||
"host": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text" | ||
}, | ||
"url": { | ||
"type": "keyword" | ||
} | ||
} | ||
} | ||
} |