Creating a search tool with the Searchable behaviour in Doctrine

Once you’ve set up a searchable behaviour on a doctrine model, and have indexed all the keywords on the model, you are going to want to build a search tool. First we should create a simple symfony form.

Continue reading Creating a search tool with the Searchable behaviour in Doctrine

Re-indexing a doctrine object with a symfony task

Yesterday I explained how to add the Searchable behaviour to a doctrine object,  to I’ll cover that how to create a symfony task to re-index all the existing objects. The basic idea of the task is to retrieve all the objects from your database, mark them as dirty and re-save them. If you don’t mark them as dirty, nothing will update when you save, which is what you would expect from doctrine.

Continue reading Re-indexing a doctrine object with a symfony task

Adding the Searchable behaviour to a Doctrine model in Symfony

The searchable behaviour within Doctrine is a brilliant and powerful way to add a quick and simple search to your symfony code. The basics of this behaviour are to create an index table for your given model, which contains 4 things, a keyword, the field it was in, the position and the object id it was in.

Continue reading Adding the Searchable behaviour to a Doctrine model in Symfony