From 6d1e755b9eb5e8ea8f9aedb9e969b79c96dec5ce Mon Sep 17 00:00:00 2001
From: David Milward
Date: Fri, 17 Feb 2017 15:32:50 +0100
Subject: [PATCH] MET-1375 Added a fix for the search in template, plus some
comments
---
.../templates/infinitePanelsShort.tpl.html | 14 +-------------
.../core/ui/bs/detailSections.coffee | 6 ++++++
.../core/elasticsearch/ElasticSearchService.groovy | 5 ++++-
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/mc/core/ui/infinite-list/templates/infinitePanelsShort.tpl.html b/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/mc/core/ui/infinite-list/templates/infinitePanelsShort.tpl.html
index 3b0dac17bf..58a686177b 100644
--- a/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/mc/core/ui/infinite-list/templates/infinitePanelsShort.tpl.html
+++ b/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/mc/core/ui/infinite-list/templates/infinitePanelsShort.tpl.html
@@ -39,22 +39,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/modelcatalogue/core/ui/bs/detailSections.coffee b/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/modelcatalogue/core/ui/bs/detailSections.coffee
index 067388da9b..6a0575c3af 100644
--- a/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/modelcatalogue/core/ui/bs/detailSections.coffee
+++ b/ModelCatalogueCorePluginTestApp/grails-app/assets/javascripts/modelcatalogue/core/ui/bs/detailSections.coffee
@@ -215,6 +215,7 @@ x in ['apple', 'banana', 'cherry']
'dataClass'
]
keys: []
+ hideInOverview: true
template: '/mc/core/ui/detail-sections/tableData.html'
actions: [
{
@@ -277,6 +278,7 @@ x in ['apple', 'banana', 'cherry']
'dataClass'
]
keys: []
+ hideInOverview: true
template: '/mc/core/ui/detail-sections/tableData.html'
actions: [
{
@@ -328,6 +330,7 @@ x in ['apple', 'banana', 'cherry']
'dataType'
]
keys: []
+ hideInOverview: true
template: '/mc/core/ui/detail-sections/tableData.html'
getList: (element) ->
return @result if @result
@@ -365,6 +368,7 @@ x in ['apple', 'banana', 'cherry']
'validationRule'
]
keys: []
+ hideInOverview: true
template: '/mc/core/ui/detail-sections/tableData.html'
actions: [
{
@@ -421,6 +425,7 @@ x in ['apple', 'banana', 'cherry']
'validationRule'
]
keys: []
+ hideInOverview: true
template: '/mc/core/ui/detail-sections/tableData.html'
actions: [
{
@@ -478,6 +483,7 @@ x in ['apple', 'banana', 'cherry']
'dataElement'
]
keys: []
+ hideInOverview: true
template: '/mc/core/ui/detail-sections/tableData.html'
actions: [
{
diff --git a/ModelCatalogueCorePluginTestApp/grails-app/services/org/modelcatalogue/core/elasticsearch/ElasticSearchService.groovy b/ModelCatalogueCorePluginTestApp/grails-app/services/org/modelcatalogue/core/elasticsearch/ElasticSearchService.groovy
index 727a50ff01..a56cd30f94 100644
--- a/ModelCatalogueCorePluginTestApp/grails-app/services/org/modelcatalogue/core/elasticsearch/ElasticSearchService.groovy
+++ b/ModelCatalogueCorePluginTestApp/grails-app/services/org/modelcatalogue/core/elasticsearch/ElasticSearchService.groovy
@@ -520,7 +520,7 @@ class ElasticSearchService implements SearchCatalogue {
// relationship copies relationship type mapping
mapping[typeName].properties.data_model = getMapping(DataModel).data_model
}
-
+ //Ignore date information NOT mapped as date
if (toplevel) {
mapping[typeName].date_detection = false
}
@@ -633,10 +633,13 @@ class ElasticSearchService implements SearchCatalogue {
if (response.exists) {
return just(response.index)
}
+
+ //Create elastic serach builder
CreateIndexRequestBuilder request = client.admin()
.indices()
.prepareCreate(response.index)
+ //add mappings for index
for (Class type in supportedTypes) {
request.addMapping(getTypeName(type), getMapping(type, true))
}