I was thinking last night about the best way to make our site search better (i.e. including tvs) and thought of a new way to do it. What if we created a search index table that contained the docid and the generated output of the document as a field in the table. This would be generated everytime a page is updated in the manager (maybe an option to toggle this) or by clicking on a refresh search index button in the manager. This would allow for tv searching since all of the content would be loaded into the table. I think the seach would be faster too since you wouldn’t have to pull information from multiple tables.
Any ideas suggestions about this?
I don’t think something like this would be to hard to implement but could provide much better searching than we currently have.
Jason, thanks for the input. One question for you, is there a way to check which version of mysql a user is running? Or would I just need a parameter in the search snippet to determine which type of searching to do, incase someone was on mysql < 4?
Here are the plans I have now for implementing this.
Create a new table named search_index with the fields content_id, doc_output, expire_date
Only items marked searchable & published will be included in the index
Add an option to the site settings page in the manager for:
-If page is uncached regenerate search index after? (hours)
Add a button to the manager for refresh search_index, this will go through and update all pages in the index
Add function to save_content.processor.php to insert/update page content in search_index
Add function to postprocess() to update the search_index if the expiration date has passed for uncached pages
Update the AjaxSearch snippet to search the index instead of the content table
Anything I am missing? I will have to look into the quickedit functionality as I have never looked at its code.