Best way to Search in all Cloumns?

always i use this following code in mysql :

SELECT * FROM myobject 
WHERE MATCH(`name`, `foo`, `bar`) AGAINST ('$search') IN BOOLEAN MODE

in phalcon ORM :

            "columns” => "id, name”,
            "conditions" => "name LIKE ?1 OR foo LIKE ?1 OR bar LIKE ?1 ",
            "bind"       => [1 =>$search]

How to find through all cloumns?

is this possible in phalcon ORM in a Quick way?


Hey, there is no such built in solution since Phalcon aims for top performance. However there is a nice solution from the community:

Note: I haven't used it, but looked through source files and it looks promising.

Also here is a nice list of Phalcon goodies:


I suggest using raw SQL, Phalcon has that option:

Therefore you can create a function in your model which utilizes the above Phalcon\Mvc\Model\Resultset\Simple

My solution:



create query->

CONCAT(cloumn,cloumn2,....) LIKE '%param%'

And Excute it!

Not problem! Just i searching for best way...

Well if you using for example metadata cache or annotations metadata then your solution perhaps gonna be faster than raw query bot not sure about it.