The next steps in search functionality
|
|
By hillct , Section Dev Notes [] Posted on Fri Dec 07, 2001 at 05:46:21 AM PST
|
|
Now that FULLTEXT searches are working reasonably, the next set of features I plan to add in a substancial rewrite of the search code (when I have time) are:
- Stop slinging DB Statement Handles. Sling data between functions instead (code cleanup)
- 'Entire Site' search to integrate results from comments and stories
- Search Admin Notes if you have the perm edit_user and allow_admin_notes is turned on
- Blocks support for display of search results to allow greater flexibility
|
With regard to reducing the slinging of DB Statement Handles, this is mostly an internal code cleanup but there will be one user side feature resulting from the cleanup. The call to $S->search() will take an argument (NOFORMAT => 1 or something) which will cause the results to be returned as an an array of hash refs to be formatted in a seperate method. Internally, there will be a new method $s->search_format() which will take the search results as an array ref as well as the name of the search_* block (explained below) with which to format the results. In the case of NOFORMAT => 1, this method will simply not be called, and the result of fetchall_arrayref({}) will be returned from $S->search() instead.
As to block support for display of search results, it seems to me that there should be a set of blocks including search_entire, search_comments_by, search_stories, etc. where each search type will have a defauilt results display block which can be overridden in the call to $s->search(). Each of these blocks will contain variable substitutions for each of the fields of a single search result. Substitution against the block will be repeated for each search result until there are no further results. The usual search form and links will be added and the result will be output as 'CONTENT'. This is not strictly the intuitive behavior of blocks (although it is quite functional). If anyone can come up with a more intuitive and equally functional behavior, please let me know. |
|
Story Views
|
10 Scoop users have viewed this story.
|
|