How do I log SQL statements?

I've turned on logging SQL statements, but they aren't being logged in the errors.log file. Is there somewhere else I should look?

This relates to another issue I'm having with the advanced search. Sometime after we upgraded to 1.1 and installed a custom theme, our advanced search isn't working anymore. The 'contain' statements are fine, but 'does not contain' only filters out some of the items not all of them. For instance if I write "Type does not contain dance" and "Type contains cards", one of the first records I get is a dance card (

The SQL statement work fine when written directly in MySQL, so it seems to be a php issue. I've looked at the ItemSearch.php file in application/models, but can't figure out what its actually writing. Any ideas?

For to your first question: You should make sure that application/logs/errors.log is writable by the server. See our instructions for Retrieving Error Messages in our documentation.

For your second question: Omeka's search is inclusive, not exclusive. In other words, the scenario you just described would be searched like this: Find items where type does not contain dance OR type does contain cards. Omeka's search worked like this in 1.0 as well. If it didn't work like that for your site, there may have been an issues with your previous installation. I'll check with the rest of the development team on this to confirm. If you did the same query on 1.0 or previous, did the search not return the record?

Yes the errors.log is writable. I am thinking it's a setting in the mysql installation, but I am still investigating.

On the second point. The inclusive search doesn't seem to be working properly then because we have 71 items with cards in the type field (various types of cards include 13 dance cards). However when I do the same search I described above (contain cards, does not contain dance), I get 63 items. So it is filtering out 8 dance cards, but keeping 5 in there. What I'd really like to do is modify the search so its AND not OR. Can you tell me what files I need to modify other than ItemSearch.php (I've already tried this)? Thanks.

I don't think Omeka logs all of your MySQL queries. To do that, I think you need to change your MySQL configuration settings to specify a log file for all mysql queries.