@Override
public int compareTo(Cluster o) {
- if (this.getShardNum() >= o.getShardNum())
+ if (this.getShardNum() >= o.getShardNum()) {
return -1;
- else
+ }else {
return 1;
+ }
}
public static final class CLUSTER_TYPE {
+
+ /**
+ * 日期索引(旧)
+ */
+ public static final int normal_cluster_type = 0; // 172.18.1.134:9201 的集群 日期索引 SQ_Normal
+ /**
+ * 日期索引(新)
+ */
+ public static final int newnormal_cluster_type = 1; // 172.18.1.134:9201 的集群 日期索引 SQ_Normal_2
/**
- * 小集群
+ * 专题索引(旧)
*/
- public static final int mini_cluster_type = 2; // 111 的ES 集群 专题索引 SQ_Mini
+ public static final int mini_cluster_type = 2; // 172.18.1.147:9213 的ES 集群 专题索引 SQ_Mini
/**
- * 大集群
+ * 专题索引(新)
*/
- public static final int normal_cluster_type = 0; // 109 的集群 日期索引 SQ_Normal
-// /**
-// * 缓存
-// */
-// // public static final int subject_cluster_type = 2; //
-//
-// /**
-// * 微博转发
-// */
-// public static final int weibo_cluster_type = 4; // 147的ES 集群 (前台打标后)SQ_Mini
-//
-// public static final int reply_cluster_type = 7; // 已废弃 (原160的ES)
-// /**
-// * 2期数据分析 集群
-// */
-// public static final int data_analysis_cluster_type = 5; // 158 的ES 集群(后台打标后的数据) SQ_Reputation_new
-
-// /**
-// * 对应索引以 cl_company_*
-// */
-// public static final int data_company_analysis_cluster_type = 6; // 已废弃 (原160的ES)
+ public static final int special_cluster_type = 4; // 172.18.1.81:9201 的ES 集群 专题索引 SQ_Mini_2
}
public static Long getClusterIdByType(SubjectCluster subjectCluster, int type) {
- if (type == Cluster.CLUSTER_TYPE.mini_cluster_type) {
+ if (type == CLUSTER_TYPE.mini_cluster_type) {
return subjectCluster.getMiniClusterId();
- } else if (type == Cluster.CLUSTER_TYPE.normal_cluster_type) {
+ } else if (type == CLUSTER_TYPE.normal_cluster_type) {
return subjectCluster.getNormalClusterId();
// } else if (type == Cluster.CLUSTER_TYPE.subject_cluster_type) {
// return subjectCluster.getClusterId();
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/entity/mysql/topic/ParseExcelTask.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/entity/mysql/topic/ParseExcelTask.java
index 44086dd..8c87daa 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/entity/mysql/topic/ParseExcelTask.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/common/web/entity/mysql/topic/ParseExcelTask.java
@@ -1,6 +1,5 @@
package com.bfd.mf.common.web.entity.mysql.topic;
-import com.bfd.mf.common.web.entity.mysql.Model;
import org.joda.time.DateTime;
import javax.persistence.*;
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/UserRepository.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/UserRepository.java
deleted file mode 100644
index 20be0b9..0000000
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/UserRepository.java
+++ /dev/null
@@ -1,469 +0,0 @@
-///*
-// * Copyright (C) 2016 Baifendian Corporation
-// *
-// * Licensed under the Apache License, Version 2.0 (the "License");
-// * you may not use this file except in compliance with the License.
-// * You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing, software
-// * distributed under the License is distributed on an "AS IS" BASIS,
-// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// */
-//
-//package com.bfd.mf.common.web.repository.mysql;
-//
-//import com.bfd.mf.common.web.entity.mysql.User;
-//import org.springframework.data.jpa.repository.Query;
-//import org.springframework.data.repository.PagingAndSortingRepository;
-//import org.springframework.data.repository.query.Param;
-//import org.springframework.stereotype.Repository;
-//
-//@Repository
-//public interface UserRepository extends PagingAndSortingRepository {
-//
-//// User findByUserNameAndDel(String userName, Boolean del);
-////
-//// List findByAccountAndDel(String account, Boolean del);
-////
-////
-//// @Query(value = "SELECT * FROM cl_user WHERE del = FALSE AND status = 1 AND account = ?1 ", nativeQuery = true)
-//// User findAvailableByAccount(String account);
-////
-//// @Query(value = "SELECT * FROM cl_user WHERE del = FALSE AND account = ?1 ", nativeQuery = true)
-//// User findUserByAccount(String account);
-////
-//// User findByUserNameAndPasswordAndDel(String userName, String pwd, Boolean del);
-////
-//// User findByAccountAndPasswordAndDel(String account, String pwd, Boolean del);
-////
-//// User findByCompanyIdAndUserNameAndDel(Long companyId, String userName, Boolean del);
-////
-//// User findByCompanyIdAndAccountAndDel(Long companyId, String account, Boolean del);
-//
-// User findByTokenAndDel(String token, Boolean del);
-//
-//// @Query(value = "SELECT * FROM cl_user WHERE token = ?1 AND status = ?2", nativeQuery = true)
-//// User findByTokenAndStatus(String token, int status);
-////
-//// User findByTokenAndStatusAndDel(String token, int status, Boolean del);
-//
-// @Query(value = "SELECT company_id FROM cl_user WHERE token = :token AND del = :del", nativeQuery = true)
-// Long getCompanyIdByTokenAndDel(@Param("token") String token, @Param("del") Boolean del);
-//
-//
-//// @Query("select u from User u where u.roleId =?1 or u.roleId like '?1,%' or u.roleId like '%,?1' or u.roleId like " +
-//// "'%,?1,%' and del = false")
-//// List findByRoleId(String rid);
-////
-//// List findByStatusAndCompanyIdAndDel(Integer status, Long companyId, Boolean del);
-////
-//// List findByCompanyIdAndDel(Long companyId, Boolean del);
-////
-////
-//// /**
-//// * Get all users with role and creator information
-//// *
-//// * @param companyId
-//// * @return
-//// */
-//// @Query(value = "SELECT " +
-//// "a.id , " +
-//// "a.token , " +
-//// "a.account , " +
-//// "a.userName , " +
-//// "r.id AS roleId , " +
-//// "r.name as roleName, " +
-//// "b.userName AS creator, " +
-//// "a.status, " +
-//// "a.email, " +
-//// "a.wechat, " +
-//// "a.wechatId, " +
-//// "a.mobile, " +
-//// "a.wechatVerified, " +
-//// "a.wechatOpenId " +
-//// "FROM " +
-//// "User a , " +
-//// "User b , " +
-//// "Role r " +
-//// "WHERE a.companyId = b.companyId " +
-//// "AND a.companyId = :cid " +
-//// "AND a.parentId = b.id " +
-//// "AND a.roleId = r.id " +
-//// "AND a.userName like :name " +
-//// "AND (a.del IS NULL OR a.del = false)" +
-//// "AND a.wechat IS NOT NULL " +
-//// "AND a.wechatId is NOT NULL " +
-//// "AND a.wechat <> '' " +
-//// "AND a.wechatId <> '' " +
-//// "AND a.wechatVerified in (:scope) " +
-//// "order by a.createdTime desc")
-//// Page findClientUserWeixinList(@Param("cid") Long companyId, @Param("name") String filterName, Pageable
-//// pageable, @Param("scope") List scope);
-////
-////
-//// /**
-//// * Get all users with role and creator information
-//// *
-//// * @param companyId
-//// * @return
-//// */
-//// @Query(value = "SELECT " +
-//// "a.id , " +
-//// "a.token , " +
-//// "a.account , " +
-//// "a.userName , " +
-//// "r.id AS roleId , " +
-//// "r.name as roleName, " +
-//// "b.userName AS creator, " +
-//// "a.status, " +
-//// "a.email, " +
-//// "a.wechat, " +
-//// "a.wechatId, " +
-//// "a.mobile " +
-//// "FROM " +
-//// "User a , " +
-//// "User b , " +
-//// "Role r " +
-//// "WHERE a.companyId = b.companyId " +
-//// "AND a.companyId = :cid " +
-//// "AND a.parentId = b.id " +
-//// "AND a.roleId = r.id " +
-//// "AND a.userName like :name " +
-//// "AND (a.del IS NULL OR a.del = false)" +
-//// "AND a.email IS NOT NULL " +
-//// "AND a.email <> '' " +
-//// "order by a.createdTime desc")
-//// Page findClientUserEmailList(@Param("cid") Long companyId, @Param("name") String filterName, Pageable
-//// pageable);
-////
-//// @Modifying
-//// @Query("update User set status = ?2, updatedTime = ?3 where id = ?1")
-//// int switchUserStatus(Long userId, Integer status, Long updateTime);
-////
-//// @Modifying
-//// @Query("update User set del = ?2, updatedTime = ?3 where id = ?1")
-//// int deleteUser(Long userId, Boolean isDel, Long updateTime);
-////
-////
-////// @Query("SELECT " +
-////// "a.id ," +
-////// "a.account , " +
-////// "a.userName, " +
-////// "a.email, " +
-////// "a.wechat, " +
-////// "a.wechatId, " +
-////// "a.mobile, " +
-////// "r.id AS userGroupId , " +
-////// "r.name as userGroupName, " +
-////// "a.status, " +
-////// "a.createdTime " +
-////// "FROM " +
-////// "User a , " +
-////// "UserGroup r " +
-////// "WHERE a.id = :uid " +
-////// "AND a.userGroupId = r.id " +
-////// "AND (a.del = :isDel ) " +
-////// "order by a.createdTime desc")
-////// List fetchUser(@Param("uid") Long userId, @Param("isDel") Boolean isDel);
-////
-////
-//// /**
-//// * Check if reach user create limitation, return Y if avaliable
-//// *
-//// * Return NULL if not available
-//// *
-//// * @param token
-//// * @return
-//// */
-//// @Query(value = "SELECT \"Y\" AS VALID " +
-//// "FROM " +
-//// " (SELECT company_user_count AS u_limit " +
-//// " FROM cl_company " +
-//// " WHERE status = 1 " +
-//// " AND id = " +
-//// " (SELECT company_id " +
-//// " FROM cl_user " +
-//// " WHERE token = ?1)) a, " +
-//// " (SELECT count(1) AS u_count " +
-//// " FROM cl_user " +
-//// " WHERE company_id = " +
-//// " (SELECT company_id " +
-//// " FROM cl_user " +
-//// " WHERE token = ?1) " +
-//// " AND del = FALSE) b " +
-//// "WHERE a.u_limit >= b.u_count", nativeQuery = true)
-//// List checkIfUserLimitReached(String token);
-////
-//// /**
-//// * Check if user over dead date and open status, return true if available
-//// *
-//// * Return false if not available
-//// *
-//// * @param token
-//// * @return
-//// */
-//// @Query(value =
-//// " SELECT \"Y\" AS flag " +
-//// " FROM cl_company " +
-//// " WHERE status = 1 " +
-//// " AND deadline_time < UNIX_TIMESTAMP() " +
-//// " AND id = " +
-//// " (SELECT company_id " +
-//// " FROM cl_user " +
-//// " WHERE token = ?1 and del = false and status = 1)", nativeQuery = true)
-//// List checkIfUserOverDeadDate(String token);
-////
-//// /**
-//// * 返回话题上限数
-//// *
-//// * SELECT company_topic_count FROM cl_company
-//// * WHERE id=(SELECT company_id FROM cl_user WHERE token = '8FB24E550815BCBA')
-//// *
-//// * @param token
-//// * @return
-//// */
-//// @Query(value =
-//// " SELECT company_topic_count " +
-//// " FROM cl_company " +
-//// " WHERE id = " +
-//// " (SELECT company_id" +
-//// " FROM cl_user " +
-//// " WHERE token = ?1)", nativeQuery = true)
-//// int getCompanyTopicCount(String token);
-////
-//// /**
-//// * 返回创建话题的ids
-//// *
-//// * @param token
-//// * @return
-//// */
-//// @Query(value =
-//// " SELECT topic_ids" +
-//// " FROM cl_role " +
-//// " WHERE company_id = " +
-//// " (SELECT company_id" +
-//// " FROM cl_user " +
-//// " WHERE token = ?1) ", nativeQuery = true)
-//// List getSujectIds(String token);
-////
-//// /**
-//// * 返回客户创建的话题总数的结果
-//// *
-//// * SELECT COUNT(DISTINCT(label_id)) FROM mf_subject
-//// * WHERE label_id IN(
-//// * SELECT topic_ids FROM mf_role
-//// * WHERE company_id ='14')
-//// *
-//// * @param labelIds
-//// * @return
-//// */
-//// @Query(value =
-//// " SELECT count(1) " +
-//// " FROM cl_subject " +
-//// " WHERE label_id IN " +
-//// " (?1)", nativeQuery = true)
-//// int getCompanyResult(Set labelIds);
-////
-//// @Query("select u from User u, Role r " +
-//// "where u.roleId = r.id and u.companyId =:cid and " +
-//// "r.isSystem >= (select r2.isSystem from Role r2 where r2.id = :rid) and u.del = false")
-//// List getUserListByCompanyAndRole(@Param("cid") Long companyId, @Param("rid") Long roleId);
-////
-//// @Query("select " +
-//// "u.account," +
-//// "wu.openId," +
-//// "wu.subscribe," +
-//// "wu.nickName," +
-//// "wu.sex," +
-//// "wu.language," +
-//// "wu.city," +
-//// "wu.province," +
-//// "wu.headimgUrl," +
-//// "wu.subscribeTime," +
-//// "wu.unionId," +
-//// "wu.remark," +
-//// "wu.grouId," +
-//// "wu.tagIdList," +
-//// "wu.mfRemark " +
-//// "from User u, Role r, WechatBind wb, WechatUser wu " +
-//// "where u.roleId = r.id and u.companyId =:cid and u.id = wb.userId and wb.openId = wu.openId and " +
-//// "r.isSystem >= (select r2.isSystem from Role r2 where r2.id = :rid) and u.del = false")
-//// List getUserInfoListByCompanyAndRole(@Param("cid") Long companyId, @Param("rid") Long roleId);
-////
-//// @Query(value = "select * from cl_user where id =?1", nativeQuery = true)
-//// User getUserById(long creator);
-////
-//// /**
-//// * 返回客户ID
-//// *
-//// * @param token
-//// * @return
-//// */
-//// @Query(value = "select company_id from cl_user where token =?1", nativeQuery = true)
-//// Integer findCompanyIdByToken(String token);
-////
-//// /**
-//// * 返回有效客户
-//// *
-//// * @param id
-//// * @param flag
-//// * @return
-//// */
-//// @Query(value = "SELECT token FROM cl_user WHERE company_id=?1 AND del=?2", nativeQuery = true)
-//// List findTokenByCompanyId(Long id, boolean flag);
-////
-//// @Query(value = "SELECT token FROM cl_user WHERE company_id =?1 AND del=?2 AND STATUS=?3 limit 1", nativeQuery = true)
-//// String findEffectTokenByCompanyIdAndDel(Long companyId, boolean del, int status);
-////
-//// @Query(value =
-//// "select company_id " +
-//// "from cl_user " +
-//// "where token = ?1 and del=?2", nativeQuery = true)
-//// Long findCompanyIdByTokenAndDel(String token, boolean del);
-////
-//// @Query(value = "SELECT account FROM cl_user WHERE email=?1 AND status=?2", nativeQuery = true)
-//// String fetchUserOfAccountByReceiverAndStatus(String receiver, int status);
-////
-//// @Query(value =
-//// " SELECT company_keyword_count " +
-//// " FROM cl_company " +
-//// " WHERE id = " +
-//// " (SELECT company_id" +
-//// " FROM cl_user " +
-//// " WHERE token = ?1)", nativeQuery = true)
-//// int getCompanyKeywordCount(String token);
-////
-//// @Query(value = "SELECT company_exclude_count FROM cl_company WHERE id = (SELECT company_id FROM cl_user WHERE token = ?1)", nativeQuery = true)
-//// int getCompanyExcludeCount(String token);
-////
-//// @Query(value = "SELECT role_id FROM cl_user WHERE token = :token AND del = :del", nativeQuery = true)
-//// String getRoleIdByTokenAndDel(@Param("token") String token, @Param("del") Boolean del);
-////
-//// /**
-//// * Get all users with role and creator information
-//// *
-//// * @param companyId
-//// * @return
-//// */
-//// @Query(value = "SELECT " +
-//// "a.id , " +
-//// "a.account , " +
-//// "a.userName , " +
-//// "r.id AS userGroupId , " +
-//// "r.name as userGroupName, " +
-//// //"b.userName AS creator, " +
-//// " (case when a.parentId = 0 then '系统' when m.roleType = 1 then '管理员' else b.account end ) AS creator , " +
-//// "a.status, " +
-//// "a.email, " +
-//// "a.wechat, " +
-//// "a.wechatId, " +
-//// "a.mobile, " +
-//// "a.createdTime, "+
-//// "r.roleType "+
-//// "FROM " +
-//// "User a , " +
-//// "User b , " +
-//// "UserGroup m , " +
-//// "UserGroup r " +
-//// "WHERE " +
-//// //"a.companyId = b.companyId " +
-//// " a.companyId = :cid " +
-//// "AND a.userGroupId = r.id " +
-//// "AND a.userGroupId = :ugid " +
-//// "AND b.userGroupId = m.id " +
-//// "AND a.parentId = b.id " +
-//// "AND a.isShadow <> :isShadow " +
-//// //"AND a.roleId = r.id " +
-//// "AND (a.userName like :name or a.account like :name) " +
-//// "AND (a.del = :isDel) " +
-//// "order by a.createdTime desc" )
-//// Page findClientUserListByGroupId(@Param("cid") Long companyId, @Param("name") String filterName, Pageable pageable, @Param("ugid") Long userGroupId, @Param("isDel") Boolean isDel, @Param("isShadow") Integer isShadow);
-////
-//// @Query(value = "SELECT * FROM cl_user WHERE account = ?1", nativeQuery = true)
-//// User findByAccount(String account);
-////
-//// @Query(value = "SELECT * FROM cl_user WHERE user_group_id = ?1 and del = ?2", nativeQuery = true)
-//// List findByUserGroupId(String userGroupId, Boolean del);
-////
-//// @Query(value = "SELECT token FROM cl_user WHERE id IN (?1)", nativeQuery = true)
-//// List getTokenListByIdList(List idList);
-////
-//// @Query(value = "SELECT id FROM cl_user WHERE token IN (?1)", nativeQuery = true)
-//// List getIdListByTokenList(List tokenList);
-////
-//// @Query(value = "SELECT " +
-//// "a.id , " +
-//// "a.account , " +
-//// "a.userName , " +
-//// "r.id AS userGroupId , " +
-//// "r.name as userGroupName, " +
-//// // "b.userName AS creator, " +
-//// " (case when a.parentId = 0 then '系统' when m.roleType = 1 then '管理员' else b.account end ) AS creator , " +
-//// "a.status, " +
-//// "a.email, " +
-//// "a.wechat, " +
-//// "a.wechatId, " +
-//// "a.mobile, " +
-//// "a.createdTime, " +
-//// "r.roleType " +
-//// "FROM " +
-//// "User a , " +
-//// "User b , " +
-//// "UserGroup m , " +
-//// "UserGroup r " +
-//// "WHERE " +
-//// //"a.companyId = b.companyId " +
-//// "a.companyId = :cid " +
-//// "AND a.parentId = b.id " +
-//// "AND a.userGroupId = r.id " +
-//// "AND b.userGroupId = m.id " +
-//// "AND a.isShadow <> :isShadow " +
-//// "AND r.roleType not in :ugrt " +
-//// "AND (a.userName like :name or a.account like :name) " +
-//// "AND (a.del = :isDel ) " +
-//// "order by a.createdTime desc")
-//// Page findClientUserListFilterByRole(@Param("cid") Long companyId,
-//// @Param("name") String filterName,
-//// Pageable pageable,
-//// @Param("isDel") Boolean isDel,
-//// @Param("ugrt") List userGroupRoleType,
-//// @Param("isShadow") Integer isShadow);
-//
-//// @Query(value = "SELECT id,account,user_group_id FROM cl_user WHERE company_id = ?1 and del = ?2 ORDER BY created_time DESC ", nativeQuery = true)
-//// List findAllByCompanyId(Long companyId, boolean del);
-////
-//// @Query(value = "SELECT * FROM cl_user WHERE id = ?1 AND status = ?2 AND del = ?3", nativeQuery = true)
-//// User findByIdAndStatusAndDel(Long userId, Integer userNormal, Boolean userNotDelete);
-////
-//// @Query(value = "SELECT * FROM cl_user WHERE token = ?1 ", nativeQuery = true)
-//// User findBytoken(String creator);
-//
-//// @Query("SELECT " +
-//// "a.id ," +
-//// "a.account , " +
-//// "a.userName, " +
-//// "a.email, " +
-//// "a.wechat, " +
-//// "a.wechatId, " +
-//// "a.mobile, " +
-//// "r.id AS userGroupId , " +
-//// "r.name as userGroupName, " +
-//// "a.status, " +
-//// "a.createdTime, " +
-//// "a.password " +
-//// "FROM " +
-//// "User a , " +
-//// "UserGroup r " +
-//// "WHERE a.token = :token " +
-//// "AND a.userGroupId = r.id " +
-//// "AND (a.del = :isDel ) " +
-//// "order by a.createdTime desc")
-//// List fetchUserByTokenAndDel(@Param("token") String token, @Param("isDel") Boolean userNotDelete);
-//
-//// @Query(value = "select g.channel_ids from cl_user u, cl_user_group g where u.token = ?1 AND g.id = u.user_group_id ", nativeQuery = true)
-//// String getChannelIdsByToken(String token);
-//}
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/topic/ParseExcelTaskRepository.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/topic/ParseExcelTaskRepository.java
index 7144943..e6ae3b4 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/topic/ParseExcelTaskRepository.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/common/web/repository/mysql/topic/ParseExcelTaskRepository.java
@@ -1,7 +1,6 @@
package com.bfd.mf.common.web.repository.mysql.topic;
import com.bfd.mf.common.web.entity.mysql.topic.ParseExcelTask;
-import com.bfd.mf.common.web.entity.mysql.topic.Subject;
import org.apache.ibatis.annotations.Options;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/params/QueryRequest.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/params/QueryRequest.java
index 7310cc9..ac25ae2 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/params/QueryRequest.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/params/QueryRequest.java
@@ -19,6 +19,7 @@ package com.bfd.mf.common.web.vo.params;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -27,7 +28,6 @@ import java.util.List;
public class QueryRequest implements Serializable {
private static final long serialVersionUID = 1L;
-
// 必传字段
// private Long subjectId;
@ApiModelProperty(value = "subjectId" , required = true , notes = "专题ID")
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/analysis/DataLineCount.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/analysis/DataLineCount.java
deleted file mode 100644
index 0cef43a..0000000
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/analysis/DataLineCount.java
+++ /dev/null
@@ -1,88 +0,0 @@
-///*
-// * Copyright (C) 2016 Baifendian Corporation
-// *
-// * Licensed under the Apache License, Version 2.0 (the "License");
-// * you may not use this file except in compliance with the License.
-// * You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing, software
-// * distributed under the License is distributed on an "AS IS" BASIS,
-// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// */
-//
-//package com.bfd.mf.common.web.vo.view.analysis;
-//
-///**
-// * 折线图统计
-// *
-// * @author quanyou.chang
-// * @create 2016-09-22 10:43
-// **/
-//public class DataLineCount extends DataCountBase implements Comparable {
-// /**
-// * 时间戳
-// */
-// private Long timestamp;
-// /**
-// * 值
-// */
-// private Long data;
-//
-// public Long getTimestamp() {
-// return timestamp;
-// }
-//
-// public void setTimestamp(Long timestamp) {
-// this.timestamp = timestamp;
-// }
-//
-//
-// public String getName() {
-// return name;
-// }
-//
-// public void setName(String name) {
-// this.name = name;
-// }
-//
-// /**
-// * 坐标
-// */
-// private String name;
-//
-//
-// public Long getData() {
-// return data;
-// }
-//
-// public void setData(Long data) {
-// this.data = data;
-// }
-//
-// @Override
-// public int compareTo(DataLineCount o) {
-// return this.getTimestamp().compareTo(o.getTimestamp());
-// }
-// @Override
-// public boolean equals(Object o) {
-// if (this == o) return true;
-// if (o == null || getClass() != o.getClass()) return false;
-//
-// DataLineCount that = (DataLineCount) o;
-//
-// if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false;
-// return name != null ? name.equals(that.name) : that.name == null;
-//
-// }
-//
-// @Override
-// public int hashCode() {
-// int result = timestamp != null ? timestamp.hashCode() : 0;
-// result = 31 * result + (name != null ? name.hashCode() : 0);
-// return result;
-// }
-//}
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorBaseEntity.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorBaseEntity.java
index 169e784..468fd44 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorBaseEntity.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorBaseEntity.java
@@ -17,14 +17,12 @@
package com.bfd.mf.common.web.vo.view.monitor;
import com.alibaba.fastjson.JSONObject;
-import com.bfd.mf.common.util.constants.ESConstant;
import com.google.common.base.Objects;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -37,6 +35,8 @@ public class ESMonitorBaseEntity implements Comparable, Ser
private String author; // 作者
private String authorId; // 作者ID
private String avatar; // 作者头像
+ private String authornickname; // 作者昵称
+ private String userType;
private String title; // 文章title
private Long pubTime = 0L; //文章发布时间
@@ -65,14 +65,29 @@ public class ESMonitorBaseEntity implements Comparable, Ser
private String commentId;
private String content; // 内容
- private String contentSimHash; //文章SimHash
- private Integer contentSize; //正文长度
- // 转、赞、评 数字
+ private String forwardContent;
+ /**
+ * 文章SimHash
+ */
+ private String contentSimHash;
+ /**
+ * //正文长度
+ */
+ private Integer contentSize;
+ /**
+ * 转、赞、评 ,收藏数、阅读数、好看数的 数字
+ */
+
private String quoteCount ;
private String attitudesCount;
private Integer commentsCount = 0;
private String collectCount;
- // 词云
+ private int readCount;
+ private int viewCnt;
+
+ /**
+ * 词云
+ */
private List hlKeyWords;
private List places;
private List hashTag;
@@ -122,42 +137,101 @@ public class ESMonitorBaseEntity implements Comparable, Ser
private String promotionInfo;
- private int readCount;
- public int getReadCount() {
- return readCount;
+ private String forumScore;
+ private String userTypeContent;
+ private String pageType;
+
+ private int hasImage;
+ private int hasVideo;
+ private int hasFile;
+
+ public int getViewCnt() {
+ return viewCnt;
}
- public void setReadCount(int readCount) {
- this.readCount = readCount;
+ public void setViewCnt(int viewCnt) {
+ this.viewCnt = viewCnt;
+ }
+
+ public int getHasImage() {
+ return hasImage;
+ }
+
+ public void setHasImage(int hasImage) {
+ this.hasImage = hasImage;
+ }
+
+ public int getHasVideo() {
+ return hasVideo;
+ }
+
+ public void setHasVideo(int hasVideo) {
+ this.hasVideo = hasVideo;
+ }
+
+ public int getHasFile() {
+ return hasFile;
+ }
+
+ public void setHasFile(int hasFile) {
+ this.hasFile = hasFile;
}
- private int ugc;
- private int egc;
- private int pgc;
+ public String getPageType() {
+ return pageType;
+ }
+
+ public void setPageType(String pageType) {
+ this.pageType = pageType;
+ }
+
+ public String getUserTypeContent() {
+ return userTypeContent;
+ }
+
+ public void setUserTypeContent(String userTypeContent) {
+ this.userTypeContent = userTypeContent;
+ }
+
+ public String getUserType() {
+ return userType;
+ }
+
+ public void setUserType(String userType) {
+ this.userType = userType;
+ }
- public int getUgc() {
- return ugc;
+ public String getForumScore() {
+ return forumScore;
}
- public void setUgc(int ugc) {
- this.ugc = ugc;
+ public void setForumScore(String forumScore) {
+ this.forumScore = forumScore;
}
- public int getEgc() {
- return egc;
+ public String getForwardContent() {
+ return forwardContent;
}
- public void setEgc(int egc) {
- this.egc = egc;
+ public void setForwardContent(String forwardContent) {
+ this.forwardContent = forwardContent;
}
- public int getPgc() {
- return pgc;
+ public int getReadCount() {
+ return readCount;
+ }
+
+ public void setReadCount(int readCount) {
+ this.readCount = readCount;
}
- public void setPgc(int pgc) {
- this.pgc = pgc;
+ public String getAuthornickname() {
+ return authornickname;
+ }
+
+ public void setAuthornickname(String authornickname) {
+ this.authornickname = authornickname;
}
public String getPromotionInfo() {
@@ -687,15 +761,16 @@ public class ESMonitorBaseEntity implements Comparable, Ser
}
public String getSysSentimentTag() {
- if(sysSentiment < 0.5){
- sysSentimentTag = "负面";
- }
- if(sysSentiment == 0.5){
- sysSentimentTag = "中性";
- }
- if(sysSentiment > 0.5){
- sysSentimentTag = "正面";
- }
+ sysSentimentTag = "中性";
+// if(sysSentiment < 0.5){
+// sysSentimentTag = "负面";
+// }
+// if(sysSentiment == 0.5){
+// sysSentimentTag = "中性";
+// }
+// if(sysSentiment > 0.5){
+// sysSentimentTag = "正面";
+// }
return sysSentimentTag;
}
diff --git a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorEntity.java b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorEntity.java
index 86e167b..65c8799 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorEntity.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorEntity.java
@@ -20,8 +20,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
public class ESMonitorEntity extends ESMonitorBaseEntity implements Serializable {
diff --git a/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAnalysisController.java b/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAnalysisController.java
index c44abcc..2557438 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAnalysisController.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAnalysisController.java
@@ -1,10 +1,10 @@
package com.bfd.mf.controller;
import com.alibaba.fastjson.JSONObject;
-import com.bfd.mf.common.web.vo.params.QueryRequest;
-import com.bfd.mf.service.SearchAnalysisService;
import com.bfd.mf.common.util.enums.RTCodeEnum;
import com.bfd.mf.common.web.component.wrapper.ResponseWrapper;
+import com.bfd.mf.common.web.vo.params.QueryRequest;
+import com.bfd.mf.service.SearchAnalysisService;
import com.bfd.nlp.common.util.constants.MediaTypes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -12,7 +12,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
@Controller
diff --git a/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAuthorController.java b/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAuthorController.java
index 6404291..4cdbdb2 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAuthorController.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/controller/SearchAuthorController.java
@@ -38,7 +38,8 @@ public class SearchAuthorController {
try {
JSONObject result;
String scorllId = queryRequest.getScrollId();
- if(null != scorllId){ // 这个是导出要用的
+ // 这个是导出要用的
+ if(null != scorllId){
result = searchDataService.exportDataInSubjectIndex(queryRequest);
return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
}else{ // 这个是查询
diff --git a/cl_search_api/src/main/java/com/bfd/mf/controller/SearchDataController.java b/cl_search_api/src/main/java/com/bfd/mf/controller/SearchDataController.java
index e24de10..90210d1 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/controller/SearchDataController.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/controller/SearchDataController.java
@@ -2,24 +2,31 @@ package com.bfd.mf.controller;
import com.alibaba.fastjson.JSONObject;
import com.bfd.mf.common.util.constants.ESConstant;
-import com.bfd.mf.common.web.vo.params.QueryRequest;
-import com.bfd.mf.service.SearchDataService;
import com.bfd.mf.common.util.enums.RTCodeEnum;
import com.bfd.mf.common.web.component.wrapper.ResponseWrapper;
+import com.bfd.mf.common.web.vo.params.QueryRequest;
+import com.bfd.mf.service.SearchDataService;
import com.bfd.mf.service.UpdateService;
+import com.bfd.nlp.common.util.constants.MediaTypes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-import io.swagger.annotations.ApiOperation;
-import com.bfd.nlp.common.util.constants.MediaTypes;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
+/**
+ * @author dujing
+ */
+
@Controller
@RequestMapping("/crawl")
@Api(value="数据查询的控制器")
@@ -56,9 +63,11 @@ public class SearchDataController {
}
return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
}else {
- if (subjectId.equals("all") || subjectId.contains(",")) {// 全局数据查询
+ // 全局数据查询
+ if (subjectId.equals("all") || subjectId.contains(",")) {
result = searchDataService.queryDataList(queryRequest);
- } else if (subjectId.equals("")) { // 没有专题
+ // 没有专题
+ } else if (subjectId.equals("")) {
result.put(ESConstant.ALLDOCNUMBER, 0L);
result.put(ESConstant.MONITORLISTS, new ArrayList<>());
} else {
@@ -68,11 +77,11 @@ public class SearchDataController {
}
Integer allDocNumber = result.getIntValue(ESConstant.ALLDOCNUMBER);
Integer limit = queryRequest.getLimit();
- Integer page = 1;
- if(allDocNumber%limit==0){
+ int page = 1;
+ if(allDocNumber%limit == 0){
page = allDocNumber/limit;
}else{
- page = allDocNumber/limit +1;
+ page = allDocNumber/limit + 1;
}
if(null != queryRequest.getPage() && !queryRequest.getPage().equals("")) {
if (page > 0 && queryRequest.getPage() > page) {
@@ -83,7 +92,7 @@ public class SearchDataController {
logger.info("接口查询时长:statr:"+ start +" ; end:"+end + " ; time = " + (end - start) + " ; count = "+result.get(ESConstant.ALLDOCNUMBER));
return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
} catch (Exception e) {
- logger.error("[queryData] Failed,The error message is :{}", e);
+ logger.error("[SearchDataController] queryDataList Failed,The error message is :{}", e);
return ResponseWrapper.buildResponse(RTCodeEnum.C_SERVICE_NOT_AVAILABLE, "Query failed");
}
@@ -98,8 +107,7 @@ public class SearchDataController {
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", name = "subjectId", value = "专题ID", required = true, dataType = "String"),
@ApiImplicitParam(paramType="query", name = "docId", value = "主贴唯一ID", required = true, dataType = "String"),
- @ApiImplicitParam(paramType="query", name = "siteId", value = "站点ID", required = true, dataType = "String"),
- })
+ @ApiImplicitParam(paramType="query", name = "siteId", value = "站点ID", required = true, dataType = "String"),})
public JSONObject getInfo(String subjectId,String docId,String siteId) {
QueryRequest queryRequest = new QueryRequest();
queryRequest.setSubjectId(subjectId);
@@ -154,14 +162,23 @@ public class SearchDataController {
}
-
+ /**
+ * 查询 数据的Counts 用户左侧的显示
+ * @param queryRequest
+ * @return
+ */
@ApiOperation(value = "查询数据列表")
@RequestMapping(value = "/subject/queryCounts", method = RequestMethod.POST, consumes = MediaTypes.JSON_UTF_8, produces = MediaTypes.JSON_UTF_8)
@ResponseBody
public JSONObject queryDataCounts(@RequestBody QueryRequest queryRequest) {
logger.info("[queryDataCounts] partial / Params: {}", JSONObject.toJSONString(queryRequest));
try {
- JSONObject result = searchDataService.queryDataCountsInOneIndex(queryRequest);
+ JSONObject result = new JSONObject();
+ if(null != queryRequest.getSubjectId()) {
+ result = searchDataService.queryDataCountsInOneIndex(queryRequest);
+ }else{
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_SERVICE_NOT_AVAILABLE, "Query failed");
+ }
return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
} catch (Exception e) {
logger.error("[queryDataCounts] Failed,The error message is :{}", e);
@@ -192,20 +209,26 @@ public class SearchDataController {
}
+ /**
+ * 示例文件夹的专题复制
+ */
@ApiOperation(value = "复制专题")
@RequestMapping(value = "/reindex/reindexSubject", method = RequestMethod.POST, consumes = MediaTypes.JSON_UTF_8, produces = MediaTypes.JSON_UTF_8)
@ResponseBody
public JSONObject reIndex(@RequestBody QueryRequest queryRequest){
logger.info("[reIndex] partial / Params: {}", JSONObject.toJSONString(queryRequest));
try {
- JSONObject result = searchDataService.reIndexSubject(queryRequest);
- return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
+ searchDataService.reIndexSubject(queryRequest);
} catch (Exception e) {
logger.error("[reIndex] Failed,The error message is :{}", e);
return ResponseWrapper.buildResponse(RTCodeEnum.C_SERVICE_NOT_AVAILABLE, "Query failed");
}
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, new JSONObject());
}
+ /**
+ * 删除专题的接口
+ */
@ApiOperation(value = "删除专题")
@RequestMapping(value = "/delete/deleteBySubjectId", method = RequestMethod.POST, consumes = MediaTypes.JSON_UTF_8, produces = MediaTypes.JSON_UTF_8)
@ResponseBody
@@ -220,4 +243,74 @@ public class SearchDataController {
}
}
+ @ApiOperation(value = "根据 cid 删除指定专题下的数据")
+ @RequestMapping(value = "/delete/deleteByCid", method = RequestMethod.POST, consumes = MediaTypes.JSON_UTF_8, produces = MediaTypes.JSON_UTF_8)
+ @ResponseBody
+ public JSONObject deleteSubjectByCid(@RequestBody QueryRequest queryRequest){
+ logger.info("[deleteSubject] partial / Params: {}", JSONObject.toJSONString(queryRequest));
+ try {
+ JSONObject result = searchDataService.deleteBySubjectIdByCid(queryRequest);
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
+ } catch (Exception e) {
+ logger.error("[deleteSubject] Failed,The error message is :{}", e);
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_SERVICE_NOT_AVAILABLE, "Query failed");
+ }
+ }
+
+ @ApiOperation(value = "根据 crawlDataFlag 删除指定专题下的问题")
+ @RequestMapping(value = "/delete/deleteByCrawlDataFlag", method = RequestMethod.POST, consumes = MediaTypes.JSON_UTF_8, produces = MediaTypes.JSON_UTF_8)
+ @ResponseBody
+ public JSONObject deleteSubjectByCrawlDataFlag(@RequestBody QueryRequest queryRequest){
+ logger.info("[deleteSubject] partial / Params: {}", JSONObject.toJSONString(queryRequest));
+ try {
+ JSONObject result = searchDataService.deleteBySubjectIdByCrawlDataFlag(queryRequest);
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
+ } catch (Exception e) {
+ logger.error("[deleteSubject] Failed,The error message is :{}", e);
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_SERVICE_NOT_AVAILABLE, "Query failed");
+ }
+ }
+
+
+ /**
+ * 获取json 结构数据
+ * @param queryRequest
+ * @return
+ */
+ @ApiOperation(value = "查询数据列表")
+ @RequestMapping(value = "/subject/getJson", method = RequestMethod.POST, consumes = MediaTypes.JSON_UTF_8, produces = MediaTypes.JSON_UTF_8)
+ @ResponseBody
+ public JSONObject queryDataJsonList(@RequestBody QueryRequest queryRequest) {
+ logger.info("[queryDataList] partial / Params: {}", JSONObject.toJSONString(queryRequest));
+ try {
+ JSONObject result = new JSONObject();
+ long start = System.currentTimeMillis();
+ String scorllId = queryRequest.getScrollId();
+
+ // 专题数据导出
+ result = searchDataService.exportJsonDataInSubject(queryRequest);
+
+ Integer allDocNumber = result.getIntValue(ESConstant.ALLDOCNUMBER);
+ Integer limit = queryRequest.getLimit();
+ Integer page = 1;
+ if(allDocNumber%limit==0){
+ page = allDocNumber/limit;
+ }else{
+ page = allDocNumber/limit +1;
+ }
+ if(null != queryRequest.getPage() && !queryRequest.getPage().equals("")) {
+ if (page > 0 && queryRequest.getPage() > page) {
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_SUBJECT_GRAMMAR_ERROR, "总数和分页不匹配");
+ }
+ }
+ long end = System.currentTimeMillis();
+ logger.info("接口查询时长:statr:"+ start +" ; end:"+end + " ; time = " + (end - start) + " ; count = "+result.get(ESConstant.ALLDOCNUMBER));
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_OK, result);
+ } catch (Exception e) {
+ logger.error("[queryData] Failed,The error message is :{}", e);
+ return ResponseWrapper.buildResponse(RTCodeEnum.C_SERVICE_NOT_AVAILABLE, "Query failed");
+ }
+
+ }
+
}
diff --git a/cl_search_api/src/main/java/com/bfd/mf/controller/UploadExcelController.java b/cl_search_api/src/main/java/com/bfd/mf/controller/UploadExcelController.java
index aa5858d..3b3215a 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/controller/UploadExcelController.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/controller/UploadExcelController.java
@@ -12,7 +12,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@@ -37,8 +40,7 @@ public class UploadExcelController {
@ApiOperation(value = "上传Excel", httpMethod = "POST")
@PostMapping(value = "/SubjectsExcel")
@ResponseBody
- public JSONObject insertExcelTask(@RequestParam("file") MultipartFile file,
- @RequestParam("userId") String userId) {
+ public JSONObject insertExcelTask(@RequestParam("file") MultipartFile file, @RequestParam("userId") String userId) {
logger.info("[insertExcelTask] partial / Params: {}", userId);
try {
JSONObject jsonObject = new JSONObject();
diff --git a/cl_search_api/src/main/java/com/bfd/mf/service/SearchAnalysisService.java b/cl_search_api/src/main/java/com/bfd/mf/service/SearchAnalysisService.java
index 005b44c..27d24ce 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/service/SearchAnalysisService.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/service/SearchAnalysisService.java
@@ -95,9 +95,12 @@ public class SearchAnalysisService {
Map valueLabelMap = new HashMap<>();
Map categoryLabelMap = new HashMap<>();
for (ESMonitorEntity esMonitorEntity : esMonitorEntityList) {
- String docType = esMonitorEntity.getDocType(); // 页面类型
- String valueLabel = esMonitorEntity.getValueLabel(); // 价值标签
- String categoryLabel = esMonitorEntity.getCategoryLabel();// 分类标签
+ // 页面类型
+ String docType = esMonitorEntity.getDocType();
+ // 价值标签
+ String valueLabel = esMonitorEntity.getValueLabel();
+ // 分类标签
+ String categoryLabel = esMonitorEntity.getCategoryLabel();
channelMap.put(docType,getDocTypeNum(docType));
valueLabelMap.put(valueLabel,valueLabel);
categoryLabelMap.put(categoryLabel,categoryLabel);
diff --git a/cl_search_api/src/main/java/com/bfd/mf/service/SearchAuthorService.java b/cl_search_api/src/main/java/com/bfd/mf/service/SearchAuthorService.java
index a16d02f..107d181 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/service/SearchAuthorService.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/service/SearchAuthorService.java
@@ -19,7 +19,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.Serializable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
@Service
public class SearchAuthorService extends CrudService implements Serializable {
diff --git a/cl_search_api/src/main/java/com/bfd/mf/service/SearchDataService.java b/cl_search_api/src/main/java/com/bfd/mf/service/SearchDataService.java
index 0f1b943..3e726b6 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/service/SearchDataService.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/service/SearchDataService.java
@@ -24,8 +24,8 @@ import org.elasticsearch.search.sort.SortOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
-import springfox.documentation.spring.web.json.Json;
import java.io.Serializable;
import java.util.*;
@@ -129,7 +129,8 @@ public class SearchDataService extends CrudService siteOtherMap = siteMap.get(enSource);
if (siteOtherMap.containsKey("site_id")) {
siteId = siteMap.get(enSource).get("site_id").toString();
@@ -243,7 +258,11 @@ public class SearchDataService extends CrudService hlKeywords = new ArrayList<>();
@@ -435,28 +459,51 @@ public class SearchDataService extends CrudService currentIndexList = new ArrayList<>();
String subjectId = queryRequest.getSubjectId();
if(null != queryRequest.getSubjectId() && !("").equals(subjectId)){ // 如果是专题,去专题的索引查就行
- cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.mini_cluster_type); // 111
+ cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.special_cluster_type); // 111
subjectId = cluster.getPrefixIndexPattern() +"_"+ subjectId;
currentIndexList.add(subjectId);
}else{ // 如果是全部数据,就直接去 渠道对应的索引查,渠道可以从 docId 中截取出来
@@ -628,10 +685,10 @@ public class SearchDataService extends CrudService currentIndexList = new ArrayList<>();
String subjectId = queryRequest.getSubjectId();
if(!("").equals(subjectId) && null != subjectId){ // 如果是专题,去专题的索引查就行
- cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.mini_cluster_type); // 111
+ cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.special_cluster_type); // 111
subjectId = cluster.getPrefixIndexPattern() +"_"+ subjectId;
}else{ // 如果是全部数据,就直接去 渠道对应的索引查,渠道可以从 docId 中截取出来
logger.info("[SearchDataService] queryOneDataByDocId 查询 全局数据 : {}" , subjectId);
@@ -670,7 +727,7 @@ public class SearchDataService extends CrudService>imagePathSize = (List>) jsonObject.get(ESConstant.IMAGEPATHSIZE);
for (Map imagePath: imagePathSize) {
String url = imagePath.get(ESConstant.URL);
@@ -678,7 +735,7 @@ public class SearchDataService extends CrudService>videoPathSize = (List>) jsonObject.get(ESConstant.VIDEOPATHSIZE);
for (Map videoPath: videoPathSize) {
String url = videoPath.get(ESConstant.URL);
@@ -705,9 +762,13 @@ public class SearchDataService extends CrudService smallImgs = (List) jsonObject.get(ESConstant.SMALLIMGS);
- List> imagePathSize = new ArrayList<>();
- if(null != smallImgs && smallImgs.size() > 0) { // 由于电商的图片不做下载,因此输出到页面的时候写死了大小和分辨率
- for (Object img : smallImgs) {
- if (!img.toString().contains("http")) {
- Map imagePathMap = new HashMap<>();
- String url = "http:" + img ;
- imagePathMap.put(ESConstant.URL ,url);
- imagePathMap.put(ESConstant.SIZE ,"4KB");
- imagePathMap.put(ESConstant.VIDEOTIME ,"");
- imagePathMap.put(ESConstant.RESOLUTION ,"50×50");
- imagePathSize.add(imagePathMap);
- }
- }
- }
- jsonObject.put(ESConstant.IMAGEPATHSIZE,imagePathSize);
- }
}
return jsonObject;
}
@@ -798,12 +841,15 @@ public class SearchDataService extends CrudService0) {
Map result = searchDataResponse.getHits().getHits()[0].getSourceAsMap();
- if (result.size() > 0) {
- result.entrySet().stream()
- .forEach(entry -> {
- if (entry.getKey().equals(ESConstant.FILEPATH) && entry.getValue().equals("")) {
- jsonObject.put(entry.getKey(), new ArrayList<>());
- } else if (entry.getKey().equals(ESConstant.FILEPATHSIZE) ||
- entry.getKey().equals(ESConstant.IMAGEPATHSIZE) ||
- entry.getKey().equals(ESConstant.VIDEOPATHSIZE)) {
- if(entry.getValue().toString() .contains(ESConstant.URL)) {
- jsonObject.put(entry.getKey(), JSONObject.parseArray(entry.getValue().toString()));
- }else{
- jsonObject.put(entry.getKey(),new ArrayList<>());
- }
- } else if(entry.getKey().equals(ESConstant.ATTITUDES_COUNT)){
- if(entry.getValue().toString().contains(ESConstant.TOTALCOUNT)){
- JSONObject totalCount = JSONObject.parseObject(entry.getValue().toString());
- jsonObject.put(entry.getKey(),totalCount.get(ESConstant.TOTALCOUNT));
- }
- } else {
+ if (result.size() > 0) { result.entrySet().stream()
+ .forEach(entry -> {
+ if (entry.getKey().equals(ESConstant.FILEPATH) && entry.getValue().equals("")) {
+ jsonObject.put(entry.getKey(), new ArrayList<>());
+ } else if (entry.getKey().equals(ESConstant.FILEPATHSIZE)
+ || entry.getKey().equals(ESConstant.IMAGEPATHSIZE)
+ || entry.getKey().equals(ESConstant.VIDEOPATHSIZE)) {
+ if(entry.getValue().toString() .contains(ESConstant.URL)) {
jsonObject.put(entry.getKey(), entry.getValue());
+ }else{
+ jsonObject.put(entry.getKey(),new ArrayList<>());
}
- });
+ } else if(entry.getKey().equals(ESConstant.ATTITUDES_COUNT)){
+ if(entry.getValue().toString().contains(ESConstant.TOTALCOUNT)){
+ JSONObject totalCount = JSONObject.parseObject(entry.getValue().toString());
+ jsonObject.put(entry.getKey(),totalCount.get(ESConstant.TOTALCOUNT));
+ }else{
+ jsonObject.put(entry.getKey(),entry.getValue());
+ }
+ } else {
+ jsonObject.put(entry.getKey(), entry.getValue());
+ }
+ });
}
}
return jsonObject;
@@ -865,7 +912,7 @@ public class SearchDataService extends CrudService currentIndexList = new ArrayList<>();
// 获取ES的参数及要查询的索引列表
String subjectId = queryRequest.getSubjectId();
- cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.mini_cluster_type); // 111
+ cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.special_cluster_type); // 111 special_cluster_type
currentIndexList = subjectQueryDataService.getIndexBySubjectIds(cluster,subjectId);
Long clusterId = cluster.getId();
logger.info("[SearchDataService] queryDataList clusterId : {}; currentIndexList : {}" ,clusterId, currentIndexList.toString());
@@ -947,7 +994,7 @@ public class SearchDataService extends CrudService currentIndexList = subjectQueryDataService.getIndexBySubjectIds(cluster, queryRequest.getSubjectId());
Long clusterId = cluster.getId();
logger.info("[SearchDataService] queryDataInOneIndex: clusterId :{} ; currentIndexList : {}", clusterId,currentIndexList.toString());
@@ -977,8 +1024,8 @@ public class SearchDataService extends CrudService currentIndexList = subjectQueryDataService.getIndexBySubjectIds(cluster, queryRequest.getSubjectId());
Long clusterId = cluster.getId();
String [] indexName = currentIndexList.toArray(new String[currentIndexList.size()]);
@@ -996,6 +1043,22 @@ public class SearchDataService extends CrudService currentIndexList = subjectQueryDataService.getIndexBySubjectIds(cluster, queryRequest.getSubjectId());
+ Long clusterId = cluster.getId();
+ String [] indexName = currentIndexList.toArray(new String[currentIndexList.size()]);
+ logger.info("[SearchDataService] exportDataInSubjectIndex : IndexName :{} ; clusterId :{} ; currentIndexList :{}",indexName[0], clusterId , currentIndexList.toString());
+ jsonObject= esQueryServiceForSQMini.exportDataFromOneSubject(indexName, queryRequest);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return jsonObject;
+ }
+
public JSONObject exportDataInDateIndex(QueryRequest queryRequest) {
JSONObject jsonObject = new JSONObject();
try {
@@ -1007,7 +1070,7 @@ public class SearchDataService extends CrudService currentIndexList = subjectQueryDataService.getIndexBySubjectIds(cluster, queryRequest.getSubjectId());
Long clusterId = cluster.getId();
logger.info("[SearchDataService] queryDataCountsInOneIndex: clusterId : {}; currentIndexList : {}" , clusterId ,currentIndexList.toString());
@@ -1056,10 +1119,17 @@ public class SearchDataService extends CrudService keyWordsMaps = new HashMap<>();
- Map placesWordsMaps = new HashMap<>(); // 地点
- Map emojiWordsMaps = new HashMap<>(); // 表情
- Map hashTagWordsMaps = new HashMap<>(); // 话题
- Map opinionsWordsMaps = new HashMap<>(); // 评价
+ // 地点
+ Map placesWordsMaps = new HashMap<>();
+ // 表情
+ Map emojiWordsMaps = new HashMap<>();
+ // 话题
+ Map hashTagWordsMaps = new HashMap<>();
+ // 评价
+ Map opinionsWordsMaps = new HashMap<>();
// List hlKeywordsList = new ArrayList<>();
for (ESMonitorEntity esMonitorEntity : esMonitorEntityList) {
List hlKeyWords = esMonitorEntity.getHlKeyWords();
@@ -63,10 +67,12 @@ public class SearchKeywordsCouldService{
CollectionUtils.sortByValueForListSubTopSize(placesWordsMaps, topSize * 2, placesWordsResultMap);
//sortByValueForListSubTopSize
Long keyWordsStart = System.currentTimeMillis();
- jsonObject.put(ConditionCommon.WORD_CLOUD, CollectionUtils.sortByValueForList(textService.post(keyWordsResultMap, 1), topSize));
+ //jsonObject.put(ConditionCommon.WORD_CLOUD, CollectionUtils.sortByValueForList(textService.post(keyWordsResultMap, 1), topSize));
+ jsonObject.put(ConditionCommon.WORD_CLOUD,CollectionUtils.sortByValueForList(keyWordsResultMap, topSize));
logger.info("[keysWords Execute Time one] the time used is {} ms", System.currentTimeMillis() - keyWordsStart);
Long placesWordsStart = System.currentTimeMillis();
- jsonObject.put(ConditionCommon.PLACE_CLOUD, CollectionUtils.sortByValueForList(textService.post(placesWordsResultMap, 2), topSize));
+ // jsonObject.put(ConditionCommon.PLACE_CLOUD, CollectionUtils.sortByValueForList(textService.post(placesWordsResultMap, 2), topSize));
+ jsonObject.put(ConditionCommon.PLACE_CLOUD, CollectionUtils.sortByValueForList(placesWordsResultMap, topSize));
logger.info("[placeWords Exceute Time two] the time used is {} ms", System.currentTimeMillis() - placesWordsStart);
jsonObject.put(ConditionCommon.HASH_TAG_CLOUD, CollectionUtils.sortByValueForList(hashTagWordsMaps, topSize));
jsonObject.put(ConditionCommon.EMOJI_CLOUD, CollectionUtils.sortByValueForList(emojiWordsMaps, topSize));
diff --git a/cl_search_api/src/main/java/com/bfd/mf/service/UpdateService.java b/cl_search_api/src/main/java/com/bfd/mf/service/UpdateService.java
index e540e23..ade1025 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/service/UpdateService.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/service/UpdateService.java
@@ -40,7 +40,8 @@ public class UpdateService extends CrudService currentIndexList = new ArrayList<>();
- if(!("").equals(subjectId) && null != subjectId){ // 如果是专题,去专题的索引查就行
- cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.mini_cluster_type); // 111
+ // 如果是专题,去专题的索引查就行
+ if(!("").equals(subjectId) && null != subjectId){
+ cluster = clusterService.findClusterByType(Cluster.CLUSTER_TYPE.mini_cluster_type);
subjectId = cluster.getPrefixIndexPattern() +"_"+ subjectId;
}
currentIndexList.add(subjectId);
diff --git a/cl_search_api/src/main/java/com/bfd/mf/service/UploadExcelService.java b/cl_search_api/src/main/java/com/bfd/mf/service/UploadExcelService.java
index ccf8fb0..7a9c927 100644
--- a/cl_search_api/src/main/java/com/bfd/mf/service/UploadExcelService.java
+++ b/cl_search_api/src/main/java/com/bfd/mf/service/UploadExcelService.java
@@ -6,7 +6,6 @@ import com.bfd.mf.common.util.es.EsUtils2;
import com.bfd.mf.common.web.entity.mysql.topic.ParseExcelTask;
import com.bfd.mf.common.web.repository.mysql.topic.ParseExcelTaskRepository;
import com.bfd.mf.config.BFDApiConfig;
-import org.assertj.core.util.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -14,10 +13,16 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
diff --git a/cl_stream_3.1.2.iml b/cl_stream_3.1.2.iml
deleted file mode 100644
index f409c0e..0000000
--- a/cl_stream_3.1.2.iml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 441f0de..adbf1d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,8 +5,8 @@
4.0.0
com.bfd.mf
- cl_stream_3.1.2
- 3.1.2-SNAPSHOT
+ cl_stream_3.2
+ 3.2-SNAPSHOT
pom