Spot\Query::search PHP Method

    public function search($fields, $query, array $options = [])
    {
        $fields = (array) $fields;
        $entityDatasourceOptions = $this->mapper()->entityManager()->datasourceOptions($this->entityName());
        $fieldString = '`' . implode('`, `', $fields) . '`';
        $fieldTypes = $this->mapper()->fields($this->entityName());
        // See if we can use FULLTEXT search
        $whereType = ':like';
        $connection = $this->mapper()->connection($this->entityName());
        // Only on MySQL
        if ($connection instanceof \Spot\Adapter\Mysql) {
            // Only for MyISAM engine
            if (isset($entityDatasourceOptions['engine'])) {
                $engine = $entityDatasourceOptions['engine'];
                if ('myisam' == strtolower($engine)) {
                    $whereType = ':fulltext';
                    // Only if ALL included columns allow fulltext according to entity definition
                    if (in_array($fields, array_keys($this->mapper()->fields($this->entityName())))) {
                        // FULLTEXT
                        $whereType = ':fulltext';
                    }
                    // Boolean mode option
                    if (isset($options['boolean']) && $options['boolean'] === true) {
                        $whereType = ':fulltext_boolean';
                    }
                }
            }
        }
        // @todo Normal queries can't search mutliple fields, so make them separate searches instead of stringing them together
        // Resolve search criteria
        return $this->where([$fieldString . ' ' . $whereType => $query]);
    }