SID-01430: Search 2 webs
| Status: |
Answered |
TWiki version: |
5.0.1 |
Perl version: |
5.6.1 |
| Category: |
CategorySearch |
Server OS: |
Ubuntu 8.04 |
Last update: |
13 years ago |
When i try to search 2webs, i get seperate ordered topics.
For example:
20.3.2012 Web1 topic1
19.3.2012 Web1 topic2
18.3.2012 Web1 topic3
20.3.2012 Web2 topic1
19.3.2012 Web2 topic2
18.3.2012 Web2 topic3
Is it possible to get ordered without that grouping? So i would get:
20.3.2012 Web1 topic1
20.3.2012 Web2 topic1
19.3.2012 Web1 topic2
19.3.2012 Web2 topic2
18.3.2012 Web1 topic3
18.3.2012 Web2 topic3
My code:
SEARCH{"*" web="TWiki,Web2" type="regex" nosearch="on" noheader="on" order="modified"
format="
$date:
$percntIF{\"'$formfield(Title)'=''\" then=\"$topic\" else=\"$formfield(Title)\"}$percnt"
nototal="on" nonoise="on" excludetopic="*Template" casesensitive="on" limit="20" reverse="on" }
--
BostjanTovornik - 2012-03-20
Discussion and Answer
You can use a
TablePlugin sort to sort a search result that spans multiple webs. See example at
WebChangesForAllWebs.
--
PeterThoeny - 2012-03-20
When i search 2 webs i get ok results, when i use no-limit. When i limit it to for example 10 or 20, i get dates like it attachemnt below.
There are some topics from 11.2011 where there shouldnt be. And there should be topics between 27.02.2012 and 20.03.2012. When i use no limit i get ok results.
Code:
SEARCH{ "info.author!='TWikiJanitor'" type="query" nosearch="on" nototal="on" limit="10" reverse="on" order="modified"
web="TWiki,Web2"
format="| $date | $web.$topic |"
excludetopic="..." }
- last changes not working for 2 webs:
- no limit search:
--
BostjanTovornik - 2012-03-22
If you limit by number of topics the limit is applied for each web. That is the reason why one web shows older topics than others.
Instead of a
RegularExpression search (
type="regex"), use a
QuerySearch (
type="query") with a date condition.
--
PeterThoeny - 2012-03-22
Looks ok. Thanks
About date. Can i insert current date (- some days) into query? Could i use CALC{$SET(start, $TIMEADD($TIME(), -5, day))}
into "info.author!='TWikiJanitor' AND info.date >= d2n('2012-03-03')"
--
BostjanTovornik - 2012-03-23
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2012-07-01
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.