Elasticsearch model doesn't specify all mappings
Writing es-git-go I noticed that an initial run of rake gitlab:elastic:recreate_index
does not restore all fields used by the existing Ruby indexer. Missing:
- repository.blob.type
- commit.committer.* (but commit.commiter.* does exist)
- repository.commit.type
I've attached the JSON files for the mappings, before and after running the indexer; here's the diff:
--- es-before.mapping.json 2017-03-27 11:07:03.000000000 +0100
+++ es-after.mapping.json 2017-03-27 11:07:36.000000000 +0100
@@ -322,6 +322,15 @@
},
"rid": {
"type": "keyword"
+ },
+ "type": {
+ "type": "text",
+ "fields": {
+ "keyword": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
}
}
},
@@ -359,6 +368,37 @@
}
}
},
+ "committer": {
+ "properties": {
+ "email": {
+ "type": "text",
+ "fields": {
+ "keyword": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
+ },
+ "name": {
+ "type": "text",
+ "fields": {
+ "keyword": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
+ },
+ "time": {
+ "type": "text",
+ "fields": {
+ "keyword": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
+ }
+ }
+ },
"id": {
"type": "text",
"index_options": "offsets",
@@ -375,6 +415,15 @@
"type": "text",
"index_options": "offsets",
"analyzer": "sha_analyzer"
+ },
+ "type": {
+ "type": "text",
+ "fields": {
+ "keyword": {
+ "type": "keyword",
+ "ignore_above": 256
+ }
+ }
}
}
}