From 41ddcd35a5d86b9cd61a706a1c5a775b15c33fbd Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Sun, 15 Jan 2017 18:48:00 +0000 Subject: [PATCH] minor fixes git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-indexing-common@141581 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 4 ++++ .../utils/ElasticSearchRunningCluster.java | 12 ++++++------ .../utils/IndexFields.java | 18 ++++-------------- .../utils/SearchableFields.java | 18 ++++++++++++++++++ 4 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/SearchableFields.java diff --git a/distro/changelog.xml b/distro/changelog.xml index 05f025a..07aab66 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,4 +1,8 @@ + + Minor fixes + First Release diff --git a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/ElasticSearchRunningCluster.java b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/ElasticSearchRunningCluster.java index b3071c8..1e21e99 100644 --- a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/ElasticSearchRunningCluster.java +++ b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/ElasticSearchRunningCluster.java @@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory; public class ElasticSearchRunningCluster { //logger - private static final Logger _log = LoggerFactory.getLogger(ElasticSearchRunningCluster.class); + private static final Logger logger = LoggerFactory.getLogger(ElasticSearchRunningCluster.class); //properties private final static String RUNTIME_RESOURCE_NAME = "SocialPortalDataIndex"; @@ -46,19 +46,19 @@ public class ElasticSearchRunningCluster { List resources = getConfigurationFromIS(infrastructure); if (resources.size() > 1) { - _log.error("Too many Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" in this scope"); + logger.error("Too many Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" in this scope"); throw new TooManyRunningClustersException("There exist more than 1 Runtime Resource in this scope having name " + RUNTIME_RESOURCE_NAME + " and Platform " + PLATFORM_NAME + ". Only one allowed per infrasrtucture."); } else if (resources.size() == 0){ - _log.error("There is no Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" and Platform " + PLATFORM_NAME + " in this scope."); + logger.error("There is no Runtime Resource having name " + RUNTIME_RESOURCE_NAME +" and Platform " + PLATFORM_NAME + " in this scope."); throw new NoElasticSearchRuntimeResourceException(); } else { try{ - _log.debug(resources.toString()); + logger.debug(resources.toString()); for (ServiceEndpoint res : resources) { Iterator accessPointIterator = res.profile().accessPoints().iterator(); @@ -81,12 +81,12 @@ public class ElasticSearchRunningCluster { } }catch(Exception e ){ - _log.error(e.toString()); + logger.error(e.toString()); throw new ServiceEndPointException(); } } } catch (Exception e) { - _log.error(e.toString()); + logger.error(e.toString()); throw e; } diff --git a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java index d584bb9..f7ce9e9 100644 --- a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java +++ b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/IndexFields.java @@ -2,24 +2,14 @@ package org.gcube.socialnetworking.social_data_indexing_common.utils; /** * The fields used to build up the index. - * @author Costantino Perciante at ISTI-CNR - * (costantino.perciante@isti.cnr.it) - * + * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) */ public class IndexFields { - + // name of the index public static final String INDEX_NAME = "social"; - + // table for enhanced feeds public static final String EF_FEEDS_TABLE = "enhanced_feeds"; - - // enhanced feeds' fields of interest - public static final String EF_ATTACHMENT_NAME = "attachments.name"; - public static final String EF_FEED_TEXT = "feed.description"; - public static final String EF_COMMENT_TEXT = "comments.text"; - public static final String EF_PREVIEW_DESCRIPTION = "feed.linkTitle"; - public static final String EF_FEED_AUTHOR = "feed.fullName"; - public static final String EF_FEED_VRE_ID = "feed.vreid"; - public static final String EF_COMMENT_FULL_NAME = "comments.fullName"; + } diff --git a/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/SearchableFields.java b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/SearchableFields.java new file mode 100644 index 0000000..7ac6a42 --- /dev/null +++ b/src/main/java/org/gcube/socialnetworking/social_data_indexing_common/utils/SearchableFields.java @@ -0,0 +1,18 @@ +package org.gcube.socialnetworking.social_data_indexing_common.utils; + +/** + * The fields of the documents which are searchable. + * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) + */ +public enum SearchableFields { + + // enhanced posts' fields of interest + public static final String ATTACHMENT_NAME = "attachments.name"; + public static final String POST_TEXT = "feed.description"; + public static final String COMMENT_TEXT = "comments.text"; + public static final String PREVIEW_DESCRIPTION = "feed.linkTitle"; + public static final String POST_AUTHOR = "feed.fullName"; + public static final String POST_VRE_ID = "feed.vreid"; + public static final String COMMENT_AUTHOR = "comments.fullName"; + +}