From a8bc9b255ddffd47103172b579e47fd38c642786 Mon Sep 17 00:00:00 2001 From: Christoph Lingg Date: Mon, 12 Jan 2015 18:20:25 +0100 Subject: [PATCH] add regional name to index --- es/mappings.json | 19 ++++++++++++++++--- src/main/java/de/komoot/photon/Utils.java | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/es/mappings.json b/es/mappings.json index 4a8f6f522..5f353a4ca 100644 --- a/es/mappings.json +++ b/es/mappings.json @@ -4,9 +4,9 @@ "_all": { "enabled": false }, - "_source" : { - "excludes" : ["context.*"] - }, + "_source": { + "excludes": ["context.*"] + }, "_id": { "path": "id" }, @@ -107,6 +107,19 @@ "collector.default" ] }, + "reg": { + "type": "string", + "index": "no", + "fields": { + "raw": { + "index_analyzer": "index_raw", + "type": "string" + } + }, + "copy_to": [ + "collector.default" + ] + }, "loc": { "type": "string", "index": "no", diff --git a/src/main/java/de/komoot/photon/Utils.java b/src/main/java/de/komoot/photon/Utils.java index 98c29b4dc..19b769522 100644 --- a/src/main/java/de/komoot/photon/Utils.java +++ b/src/main/java/de/komoot/photon/Utils.java @@ -87,6 +87,9 @@ private static void writeName(XContentBuilder builder, Map name, if(name.get("old_name") != null) fNames.put("old", name.get("old_name")); + if(name.get("reg_name") != null) + fNames.put("reg", name.get("reg_name")); + write(builder, fNames, "name"); }