diff --git a/easy-es-boot-starter/pom.xml b/easy-es-boot-starter/pom.xml index 2cd86f33..36dca4bf 100644 --- a/easy-es-boot-starter/pom.xml +++ b/easy-es-boot-starter/pom.xml @@ -5,11 +5,7 @@ easy-es-parent io.github.xpc1024 -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 ../easy-es-parent 4.0.0 @@ -25,11 +21,7 @@ io.github.xpc1024 easy-es-core -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 org.springframework.boot diff --git a/easy-es-core/pom.xml b/easy-es-core/pom.xml index 4a37ed5a..07e4a66e 100644 --- a/easy-es-core/pom.xml +++ b/easy-es-core/pom.xml @@ -7,21 +7,13 @@ io.github.xpc1024 easy-es-parent -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 ../easy-es-parent io.github.xpc1024 easy-es-core -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 8 diff --git a/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/WrapperProcessor.java b/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/WrapperProcessor.java index 3fa3d253..d4070943 100644 --- a/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/WrapperProcessor.java +++ b/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/WrapperProcessor.java @@ -8,10 +8,7 @@ import com.xpc.easyes.core.params.GeoParam; import com.xpc.easyes.core.toolkit.ArrayUtils; import com.xpc.easyes.core.toolkit.CollectionUtils; import com.xpc.easyes.core.toolkit.EsQueryTypeUtil; -<<<<<<< HEAD import com.xpc.easyes.core.toolkit.MyOptional; -======= ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 import lombok.SneakyThrows; import org.elasticsearch.index.query.*; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -164,11 +161,7 @@ public class WrapperProcessor { // 设置查询起止参数 Optional.ofNullable(wrapper.from).ifPresent(searchSourceBuilder::from); -<<<<<<< HEAD MyOptional.ofNullable(wrapper.size).ifPresent(searchSourceBuilder::size, DEFAULT_SIZE); -======= - Optional.ofNullable(wrapper.size).map(searchSourceBuilder::size).orElse(searchSourceBuilder.size(DEFAULT_SIZE)); ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 // 设置聚合参数 if (!CollectionUtils.isEmpty(wrapper.aggregationParamList)) { diff --git a/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/interfaces/Geo.java b/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/interfaces/Geo.java index 1f7c2560..763f0f53 100644 --- a/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/interfaces/Geo.java +++ b/easy-es-core/src/main/java/com/xpc/easyes/core/conditions/interfaces/Geo.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package com.xpc.easyes.core.conditions.interfaces; import com.xpc.easyes.core.toolkit.CollectionUtils; @@ -252,258 +251,3 @@ public interface Geo extends Serializable { Children geoShape(boolean condition, R column, Geometry geometry, ShapeRelation shapeRelation, Float boost); } -======= -package com.xpc.easyes.core.conditions.interfaces; - -import com.xpc.easyes.core.toolkit.CollectionUtils; -import com.xpc.easyes.core.toolkit.ExceptionUtils; -import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.geometry.Geometry; - -import java.io.Serializable; -import java.util.List; -import java.util.stream.Collectors; - -import static com.xpc.easyes.core.constants.BaseEsConstants.DEFAULT_BOOST; - -/** - * 地理位置 - *

- * Copyright © 2021 xpc1024 All Rights Reserved - **/ -public interface Geo extends Serializable { - default Children geoBoundingBox(R column, GeoPoint topLeft, GeoPoint bottomRight) { - return geoBoundingBox(true, column, topLeft, bottomRight, DEFAULT_BOOST); - } - - default Children geoBoundingBox(boolean condition, R column, GeoPoint topLeft, GeoPoint bottomRight) { - return geoBoundingBox(condition, column, topLeft, bottomRight, DEFAULT_BOOST); - } - - default Children geoBoundingBox(R column, GeoPoint topLeft, GeoPoint bottomRight, Float boost) { - return geoBoundingBox(true, column, topLeft, bottomRight, boost); - } - - default Children geoBoundingBox(R column, String topLeft, String bottomRight) { - GeoPoint topLeftGeoPoint = new GeoPoint(topLeft); - GeoPoint bottomRightGeoPoint = new GeoPoint(bottomRight); - return geoBoundingBox(true, column, topLeftGeoPoint, bottomRightGeoPoint, DEFAULT_BOOST); - } - - default Children geoBoundingBox(boolean condition, R column, String topLeft, String bottomRight) { - GeoPoint topLeftGeoPoint = new GeoPoint(topLeft); - GeoPoint bottomRightGeoPoint = new GeoPoint(bottomRight); - return geoBoundingBox(condition, column, topLeftGeoPoint, bottomRightGeoPoint, DEFAULT_BOOST); - } - - default Children geoBoundingBox(R column, String topLeft, String bottomRight, Float boost) { - GeoPoint topLeftGeoPoint = new GeoPoint(topLeft); - GeoPoint bottomRightGeoPoint = new GeoPoint(bottomRight); - return geoBoundingBox(true, column, topLeftGeoPoint, bottomRightGeoPoint, boost); - } - - /** - * 矩形内范围查询 - * - * @param condition 条件 - * @param column 列 - * @param topLeft 左上点坐标 GeoPoint/字符串/哈希/wkt均支持 - * @param bottomRight 右下点坐标 GeoPoint/字符串/哈希/wkt均支持 - * @param boost 权重值 - * @return 泛型 - */ - Children geoBoundingBox(boolean condition, R column, GeoPoint topLeft, GeoPoint bottomRight, Float boost); - - default Children geoDistance(R column, Double distance, GeoPoint centralGeoPoint) { - return geoDistance(true, column, distance, DistanceUnit.KILOMETERS, centralGeoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(R column, Double distance, DistanceUnit distanceUnit, GeoPoint centralGeoPoint) { - return geoDistance(true, column, distance, distanceUnit, centralGeoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(R column, Double distance, DistanceUnit distanceUnit, GeoPoint centralGeoPoint, Float boost) { - return geoDistance(true, column, distance, distanceUnit, centralGeoPoint, boost); - } - - default Children geoDistance(R column, Double distance, DistanceUnit distanceUnit, String centralGeoPoint) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(true, column, distance, distanceUnit, geoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(boolean condition, R column, Double distance, DistanceUnit distanceUnit, String centralGeoPoint) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(condition, column, distance, distanceUnit, geoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(R column, Double distance, DistanceUnit distanceUnit, String centralGeoPoint, Float boost) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(true, column, distance, distanceUnit, geoPoint, boost); - } - - default Children geoDistance(boolean condition, R column, Double distance, DistanceUnit distanceUnit, String centralGeoPoint, Float boost) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(condition, column, distance, distanceUnit, geoPoint, boost); - } - - /** - * 距离范围查询 以给定圆心和半径范围查询 距离类型为双精度 - * - * @param condition 条件 - * @param column 列 - * @param distance 距离 - * @param distanceUnit 距离单位 - * @param centralGeoPoint 中心点 GeoPoint/字符串/哈希/wkt均支持 - * @param boost 权重值 - * @return 泛型 - */ - Children geoDistance(boolean condition, R column, Double distance, DistanceUnit distanceUnit, GeoPoint centralGeoPoint, Float boost); - - - default Children geoDistance(R column, String distance, GeoPoint centralGeoPoint) { - return geoDistance(true, column, distance, centralGeoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(boolean condition, R column, String distance, GeoPoint centralGeoPoint) { - return geoDistance(condition, column, distance, centralGeoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(R column, String distance, GeoPoint centralGeoPoint, Float boost) { - return geoDistance(true, column, distance, centralGeoPoint, boost); - } - - default Children geoDistance(R column, String distance, String centralGeoPoint) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(true, column, distance, geoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(boolean condition, R column, String distance, String centralGeoPoint) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(condition, column, distance, geoPoint, DEFAULT_BOOST); - } - - default Children geoDistance(R column, String distance, String centralGeoPoint, Float boost) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(true, column, distance, geoPoint, boost); - } - - default Children geoDistance(boolean condition, R column, String distance, String centralGeoPoint, Float boost) { - GeoPoint geoPoint = new GeoPoint(centralGeoPoint); - return geoDistance(condition, column, distance, geoPoint, boost); - } - - /** - * 距离范围查询 以给定圆心和半径范围查询 距离类型为字符串 - * - * @param condition 条件 - * @param column 列 - * @param distance 距离 - * @param centralGeoPoint 中心点 GeoPoint/字符串/哈希/wkt均支持 - * @param boost 权重 - * @return 泛型 - */ - Children geoDistance(boolean condition, R column, String distance, GeoPoint centralGeoPoint, Float boost); - - default Children geoPolygon(R column, List geoPoints) { - return geoPolygon(true, column, geoPoints, DEFAULT_BOOST); - } - - default Children geoPolygon(boolean condition, R column, List geoPoints) { - return geoPolygon(condition, column, geoPoints, DEFAULT_BOOST); - } - - default Children geoPolygon(R column, List geoPoints, Float boost) { - return geoPolygon(true, column, geoPoints, boost); - } - - default Children geoPolygonStr(R column, List strPoints) { - if (CollectionUtils.isEmpty(strPoints)) { - throw ExceptionUtils.eee("polygon point list must not be empty"); - } - List geoPoints = strPoints.stream().map(GeoPoint::new).collect(Collectors.toList()); - return geoPolygon(true, column, geoPoints, DEFAULT_BOOST); - } - - default Children geoPolygonStr(boolean condition, R column, List strPoints) { - if (CollectionUtils.isEmpty(strPoints)) { - throw ExceptionUtils.eee("polygon point list must not be empty"); - } - List geoPoints = strPoints.stream().map(GeoPoint::new).collect(Collectors.toList()); - return geoPolygon(condition, column, geoPoints, DEFAULT_BOOST); - } - - default Children geoPolygonStr(R column, List strPoints, Float boost) { - if (CollectionUtils.isEmpty(strPoints)) { - throw ExceptionUtils.eee("polygon point list must not be empty"); - } - List geoPoints = strPoints.stream().map(GeoPoint::new).collect(Collectors.toList()); - return geoPolygon(true, column, geoPoints, boost); - } - - - /** - * 不规则多边形范围查询 - * - * @param condition 条件 - * @param column 列 - * @param geoPoints 多边形顶点列表 GeoPoint/字符串/哈希/wkt均支持 - * @param boost 权重值 - * @return 泛型 - */ - Children geoPolygon(boolean condition, R column, List geoPoints, Float boost); - - default Children geoShape(R column, String indexedShapeId) { - return geoShape(true, column, indexedShapeId, DEFAULT_BOOST); - } - - default Children geoShape(R column, String indexedShapeId, Float boost) { - return geoShape(true, column, indexedShapeId, boost); - } - - default Children geoShape(boolean condition, R column, String indexedShapeId) { - return geoShape(condition, column, indexedShapeId, DEFAULT_BOOST); - } - - /** - * 图形GeoShape查询 已知被索引的图形id - * - * @param condition 条件 - * @param column 列 - * @param indexedShapeId 已被索引的图形id - * @param boost 权重值 - * @return 泛型 - */ - Children geoShape(boolean condition, R column, String indexedShapeId, Float boost); - - default Children geoShape(R column, Geometry geometry) { - return geoShape(true, column, geometry, ShapeRelation.WITHIN, DEFAULT_BOOST); - } - - default Children geoShape(R column, Geometry geometry, ShapeRelation shapeRelation) { - return geoShape(true, column, geometry, shapeRelation, DEFAULT_BOOST); - } - - default Children geoShape(boolean condition, R column, Geometry geometry, ShapeRelation shapeRelation) { - return geoShape(condition, column, geometry, shapeRelation, DEFAULT_BOOST); - } - - default Children geoShape(R column, Geometry geometry, ShapeRelation shapeRelation, Float boost) { - return geoShape(true, column, geometry, shapeRelation, boost); - } - - /** - * 图形GeoShape查询 用户指定图形(Point,MultiPoint,Line,MultiLine,Circle,LineaRing,Polygon,MultiPolygon,Rectangle) - * - * @param condition 条件 - * @param column 列 - * @param geometry 图形 - * @param shapeRelation 图形关系(可参考ShapeRelation枚举) - * @param boost 权重值 - * @return 泛型 - */ - Children geoShape(boolean condition, R column, Geometry geometry, ShapeRelation shapeRelation, Float boost); -} - ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 diff --git a/easy-es-core/src/main/java/com/xpc/easyes/core/enums/Analyzer.java b/easy-es-core/src/main/java/com/xpc/easyes/core/enums/Analyzer.java index 8e9f8b41..64bce081 100644 --- a/easy-es-core/src/main/java/com/xpc/easyes/core/enums/Analyzer.java +++ b/easy-es-core/src/main/java/com/xpc/easyes/core/enums/Analyzer.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package com.xpc.easyes.core.enums; import lombok.AllArgsConstructor; @@ -21,27 +20,3 @@ public enum Analyzer { IK_SMART, IK_MAX_WORD; } -======= -package com.xpc.easyes.core.enums; - -import lombok.AllArgsConstructor; - -/** - * 分词器枚举 - *

- * Copyright © 2021 xpc1024 All Rights Reserved - **/ -@AllArgsConstructor -public enum Analyzer { - STANDARD, - SIMPLE, - STOP, - WHITESPACE, - KEYWORD, - PATTERN, - LANGUAGE, - SNOWBALL, - IK_SMART, - IK_MAX_WORD; -} ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 diff --git a/easy-es-core/src/main/java/com/xpc/easyes/core/params/GeoParam.java b/easy-es-core/src/main/java/com/xpc/easyes/core/params/GeoParam.java index 271a6e23..31161443 100644 --- a/easy-es-core/src/main/java/com/xpc/easyes/core/params/GeoParam.java +++ b/easy-es-core/src/main/java/com/xpc/easyes/core/params/GeoParam.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package com.xpc.easyes.core.params; import lombok.Builder; @@ -67,73 +66,3 @@ public class GeoParam { */ private Float boost; } -======= -package com.xpc.easyes.core.params; - -import lombok.Builder; -import lombok.Data; -import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.geometry.Geometry; - -import java.util.List; - -/** - * Geo相关参数 - *

- * Copyright © 2021 xpc1024 All Rights Reserved - **/ -@Data -@Builder -public class GeoParam { - /** - * 字段名 - */ - private String field; - /** - * geoBoundingBox 左上点坐标 - */ - private GeoPoint topLeft; - /** - * geoBoundingBox 右下点坐标 - */ - private GeoPoint bottomRight; - /** - * 中心点坐标 - */ - private GeoPoint centralGeoPoint; - /** - * 距离 双精度类型 - */ - private Double distance; - /** - * 距离 单位 - */ - private DistanceUnit distanceUnit; - /** - * 距离 字符串类型 - */ - private String distanceStr; - /** - * 不规则坐标点列表 - */ - private List geoPoints; - /** - * 已被索引形状的索引id - */ - private String indexedShapeId; - /** - * 图形 - */ - private Geometry geometry; - /** - * 图形关系 - */ - private ShapeRelation shapeRelation; - /** - * 权重值 - */ - private Float boost; -} ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 diff --git a/easy-es-parent/pom.xml b/easy-es-parent/pom.xml index c3fc3ee1..26ab7013 100644 --- a/easy-es-parent/pom.xml +++ b/easy-es-parent/pom.xml @@ -6,11 +6,7 @@ io.github.xpc1024 easy-es-parent -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 easy-es-parent easy use for elastic search diff --git a/easy-es-sample/pom.xml b/easy-es-sample/pom.xml index c7e9496a..43cae7e6 100644 --- a/easy-es-sample/pom.xml +++ b/easy-es-sample/pom.xml @@ -9,11 +9,7 @@ easy-es io.github.xpc1024 -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 @@ -25,11 +21,7 @@ io.github.xpc1024 easy-es-boot-starter -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 org.springframework.boot diff --git a/pom.xml b/pom.xml index 736d3d7d..73f894d5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,11 +6,7 @@ io.github.xpc1024 easy-es -<<<<<<< HEAD 0.9.6 -======= - 0.9.5 ->>>>>>> 4e29790a442bc09d50d777b720a7a2ff9f7c6d28 easy-es easy use for elastic search