I have a Javascript function which goes and searches Google Fusion table column values via search box field. I am trying to make it search multiple columns with OR clause but can not make it work.
function changeMap_1() {
var whereClause;
var searchString = document.getElementById('search-string_1').value.replace(/'/g, "\\'");
if (searchString != '--Select--') {
whereClause = "'Name' CONTAINS IGNORING CASE '" + searchString + "'";
}
layer_0.setOptions({
query: {
select: "col5",
from: "1xTAvPva0-iIJo6UAKS1UuERYQTjdYZfvqOlIX_HM",
where: whereClause
}
});
}
This is the function above. I have multiple "whereClause" values but everything else is the same.
whereClause = "'Name' CONTAINS IGNORING CASE '" + searchString + "'";
whereClause = "'Address' CONTAINS IGNORING CASE '" + searchString + "'";
whereClause = "'City' CONTAINS IGNORING CASE '" + searchString + "'";
How can i combine these "whereClause"s to say this OR this OR this...?
I tried the following two, but they didn't work.
whereClause = "'Name' CONTAINS IGNORING CASE '" || "'City' CONTAINS IGNORING CASE '" + searchString + "'";
and
whereClause = "'Name' CONTAINS IGNORING CASE '" + searchString + "'" || "'Name' CONTAINS IGNORING CASE '" + searchString + "'";
Any thoughts?