I am planning to write a web application that allows users to search for a phrase within Wiki pages, ticket comments, project names, etc, basically reproducing the functionality in Redmine:
I don't know Python, so it may be easier for me to do it in PHP. Assuming it's PHP, I did a small test using PHP-PDO, and looping over all projects I searched for a phrase in the Wiki pages using something like this:
SELECT name,version,author FROM (SELECT name, max(version) AS version, author, text FROM wiki GROUP BY name) WHERE text LIKE '%$searchTerm%'
It takes too long, so I need another solution, such as:
- Adding an index to the existing Trac databases - possible? does this mess them up? Can Trac still use them?
- Doing hourly/daily dumps to MySQL with indexes on the MySQL database
- Not sure what else...
Are the Trac databases indexed, or set up to do this faster than I'm already doing it?
Thanks a lot!