Tags:
create new tag
view all tags

Question

Sorry to bug you all with this, but I've hunted all over for an example to use (can't find one) and I still don't understand how to write my own search queries well enough to do this myself. These things still look like greek to me. So how do I use the search function to dynamically generate a list of all users from a particular office (i.e. all users at the TokyoOffice)? I found something sort of similar at CambridgeOffice, but it isn't quite right since it references both a country and city and I haven't figured out how to modify it appropriately. Thanks in advance.

Environment

TWiki version: TWikiRelease04Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: SunSolaris
Web server: Apache vers?
Perl version: ?
Client OS: Windows 2000
Web Browser: IE 6x
Categories: Search

-- AmandaSmith - 22 Feb 2006

Answer

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.

I fixed the example in CambridgeOffice, it was broken: %SEARCH{ "\* [C]ity\:.*Cambridge" regex="on" nosearch="on" format="$topic" separator=", " }%

This assumes bullet format on the user home pages. You can make the search also more strict, for example to list people in Cambridge USA, not UK: "\* [C]ity\:.*Cambridge;\* [C]ountry\:.*USA"

If you use forms for user data it is much easier to query and format the output. Untested example:

%SEARCH{ "META:FIELD.*[C]ity.*Cambridge" regex="on" nosearch="on" format="| $topic | $formfield(Email) | $formfield(Phone) |" }%

-- PeterThoeny - 22 Feb 2006

Thanks! It didn't quite work in my case, but it was enough for me to figure out what modifications I needed to make for it to work. This is my working version, I've changed [C]ity to [L]ocation and changed the separator style to line breaks. Also, the actual office name is changed to protect the guilty. wink

%SEARCH{ "\* [L]ocation\:.*TokyoOffice" regex="on" nosearch="on" format="$topic" separator=" %BR% " }%

-- AmandaSmith - 23 Feb 2006

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-02-23 - AmandaSmith
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.