diff --git a/search/filters/PartialMatchFilter.php b/search/filters/PartialMatchFilter.php index 1894a7237..1237cefe0 100644 --- a/search/filters/PartialMatchFilter.php +++ b/search/filters/PartialMatchFilter.php @@ -14,11 +14,17 @@ class PartialMatchFilter extends SearchFilter { public function apply(DataQuery $query) { $this->model = $query->applyRelation($this->relation); - return $query->where(sprintf( - "%s LIKE '%%%s%%'", - $this->getDbName(), - Convert::raw2sql($this->getValue()) - )); + $where = array(); + if(is_array($this->getValue())) { + foreach($this->getValue() as $value) { + $where[]= sprintf("%s LIKE '%%%s%%'", $this->getDbName(), Convert::raw2sql($value)); + } + + } else { + $where[] = sprintf("%s LIKE '%%%s%%'", $this->getDbName(), Convert::raw2sql($this->getValue())); + } + + return $query->where(implode(' OR ', $where)); } public function isEmpty() {