Commit 05dc286c by Kim Eunchul

#39714 andやor検索(or条件修正)

parent cfede9da
...@@ -1074,17 +1074,17 @@ CONTENTSEARCH.searchEventButtonFunction = function() { ...@@ -1074,17 +1074,17 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
} }
for (var i = 1; i < myArray.length; i++){ for (var i = 1; i < myArray.length; i++){
if(myArray[i] == "OR" || myArray[i] == "or"){ if(myArray[i] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i]); myRegExpArr[i] = new RegExp(myArray[i]);
}else if(myArray[i].charAt(0) == "(" || myArray[i] == "("){ }else if(myArray[i].charAt(0) == "(" || myArray[i] == "("){
if(myArray[i] == "("){ if(myArray[i] == "("){
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myQuery += ' || ('; myQuery += ' || (';
}else{ }else{
myQuery += ' && ('; myQuery += ' && (';
} }
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i].slice(1)); myRegExpArr[i] = new RegExp(myArray[i].slice(1));
myQuery += ' || ( true'; myQuery += ' || ( true';
count++; count++;
...@@ -1098,7 +1098,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() { ...@@ -1098,7 +1098,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
if(myArray[i] == ")"){ if(myArray[i] == ")"){
myQuery += ' )'; myQuery += ' )';
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i].slice(0, -1)); myRegExpArr[i] = new RegExp(myArray[i].slice(0, -1));
myQuery += ' || true )'; myQuery += ' || true )';
count++; count++;
...@@ -1109,7 +1109,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() { ...@@ -1109,7 +1109,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
} }
} }
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i]); myRegExpArr[i] = new RegExp(myArray[i]);
myQuery += ' || true'; myQuery += ' || true';
count++; count++;
......
...@@ -773,17 +773,17 @@ CONTENTVIEW.searchHandle = function() { ...@@ -773,17 +773,17 @@ CONTENTVIEW.searchHandle = function() {
} }
for (var i = 1; i < myArray.length; i++){ for (var i = 1; i < myArray.length; i++){
if(myArray[i] == "OR" || myArray[i] == "or"){ if(myArray[i] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i]); myRegExpArr[i] = new RegExp(myArray[i]);
}else if(myArray[i].charAt(0) == "(" || myArray[i] == "("){ }else if(myArray[i].charAt(0) == "(" || myArray[i] == "("){
if(myArray[i] == "("){ if(myArray[i] == "("){
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myQuery += ' || ('; myQuery += ' || (';
}else{ }else{
myQuery += ' && ('; myQuery += ' && (';
} }
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i].slice(1)); myRegExpArr[i] = new RegExp(myArray[i].slice(1));
myQuery += ' || ( myRegExpArr[' + i + '].test(contentPage[nIndex].pageText)'; myQuery += ' || ( myRegExpArr[' + i + '].test(contentPage[nIndex].pageText)';
count++; count++;
...@@ -797,7 +797,7 @@ CONTENTVIEW.searchHandle = function() { ...@@ -797,7 +797,7 @@ CONTENTVIEW.searchHandle = function() {
if(myArray[i] == ")"){ if(myArray[i] == ")"){
myQuery += ' )'; myQuery += ' )';
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i].slice(0, -1)); myRegExpArr[i] = new RegExp(myArray[i].slice(0, -1));
myQuery += ' || myRegExpArr[' + i + '].test(contentPage[nIndex].pageText) )'; myQuery += ' || myRegExpArr[' + i + '].test(contentPage[nIndex].pageText) )';
count++; count++;
...@@ -808,7 +808,7 @@ CONTENTVIEW.searchHandle = function() { ...@@ -808,7 +808,7 @@ CONTENTVIEW.searchHandle = function() {
} }
} }
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i]); myRegExpArr[i] = new RegExp(myArray[i]);
myQuery += ' || myRegExpArr[' + i + '].test(contentPage[nIndex].pageText)'; myQuery += ' || myRegExpArr[' + i + '].test(contentPage[nIndex].pageText)';
count++; count++;
......
...@@ -302,17 +302,17 @@ HEADER.searchHeaderButtonFunction = function(){ ...@@ -302,17 +302,17 @@ HEADER.searchHeaderButtonFunction = function(){
} }
for (var i = 1; i < myArray.length; i++){ for (var i = 1; i < myArray.length; i++){
if(myArray[i] == "OR" || myArray[i] == "or"){ if(myArray[i] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i]); myRegExpArr[i] = new RegExp(myArray[i]);
}else if(myArray[i].charAt(0) == "(" || myArray[i] == "("){ }else if(myArray[i].charAt(0) == "(" || myArray[i] == "("){
if(myArray[i] == "("){ if(myArray[i] == "("){
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myQuery += ' || ('; myQuery += ' || (';
}else{ }else{
myQuery += ' && ('; myQuery += ' && (';
} }
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i].slice(1)); myRegExpArr[i] = new RegExp(myArray[i].slice(1));
myQuery += ' || ( true'; myQuery += ' || ( true';
count++; count++;
...@@ -326,7 +326,7 @@ HEADER.searchHeaderButtonFunction = function(){ ...@@ -326,7 +326,7 @@ HEADER.searchHeaderButtonFunction = function(){
if(myArray[i] == ")"){ if(myArray[i] == ")"){
myQuery += ' )'; myQuery += ' )';
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i].slice(0, -1)); myRegExpArr[i] = new RegExp(myArray[i].slice(0, -1));
myQuery += ' || true )'; myQuery += ' || true )';
count++; count++;
...@@ -337,7 +337,7 @@ HEADER.searchHeaderButtonFunction = function(){ ...@@ -337,7 +337,7 @@ HEADER.searchHeaderButtonFunction = function(){
} }
} }
}else{ }else{
if(myArray[i - 1] == "OR" || myArray[i - 1] == "or"){ if(myArray[i - 1] == "OR"){
myRegExpArr[i] = new RegExp(myArray[i]); myRegExpArr[i] = new RegExp(myArray[i]);
myQuery += ' || true'; myQuery += ' || true';
count++; count++;
......
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