Tags:
create new tag
view all tags

SID-01430: Search 2 webs

Status: Answered 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:
    zadnjeSpremembe.jpeg

  • no limit search:
    zadnjeSpremembe2.jpeg
-- 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

      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 2 webs
SupportCategory CategorySearch
TWiki version 5.0.1
Server OS Ubuntu 8.04
Web server Apache
Perl version 5.6.1
Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpeg zadnjeSpremembe.jpeg r1 manage 32.1 K 2012-03-22 - 07:30 UnknownUser last changes not working for 2 webs
JPEGjpeg zadnjeSpremembe2.jpeg r1 manage 20.7 K 2012-03-22 - 07:41 UnknownUser no limit search
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2012-07-01 - PeterThoeny
 
  • 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.