Commit f3c4426e authored by tianyiming's avatar tianyiming

修改bug

parent 90124160
...@@ -685,7 +685,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -685,7 +685,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private void getParamQuery(String paramKey, String condition, Object value, Boolean isCustom, BoolQueryBuilder boolMust, EnhancedDynamicQueryBuilder builder, String andOr) { private void getParamQuery(String paramKey, String condition, Object value, Boolean isCustom, BoolQueryBuilder boolMust, EnhancedDynamicQueryBuilder builder, String andOr) {
String path = "techParams"; String path = "techParams";
String nestedFieldKey = path + ".paramKey"; String nestedFieldKey = path + ".paramKey";
String longEnd = ".longValue"; String doubleEnd = ".doubleValue";
String stringEnd = ".strValue"; String stringEnd = ".strValue";
NestedQueryBuilder keyNestedQuery = QueryBuilders.nestedQuery( NestedQueryBuilder keyNestedQuery = QueryBuilders.nestedQuery(
path, path,
...@@ -750,7 +750,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -750,7 +750,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "gt": case "gt":
NestedQueryBuilder gtQuery = QueryBuilders.nestedQuery( NestedQueryBuilder gtQuery = QueryBuilders.nestedQuery(
path, path,
QueryBuilders.rangeQuery(path + longEnd).gt(value.toString()), QueryBuilders.rangeQuery(path + doubleEnd).gt(value.toString()),
ScoreMode.Avg ScoreMode.Avg
); );
if (isCustom) { if (isCustom) {
...@@ -762,7 +762,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -762,7 +762,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "gte": case "gte":
NestedQueryBuilder gteQuery = QueryBuilders.nestedQuery( NestedQueryBuilder gteQuery = QueryBuilders.nestedQuery(
path, path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).gte(value.toString())), QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).gte(value.toString())),
ScoreMode.Avg ScoreMode.Avg
); );
if (isCustom) { if (isCustom) {
...@@ -774,7 +774,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -774,7 +774,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "lt": case "lt":
NestedQueryBuilder ltQuery = QueryBuilders.nestedQuery( NestedQueryBuilder ltQuery = QueryBuilders.nestedQuery(
path, path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).lt(value.toString())), QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).lt(value.toString())),
ScoreMode.Avg ScoreMode.Avg
); );
if (isCustom) { if (isCustom) {
...@@ -786,7 +786,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -786,7 +786,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "lte": case "lte":
NestedQueryBuilder lteQuery = QueryBuilders.nestedQuery( NestedQueryBuilder lteQuery = QueryBuilders.nestedQuery(
path, path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).lte(value.toString())), QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).lte(value.toString())),
ScoreMode.Avg ScoreMode.Avg
); );
if (isCustom) { if (isCustom) {
...@@ -799,7 +799,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -799,7 +799,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray btValues = (JSONArray) value; JSONArray btValues = (JSONArray) value;
NestedQueryBuilder betweenQuery = QueryBuilders.nestedQuery( NestedQueryBuilder betweenQuery = QueryBuilders.nestedQuery(
path, path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).gte(Double.parseDouble(btValues.get(0).toString())).lte(Double.parseDouble(btValues.get(1).toString()))), QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).gte(Double.parseDouble(btValues.get(0).toString())).lte(Double.parseDouble(btValues.get(1).toString()))),
ScoreMode.Avg ScoreMode.Avg
); );
if (isCustom) { if (isCustom) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment