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: 4 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-02169: Search Best Practice - Comma and Hash
SID-02158: Configure Script not running
SID-02156: Prevent non-WikiWords in Topic Names
SID-02152: Form select field values defined using Spreadsheet GETLIST
SID-02151: Watchlist Preferences - User unable to save changes
SID-02149: LDAP Authentication stopped working
SID-02146: FileUploadPlugin Error
SID-02140: After upgrading to Twiki 6, WebTopicCreate is not working.

Status Answered:
SID-02168: Twiki Web Statistics
SID-02167: Send email and submit form
SID-02166: DASHBOARD does weird stuff when boxes are resized
SID-02165: Figured out previous problem - NEW headache changing SKINS
SID-02163: Can't get "text" to work in Dashboard
SID-02162: Could not send confirmation email
SID-02161: Change an article URL?
SID-02160: Center All TWiki Pages?
SID-02159: Can't load Twiki home
SID-02157: Styles and images missing after install
SID-02155: Search query of raw text (not rendered text)
SID-02154: Can column breaks be forced inside %TWOCOLUMNS%, etc.?
SID-02153: Query Search Help
SID-02150: Upgrade Twiki 4.1.2 to 6.x
SID-02148: TWiki::Contrib::DBCacheContrib::Map: Badly formatted attribu
SID-02147: Oops: we could not recognize you. Try again or
SID-02145: Recurring error
SID-02144: Comment Plugin: Use emailto-parameter
SID-02143: ExecutePlugin EXECUTE ERROR: Script named 'uppercase' not found
SID-02142: How do I add a custom button or context menu entry?
SID-02141: using edittable within jqtabpane

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