Tags:
create new tag
, view all tags

SID-01302: Search and Categorize

Status: Answered Answered TWiki version: 5.0.2 Perl version:
Category: CategorySearch Server OS: Linux SLES 11 Last update: 3 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
Apples
Topic 1
Oranges
Topic 3
Topic 4

Is there anyway to achieve something similar with a single search ?

-- RonMascarenhas - 2011-10-23

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: StatusAsked containing the list of topics with status "Asked", and StatusAnswered 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:

Status Asked:
SID-02081: Twiki-Vm installation: This page can't be displayed
SID-02076: Doubt about database store of the topics
SID-02075: Can't access to the frontpage
SID-02073: Underscores Missing in TOC
SID-02069: There has been a problem adding your user id to the Password
SID-02067: Date Calc
SID-02064: Malformed UTF-8 character (fatal)
SID-02063: Undesired Values when using forms in templates
SID-02059: TWiki on Gluster filestore
SID-02057: unix to windows twiki move
SID-02056: Radio button doesn't work as mandatory field
SID-02054: TWiki upgrade

Status Answered:
SID-02082: Custom plugin params _DEFAULT behavior disagreement
SID-02080: Macros and Interwiki links
SID-02079: Configure error Failed to load the perl module CGI qw(:any).
SID-02077: How to move the format field for a Search into a Topic variable?
SID-02074: Construction of hash with list elements
SID-02072: Compatibility of twiki 4.2 on Windows 2008
SID-02071: Multiple Wiki's in Apache virtual hosts - Configure Issue
SID-02070: Migrated from 4.2.4 to 6.0.1 and users are all red
SID-02068: Customize top menu
SID-02066: STARTFLOATBOX
SID-02065: unexplained loss of permission for twiki/pub
SID-02062: Is it possibility to modify pages/documents in a batch mode?
SID-02061: Enabling Review Date Notifications
SID-02060: Wysiwyg does not work after reboot
SID-02055: indexed search with attachments?
SID-02053: How to filter search results by the date in a formfield

View the raw topic for details.

-- PeterThoeny - 2011-10-24

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.

-- RonMascarenhas - 2011-10-24

You could simply do a SEARCH and sort by the category, such as with order="formfield(Category)". Details in VarSEARCH.

-- PeterThoeny - 2011-10-25

-- RonMascarenhas - 2011-11-18

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Search and Categorize
SupportCategory CategorySearch
TWiki version 5.0.2
Server OS Linux SLES 11
Web server apache2
Perl version

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2011-11-18 - RonMascarenhas
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.