feat: 兼容性属性添加

This commit is contained in:
jaime 2025-02-28 17:06:56 +08:00
parent 5a3ffe66ec
commit 922d121e1e
5 changed files with 16 additions and 10 deletions

View File

@ -19,6 +19,10 @@ public class EasyEsProperties {
* 是否开启easy-es LOGO BANNER的打印
*/
private boolean banner = true;
/**
* 是否开启兼容性(超低版本的es, 比如7.0.0开启该特性)
*/
private boolean compatible = false;
/**
* es client address es客户端地址
*/

View File

@ -112,8 +112,10 @@ public class EsClientUtils {
throw ExceptionUtils.eee(e);
}
}
//
buildCompatible(httpClientBuilder);
// 兼容性配置
if (easyEsConfigProperties.isCompatible()) {
buildCompatible(httpClientBuilder);
}
return httpClientBuilder;
});

View File

@ -155,6 +155,6 @@ public class Document extends BaseJoin {
/**
* 稠密向量类型dims 非负 最大为2048
*/
@IndexField(fieldType = FieldType.DENSE_VECTOR)
@IndexField(fieldType = FieldType.DENSE_VECTOR, dims = 3)
private double[] vector;
}

View File

@ -187,7 +187,7 @@ public class AllTest {
@Order(8)
public void testSQL() {
// 注意 sql中的from后面跟的是要被查询的索引名,也可以是索引别名(效果一样) 由于索引名可能会变,所以此处我采用别名ee_default_alias进行查询
String sql = "select count(*) from ee_default_alias where star_num > 0";
String sql = "select count(*) from ee_default_alias where starNum > 0";
String jsonResult = documentMapper.executeSQL(sql);
System.out.println(jsonResult);
Assertions.assertNotNull(jsonResult);

View File

@ -1,9 +1,9 @@
easy-es:
# enable: true
address: 127.0.0.1:9200
# schema: http
# username: elastic
# password: mg123456
schema: https
username: elastic
password: a2*HFkQU93mBnxOTaEAs
keep-alive-millis: 18000
global-config:
i-kun-mode: false
@ -26,6 +26,6 @@ easy-es:
#username: '若无可去掉此行'
#password: '若无可去掉此行'
#logging:
# level:
# tracer: trace
logging:
level:
tracer: trace