Skip to content

Commit

Permalink
fix(elasticsearch): Force refresh when fetching entity tags from Fron…
Browse files Browse the repository at this point in the history
…t50 (#2149)

`elasticsearch_index_template.json` is the index template that
should be applied in elastic search.
  • Loading branch information
ajordens authored Nov 17, 2017
1 parent cc1bd99 commit bde5e2f
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
90 changes: 90 additions & 0 deletions clouddriver-elasticsearch/elasticsearch_index_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"order": 0,
"template": "tags_v*",
"settings": {
"index": {
"number_of_shards": "6",
"number_of_replicas": "2",
"refresh_interval": "1s"
}
},
"mappings": {
"_default_": {
"dynamic": "false",
"dynamic_templates": [
{
"tags_template": {
"path_match": "tagsMetadata",
"mapping": {
"index": "no"
}
}
},
{
"entityRef_template": {
"path_match": "entityRef.*",
"mapping": {
"index": "not_analyzed"
}
}
}
],
"properties": {
"entityRef": {
"properties": {
"accountId": {
"index": "not_analyzed",
"type": "string"
},
"application": {
"index": "not_analyzed",
"type": "string"
},
"entityType": {
"index": "not_analyzed",
"type": "string"
},
"cloudProvider": {
"index": "not_analyzed",
"type": "string"
},
"entityId": {
"index": "not_analyzed",
"type": "string"
},
"region": {
"index": "not_analyzed",
"type": "string"
},
"account": {
"index": "not_analyzed",
"type": "string"
}
}
},
"tags": {
"type": "nested",
"properties": {
"valueType": {
"index": "not_analyzed",
"type": "string"
},
"name": {
"index": "not_analyzed",
"type": "string"
},
"namespace": {
"index": "not_analyzed",
"type": "string"
},
"value": {
"index": "not_analyzed",
"type": "string"
}
}
}
}
}
},
"aliases": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public void reindex() {
throw new ElasticSearchException("Unable to re-create index '" + activeElasticSearchIndex + "'");
}

Collection<EntityTags> entityTags = front50Service.getAllEntityTags(false);
Collection<EntityTags> entityTags = front50Service.getAllEntityTags(true);

log.info("Indexing {} entity tags", entityTags.size());
bulkIndex(
Expand Down

0 comments on commit bde5e2f

Please sign in to comment.