SID-01302: Search and Categorize
|| TWiki version:
|| Perl version:
|| Server OS:
|| Linux SLES 11
|| Last update:
|| 5 years ago
I have topics with a formfield 'Category' and I need to do a single search and to display topics under different categories.
For example if I have topics under categories Apples Oranges and I need to display the topics under each category
Is there anyway to achieve something similar with a single search ?
Discussion and Answer
You can do that by assigning each search hit to a SpreadSheetPlugin
variable, using one variable per category.
Here is an example doing a SEARCH on the latest 30 support questions. We keep two spreadsheet variables:
containing the list of topics with status "Asked", and
containing the list of topics with status "Answered". We then use the LISTMAP function to iterate over the list to create table rows showing all topics of a category:
View the raw topic
| Status Asked:
| SID-02277: JQueryPlugin - JQTAB - parameter for heading (h1..h6)
| SID-02275: ExplicitNumbering - Disabled - not view context
| SID-02274: Using escape character in search string and variables
| SID-02273: Deleted attachments are still visible
| SID-02272: How I can create a plugin?
| SID-02271: Error on redirect when sending email with SendEmailPlugin
| SID-02264: Tables in Discussion forum add-in
| SID-02263: LdapAuthorisationFailure
| SID-02260: Syncing changes in TWiki.
| SID-02259: Any plans to create an official docker image?
| SID-02257: Regex searches in UserList search box
| SID-02255: WYSIWYG Plugin is hanging
| SID-02254: Free servers to host TWiki using OVF
| SID-02252: Software Error
| SID-02249: Error installing Twiki - POSIX tzset not implemented
Thanks Peter that solution suits me fine.
However just for my information , is there any way to generate the list, not knowing beforehand what the categories would be. For example there may be many categories or maybe the categories keep increasing and I don't want to have to edit the search every time.
You could simply do a SEARCH and sort by the category, such as with
. Details in VarSEARCH
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.