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: 6 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-02361: Entry point / directories
SID-02360: Behaviour JS Questions
SID-02357: flowchart not generate .svg or png file
SID-02356: Could not perform search. Error was: /bin/grep -F -i -l -H
SID-02354: need info reg twiki users and their webs
SID-02353: GDPR
SID-02351: How to add submenu under main menu?
SID-02350: How to add submenu under main menu?
SID-02349: Move tags to bottom of the screen
SID-02347: Create new topic is not correctly redirecting.
SID-02342: Formatting issue
SID-02337: Twiki Installation on HP-UX
SID-02336: Fresh install of TWiki-6.0.2 problem with CSS, images
SID-02333: changing the links to attachments to dynamic

Status Answered:
SID-02359: Cannot register on twiki.org
SID-02358: Backup & Restore console
SID-02355: LDAPContrib plugin pre-requisite DB_File::Lock issue
SID-02352: Watchlistnotify sends mail to root or www-data
SID-02348: Attachment link - createlink
SID-02346: Twisty inserting new rows in a table
SID-02345: after install all links look broken and menus do not work
SID-02344: varFORM and $formweb
SID-02343: New line in varCHILDREN
SID-02341: Download after purchase
SID-02340: CreateTopicAndAttachInOneStep
SID-02339: First Time Install of Wiki 6.0.1 using VM Linux
SID-02338: How do I configure permissions by user?
SID-02335: exclude keywords when web="All" actually includes instead
SID-02334: Topic template (using VIEW_TEMPLATE) disables PatternSkin
SID-02332: TemplatePath missing in Configure

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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.