
@@ -236,7 +236,7 @@ import { demoData } from '@/assets/demo2.js'
import HeaderInfo from "@/components/UseAll/headerInfo.vue";
import leftInfo from "@/components/UseAll/leftInfo.vue";
import { getAllTitle, getDocInfo } from "@/api/api/doc";
-import {getDomainGraphTest, getpoinAll} from "@/api/api/graph";
+import {getDomainGraphTest, getpoinAll, getpoinByName} from "@/api/api/graph";
import { Picture } from "@element-plus/icons-vue";
import { selectAticleByRelation } from '@/api/api/article'
@@ -249,21 +249,22 @@ export default {
},
data() {
return {
+ getpoinName :"模糊综合评价方法",
testoptions: {
layout: {
layoutName: 'force',
- animate: false, // ✅ 必须关!否则每一帧都在计算
- maxIterations: 50, // ✅ 降低到 50~80,快速出结果
- refresh: 50, // ⚠️ 每50帧更新一次(减少重绘)
+ animate: false, // 必须关闭动画
+ maxIterations: 50, // 仍控制在合理范围
fit: true,
- padding: 20,
- // --- 物理参数调优 ---
- gravity: -1, // 🔽 非常低的引力,防止聚集
- idealEdgeLength: 60, // 🔗 缩短边长,减少空间
- stiffness: 100, // 🔽 弹簧刚度降低,减少“拉扯感”
- damping: 0.7, // ✅ 阻尼加大,抑制震荡(关键!)
- distanceMin: 10,
- distanceMax: 300
+ padding: 80, // 增加画布边距,防止节点贴边
+ // --- 核心:放大两倍间距 ---
+ idealEdgeLength: 200, // 🔥 从 100 → 200(直接翻倍)
+ nodeRepulsion: 150000, // 🔥 大幅提升斥力,防止压缩
+ gravity: 0.05, // 🔽 极低引力,避免向中心聚集
+ stiffness: 200, // 保持边“硬”,防止拉伸变形
+ damping: 0.85, // 高阻尼抑制震荡
+ distanceMin: 30,
+ distanceMax: 600 // 允许更大空间
}
},
direction: "rtl",
@@ -592,15 +593,6 @@ export default {
this.graphData = { nodes, links };
- // 确保图表更新
- // this.$nextTick(() => {
- // if (this.$refs.graphRef) {
- // this.$refs.graphRef.setOptions(this.graphOptions);
- // console.log(this.graphData)
- // this.$refs.graphRef.setJsonData(this.graphData);
- // this.$refs.graphRef.refresh();
- // }
- // });
},
onNodeClick(nodeObject, $event) {
console.log(nodeObject)
@@ -621,6 +613,19 @@ export default {
})
});
},
+ getColor(type){
+ let res = "rgb(227,203,0)"
+ if (type=="author"){
+ res = "rgb(255,203,0)"
+ }
+ if (type=="agency"){
+ res = "rgb(0,255,0)"
+ }
+ if (type=="keyword"){
+ res = "rgb(0,0,255)"
+ }
+ return res
+ },
},
created() {
var that = this;
@@ -652,43 +657,74 @@ export default {
that.attrbutes = node.properties.attributes || []; //节点属性列表
// that.showTipLayer(event);
};
+
},
mounted() {
//初始化加载绘图
// this.getInfo();
// this.getAll();
// this.drawGraphData()
- getpoinAll().then((res) => {
+
+ getpoinByName(this.getpoinName).then((res) => {
+ let nodes = []
+ let links = []
+ for (let i = 0;i
{
+ // for (let i = 0;i0.9.1
8.6.2
3.9.1
+
+ 7.3.0
@@ -347,6 +349,55 @@
+
+
+
+
+ org.elasticsearch
+ elasticsearch
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-high-level-client
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client-sniffer
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.plugin
+ mapper-extras-client
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.plugin
+ parent-join-client
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.plugin
+ aggs-matrix-stats-client
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.plugin
+ rank-eval-client
+ ${elasticsearch.version}
+
+
+ org.elasticsearch.plugin
+ lang-mustache-client
+ ${elasticsearch.version}
+
+
diff --git a/ruoyi-api/pom.xml b/ruoyi-api/pom.xml
index d67e5f4..9a210d4 100644
--- a/ruoyi-api/pom.xml
+++ b/ruoyi-api/pom.xml
@@ -275,6 +275,26 @@
commons-csv
1.10.0
+
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ 7.3.0
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-high-level-client
+ 7.3.0
+
+
+ org.elasticsearch
+ elasticsearch
+ 7.3.0
+
+
diff --git a/ruoyi-api/src/main/java/com/ruoyi/api/ElasticsearchUtils/ElasticSearchUtil.java b/ruoyi-api/src/main/java/com/ruoyi/api/ElasticsearchUtils/ElasticSearchUtil.java
new file mode 100644
index 0000000..dab2427
--- /dev/null
+++ b/ruoyi-api/src/main/java/com/ruoyi/api/ElasticsearchUtils/ElasticSearchUtil.java
@@ -0,0 +1,331 @@
+package com.ruoyi.api.ElasticsearchUtils;
+
+import com.ruoyi.api.ElasticsearchUtils.builders.Mappings;
+import org.elasticsearch.cluster.metadata.MappingMetaData;
+import org.elasticsearch.search.SearchHits;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * ---------------------------------------------------------------------------------------------------------------
+ * Project_Name:wokaFrame
+ * Description:TODO(这里用一句话描述这个类的作用)
+ * Author:wanghouzhi
+ * Copyright:2024 www.xxx.com Inc. All rights reserved.
+ * 注意:本内容仅限xxxx公司内部传阅,禁止外泄及用于其他的商业目的。
+ * ---------------------------------------------------------------------------------------------------------------
+ */
+
+@Component
+public interface ElasticSearchUtil {
+
+ /**
+ * 新建单个索引(Mappings默认值,不进行任何设置)
+ * @param index
+ * @return
+ * @throws IOException
+ */
+ boolean createIndex(String index) throws IOException;
+
+ /**
+ * 创建单个索引(手动设置Mappings)
+ * @param index
+ * @param mappings
+ * @return
+ * @throws IOException
+ */
+ boolean createIndex(String index, Mappings mappings) throws IOException;
+
+
+ /**
+ * 查看某个索引的Mappings信息
+ * @param index
+ * @return
+ * @throws IOException
+ */
+ Map queryMappings(String index) throws IOException;
+
+ /**
+ * 判断某个索引是否存在
+ * @param index
+ * @return
+ * @throws IOException
+ */
+ boolean indexExists(String index) throws IOException;
+
+ /**
+ * 删除某个索引
+ * @param index
+ * @return
+ * @throws IOException
+ */
+ boolean deleteIndex(String index) throws IOException;
+
+ /**
+ * 向某个索引写入某个文档内容(Map)
+ * @param index
+ * @param docMap
+ * @return
+ * @throws IOException
+ */
+ boolean addDoc(String index, Map docMap) throws IOException;
+
+ /**
+ * 向某个索引写入某个文档内容(Map 手动设置文档id)
+ * @param index
+ * @param docMap
+ * @param id(手动设置文档id)
+ * @return
+ * @throws IOException
+ */
+ boolean addDoc(String index, Map docMap, String id) throws IOException;
+
+ /**
+ * 向某个索引写入某个对象
+ * @param index
+ * @param object
+ * @param
+ * @return
+ * @throws IOException
+ */
+ boolean addDoc(String index, T object) throws IOException;
+
+ /**
+ * 向某个索引写入某个对象(手动设置文档id)
+ * @param index
+ * @param object
+ * @param id(手动设置文档id)
+ * @param
+ * @return
+ * @throws IOException
+ */
+ boolean addDoc(String index, T object, String id) throws IOException;
+
+ /**
+ * 修改某个索引的某个id的文档内容
+ * @param index
+ * @param docMap
+ * @param id
+ * @return
+ * @throws IOException
+ */
+ boolean updateDoc(String index, Map docMap, String id) throws IOException;
+
+ /**
+ * 删除某个索引的某个id的文档内容
+ * @param index
+ * @param id
+ * @return
+ * @throws IOException
+ */
+ boolean deleteDoc(String index, String id) throws IOException;
+
+ /**
+ * 查询某个索引的某个id的文档内容
+ * @param index
+ * @param id
+ * @return
+ * @throws IOException
+ */
+ String getDoc(String index, String id) throws IOException;
+
+ /**
+ * 向某个索引批量新增文档(Map)
+ * @param index
+ * @param docMap
+ * @return
+ * @throws IOException
+ */
+ boolean addDocBatch(String index, Map docMap) throws IOException;
+
+ /**
+ * 向某个索引批量新增文档(Map 指定初始id)
+ * @param index
+ * @param docMap
+ * @param id(指定初始id)
+ * @return
+ * @throws IOException
+ */
+ boolean addDocBatch(String index, Map docMap, String id) throws IOException;
+
+ /**
+ * 向某个索引批量新增文档(List objectList 对象id(主键)作为文档id)
+ * @param index
+ * @param objectList
+ * @param clazz
+ * @param fieldName
+ * @param
+ * @return
+ * @throws Throwable
+ */
+ boolean addDocBatch(String index, List objectList, Class clazz, String fieldName) throws Throwable;
+
+ /**
+ * 向某个索引批量新增文档(List objectList 文档id自动补全)
+ * @param index
+ * @param objectList
+ * @param
+ * @return
+ * @throws IOException
+ */
+ boolean addDocBatch(String index, List objectList) throws IOException;
+
+ /**
+ * 批量删除某个索引的某些id文档内容
+ * @param index
+ * @param ids
+ * @return
+ * @throws IOException
+ */
+ boolean deleteDocBatch(String index, String[] ids) throws IOException;
+
+ /**
+ * 查询某个索引的全部文档内容(全量查询)
+ * @param index
+ * @param pageNum
+ * @param pageSize
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDoc(String index, int pageNum, int pageSize) throws IOException;
+
+ /**
+ * 查询某个索引的文档 单条件精确查询
+ * @param index
+ * @param fieldName
+ * @param fieldValue
+ * @return
+ * @throws IOException
+ */
+ SearchHits accurateQueryDoc(String index, String fieldName, Object fieldValue) throws IOException;
+
+ /**
+ * 范查询某个索引的某个文档字段,按照精度排序
+ * @param index
+ * @param fieldName
+ * @param fieldValue
+ * @param pageNum
+ * @param pageSize
+ * @return
+ * @throws IOException
+ */
+ SearchHits fuzzyQueryDoc(String index,
+ String fieldName,
+ Object fieldValue,
+ int pageNum,
+ int pageSize) throws IOException;
+
+ /**
+ * 查询某个索引的文档内容,根据某字段排序(小于等于0升序 大于0降序)
+ * @param index
+ * @param fieldName
+ * @param orderRule(小于等于0升序 大于0降序)
+ * @param pageNum
+ * @param pageSize
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDocOrderByField(String index,
+ String fieldName,
+ int orderRule,
+ int pageNum,
+ int pageSize) throws IOException;
+
+ /**
+ * 查询某个索引的时间字段为最近N年的文档内容
+ * @param index
+ * @param fieldName
+ * @param year
+ * @param pageNum
+ * @param pageSize
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDocRecentTime(String index,
+ String fieldName,
+ int year,
+ int pageNum,
+ int pageSize) throws IOException;
+
+ /**
+ * 查询某个索引的搜索热度排名前N的文档内容(根据精确搜索次数进行排名)
+ * @param index
+ * @param topNum
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDocByHeatRanking(String index, int topNum) throws IOException;
+
+ /**
+ * 查询某个索引的文档内容,按照某字段进行查询,结果根据搜索热度排序
+ * @param index
+ * @param fieldName
+ * @param fieldValue
+ * @param orderRule
+ * @param pageNum
+ * @param pageSize
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDocHeatByField(String index,
+ String fieldName,
+ Object fieldValue,
+ int orderRule,
+ int pageNum,
+ int pageSize) throws IOException;
+
+ /**
+ * 查询某个索引的文档内容,所有字段必须全部符合条件(所有条件为AND关系)
+ * @param index
+ * @param fieldsMap
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDocByMustField(String index, Map fieldsMap) throws IOException;
+
+ /**
+ * 查询某个索引的文档内容,所有字段不必全部符合条件(所有条件为OR关系)
+ * @param index
+ * @param fieldName
+ * @param objectList
+ * @return
+ * @throws IOException
+ */
+ SearchHits queryDocByShouldField(String index, String fieldName, List