owl-cli 5.30.0 → 5.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -875,7 +875,17 @@ var @projectCodeService = (function (pigeon) {
|
|
|
875
875
|
buildQuery:function(m,searchArgs,keyword){
|
|
876
876
|
delete searchArgs.keyword;
|
|
877
877
|
var filters = [];
|
|
878
|
+
var must_not = [{
|
|
879
|
+
term:{
|
|
880
|
+
del:'T'
|
|
881
|
+
}
|
|
882
|
+
}];
|
|
878
883
|
for(var k in searchArgs){
|
|
884
|
+
var isNotClause = false;
|
|
885
|
+
if(k.indexOf("!")===0){
|
|
886
|
+
isNotClause = true;
|
|
887
|
+
k = k.substring(1);
|
|
888
|
+
}
|
|
879
889
|
var v = searchArgs[k];
|
|
880
890
|
if(typeof v === 'object' && v.type === 'or'){
|
|
881
891
|
var shouldClauses = [];
|
|
@@ -887,12 +897,21 @@ var @projectCodeService = (function (pigeon) {
|
|
|
887
897
|
}
|
|
888
898
|
|
|
889
899
|
});
|
|
890
|
-
|
|
900
|
+
if(isNotClause){
|
|
901
|
+
must_not.push({bool:{should:shouldClauses}});
|
|
902
|
+
}else{
|
|
903
|
+
filters.push({bool:{should:shouldClauses}});
|
|
904
|
+
}
|
|
905
|
+
|
|
891
906
|
}
|
|
892
907
|
else{
|
|
893
908
|
if(v.args && typeof(v.args)==='object'){
|
|
894
909
|
var shouldQueries = f.createQuery(v);
|
|
895
|
-
|
|
910
|
+
if(isNotClause){
|
|
911
|
+
must_not.push({bool:{should:shouldClauses}});
|
|
912
|
+
}else{
|
|
913
|
+
filters.push({bool:{should:shouldClauses}});
|
|
914
|
+
}
|
|
896
915
|
}
|
|
897
916
|
}
|
|
898
917
|
}
|
|
@@ -902,13 +921,21 @@ var @projectCodeService = (function (pigeon) {
|
|
|
902
921
|
'gte':v[0],
|
|
903
922
|
'lte':v[1]
|
|
904
923
|
}
|
|
905
|
-
|
|
924
|
+
if(isNotClause){
|
|
925
|
+
must_not.push({range:range});
|
|
926
|
+
}else{
|
|
927
|
+
filters.push({range:range});
|
|
928
|
+
}
|
|
906
929
|
}
|
|
907
930
|
else if(typeof(v)=='object' && v.type==='terms'){
|
|
908
931
|
var terms = {};
|
|
909
932
|
if(v.values){
|
|
910
933
|
terms[k + ".keyword"] = v.values;
|
|
911
|
-
|
|
934
|
+
if(isNotClause){
|
|
935
|
+
must_not.push({terms:terms});
|
|
936
|
+
}else{
|
|
937
|
+
filters.push({terms:terms});
|
|
938
|
+
}
|
|
912
939
|
}
|
|
913
940
|
}
|
|
914
941
|
else{
|
|
@@ -916,12 +943,21 @@ var @projectCodeService = (function (pigeon) {
|
|
|
916
943
|
if(typeof v == 'string' ){
|
|
917
944
|
if(v){
|
|
918
945
|
term[k+".keyword"] = trim('' + v)
|
|
919
|
-
|
|
946
|
+
if(isNotClause){
|
|
947
|
+
must_not.push({term:term});
|
|
948
|
+
}else{
|
|
949
|
+
filters.push({term:term});
|
|
950
|
+
}
|
|
951
|
+
|
|
920
952
|
}
|
|
921
953
|
}
|
|
922
954
|
else if (typeof v == 'number'){
|
|
923
955
|
term[k] = trim('' + v)
|
|
924
|
-
|
|
956
|
+
if(isNotClause){
|
|
957
|
+
must_not.push({term:term});
|
|
958
|
+
}else{
|
|
959
|
+
filters.push({term:term});
|
|
960
|
+
}
|
|
925
961
|
}
|
|
926
962
|
}
|
|
927
963
|
}
|
|
@@ -953,17 +989,14 @@ var @projectCodeService = (function (pigeon) {
|
|
|
953
989
|
"query":keywordQuery
|
|
954
990
|
}
|
|
955
991
|
},
|
|
956
|
-
"must_not":
|
|
957
|
-
"match": {
|
|
958
|
-
"del": "T"
|
|
959
|
-
}
|
|
960
|
-
},
|
|
992
|
+
"must_not": must_not,
|
|
961
993
|
"filter": filters
|
|
962
994
|
}
|
|
963
995
|
}
|
|
964
996
|
}
|
|
965
997
|
return query;
|
|
966
998
|
},
|
|
999
|
+
|
|
967
1000
|
count:function(m,searchArgs,keyword,dataSource){
|
|
968
1001
|
var query = f.buildQuery(m,searchArgs,keyword);
|
|
969
1002
|
var elasticSearchUrl = $.getEnv( "elasticSearchUrl" );
|