searching on the way
Posted on: 2 Apr, 2009
Read more in notebook: cleverbit dev news
I started work on a news page that readers could go to read the latest blog posts without having to click on them individually and I was encouraged by my husband to make it into a proper search page rather than just a most recent stories page. I ran into several troubles along the way. First it seems that the Criteria objects used by symfony only allow you to add 1 constraint per object field. Thus saying that I want the entry date to be both after a set start date and before a set end date is impossible to do with the given interface. Unfortunately this took me an hour or so of trouble shooting trying to figure out why my searches were returning somewhat random results. I've overcome this issue with a bit of sql rather than just using the Constraint->add interface by itself.
The second problem that I have not yet overcome is that the search page can only be accessed with the frontend_dev.php script (ie the url http://www.cleverbit.org/frontend_dev.php/search) rather than with the standard frontend.php which is how all of the other pages are accessed (including the one you are looking at now). I have no idea why this is and I've spent at least a few hours playing around with the routing and have made little or no progress.
Overall this experience is leading my in the direction of regretting using symfony at all since the documentation is proving to be not nearly as thorough as I was hoping, in fact much of the documentation found on the symfony website is out of date which is particularly frustrating - documents should not be labeled ver 1.2 if they contain information that will not work with ver 1.2.




