owl-cli 5.29.0 → 5.32.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.
|
@@ -872,11 +872,23 @@ var @projectCodeService = (function (pigeon) {
|
|
|
872
872
|
return filters;
|
|
873
873
|
},
|
|
874
874
|
|
|
875
|
-
buildQuery(m,searchArgs,keyword){
|
|
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
|
+
|
|
879
885
|
var v = searchArgs[k];
|
|
886
|
+
|
|
887
|
+
var isNotClause = false;
|
|
888
|
+
if(k.indexOf("!")===0){
|
|
889
|
+
isNotClause = true;
|
|
890
|
+
k = k.substring(1);
|
|
891
|
+
}
|
|
880
892
|
if(typeof v === 'object' && v.type === 'or'){
|
|
881
893
|
var shouldClauses = [];
|
|
882
894
|
if(Array.isArray(v.args)){
|
|
@@ -887,12 +899,21 @@ var @projectCodeService = (function (pigeon) {
|
|
|
887
899
|
}
|
|
888
900
|
|
|
889
901
|
});
|
|
890
|
-
|
|
902
|
+
if(isNotClause){
|
|
903
|
+
must_not.push({bool:{should:shouldClauses}});
|
|
904
|
+
}else{
|
|
905
|
+
filters.push({bool:{should:shouldClauses}});
|
|
906
|
+
}
|
|
907
|
+
|
|
891
908
|
}
|
|
892
909
|
else{
|
|
893
910
|
if(v.args && typeof(v.args)==='object'){
|
|
894
911
|
var shouldQueries = f.createQuery(v);
|
|
895
|
-
|
|
912
|
+
if(isNotClause){
|
|
913
|
+
must_not.push({bool:{should:shouldClauses}});
|
|
914
|
+
}else{
|
|
915
|
+
filters.push({bool:{should:shouldClauses}});
|
|
916
|
+
}
|
|
896
917
|
}
|
|
897
918
|
}
|
|
898
919
|
}
|
|
@@ -902,13 +923,21 @@ var @projectCodeService = (function (pigeon) {
|
|
|
902
923
|
'gte':v[0],
|
|
903
924
|
'lte':v[1]
|
|
904
925
|
}
|
|
905
|
-
|
|
926
|
+
if(isNotClause){
|
|
927
|
+
must_not.push({range:range});
|
|
928
|
+
}else{
|
|
929
|
+
filters.push({range:range});
|
|
930
|
+
}
|
|
906
931
|
}
|
|
907
932
|
else if(typeof(v)=='object' && v.type==='terms'){
|
|
908
933
|
var terms = {};
|
|
909
934
|
if(v.values){
|
|
910
935
|
terms[k + ".keyword"] = v.values;
|
|
911
|
-
|
|
936
|
+
if(isNotClause){
|
|
937
|
+
must_not.push({terms:terms});
|
|
938
|
+
}else{
|
|
939
|
+
filters.push({terms:terms});
|
|
940
|
+
}
|
|
912
941
|
}
|
|
913
942
|
}
|
|
914
943
|
else{
|
|
@@ -916,12 +945,21 @@ var @projectCodeService = (function (pigeon) {
|
|
|
916
945
|
if(typeof v == 'string' ){
|
|
917
946
|
if(v){
|
|
918
947
|
term[k+".keyword"] = trim('' + v)
|
|
919
|
-
|
|
948
|
+
if(isNotClause){
|
|
949
|
+
must_not.push({term:term});
|
|
950
|
+
}else{
|
|
951
|
+
filters.push({term:term});
|
|
952
|
+
}
|
|
953
|
+
|
|
920
954
|
}
|
|
921
955
|
}
|
|
922
956
|
else if (typeof v == 'number'){
|
|
923
957
|
term[k] = trim('' + v)
|
|
924
|
-
|
|
958
|
+
if(isNotClause){
|
|
959
|
+
must_not.push({term:term});
|
|
960
|
+
}else{
|
|
961
|
+
filters.push({term:term});
|
|
962
|
+
}
|
|
925
963
|
}
|
|
926
964
|
}
|
|
927
965
|
}
|
|
@@ -953,18 +991,15 @@ var @projectCodeService = (function (pigeon) {
|
|
|
953
991
|
"query":keywordQuery
|
|
954
992
|
}
|
|
955
993
|
},
|
|
956
|
-
"must_not":
|
|
957
|
-
"match": {
|
|
958
|
-
"del": "T"
|
|
959
|
-
}
|
|
960
|
-
},
|
|
994
|
+
"must_not": must_not,
|
|
961
995
|
"filter": filters
|
|
962
996
|
}
|
|
963
997
|
}
|
|
964
998
|
}
|
|
965
999
|
return query;
|
|
966
1000
|
},
|
|
967
|
-
|
|
1001
|
+
|
|
1002
|
+
count:function(m,searchArgs,keyword,dataSource){
|
|
968
1003
|
var query = f.buildQuery(m,searchArgs,keyword);
|
|
969
1004
|
var elasticSearchUrl = $.getEnv( "elasticSearchUrl" );
|
|
970
1005
|
|