SID-02213: Searching for author/user
| Status: |
Answered |
TWiki version: |
6.0.2 |
Perl version: |
v5.10.1 |
| Category: |
CategorySearch |
Server OS: |
CentOS 6.7 kernel 2.6.32 |
Last update: |
9 years ago |
I'm trying to make a table to output search results and created a topic
WebSearch containing:
%INCLUDE{"%TWIKIWEB%.%TOPIC%"}%
and I get this nice box which will search for attachments and list the user, date and so on. I'd like to know how to limit the search output to a single user. Any help?
--
John Huber - 2016-06-16
Discussion and Answer
Sorry: It was
WebSearchAttachments I made from the one on this wiki. -pat
--
John Huber - 2016-06-16
If you want to limit the
WebSearchAttachments query to a particular user you need to clone
TWiki.WebSearchAttachments in your TWiki and customize the search result.
Look for this:
$SETLIST(
afNames,
$LISTIF(
$SEARCH(
%GET{af}%,
$LOWER($item)
),
$GETLIST(attNames)
)
)
And change it to this untested example (using "JohnHuber" as the user) :
$SETLIST(
afNames,
$LISTIF(
$AND(
$EXACT(
$GETHASH(attUsers, $item),
JohnHuber
),
$SEARCH(
%GET{af}%,
$LOWER($item)
)
),
$GETLIST(attNames)
)
)
--
Peter Thoeny - 2016-06-24
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.