Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Full text search in DB class or ORM?
  • Does Fuelphp's database class or ORM have support for full text search?

    I'm trying to do full text search but I discovered that different database engines have different implementation. While mysql's implementation looks simple and straight forward, Postgres' implementation looks complicated (I'm yet to properly study it though, just a quick look) and the app I'm working on should work on both mysql (or mariadb) and postgres.

    I want to know if Fuelphp's database class or ORM has a consistent way of doing full text search irrespective of which database engine being used otherwise I'll have to write different codes for different database engines.

    BTW is there a way to determine the database engine being used from the DB class, ORM or any means?
  • HarroHarro
    Accepted Answer
    No, as it is (very) platform specific. And as you have already noticed, it is not easy to come up with a consistent interface for it. Afaik, other ORM's (like Propel, Doctrine, etc) don't have support for it either.

    As for your BTW, yes, the database connection class has a method for that:

    \DB::instance()->driver_name()

    or 

    \DB::instance('db-definition')->driver_name() 

    if you have multiple definitions in your db.php. And you'd probably want to test if the instance exists before calling a method on it. ;-)
  • I see BTW that none-PDO drivers don't have this method, so it's not very consistent.
  • Thanks. Since I'm using PDO I think it'll work. I'm yet to try it though.
  • I just tried it and it works like a charm. Thanks.

    Have you ever done full text search in postgres before? I'm having problem understanding how it works.
  • No, I personally have very little Postgres experience.
  • Okay. Thanks for your help.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion