<<O>> Difference Topic FormattedSearch (r1.9 - 13 Aug 2002 - PeterThoeny) |
Changed: | |
< < |
Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. Example: header="| *Topic:* | *Summary:* |"
|
> > |
Use the header parameter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. Example: header="| *Topic:* | *Summary:* |" |
<<O>> Difference Topic FormattedSearch (r1.8 - 17 May 2002 - PeterThoeny) |
Deleted: | |
< < |
Nested SearchSearch can be nested. For example, search for some topics, then form a new search for each topic found in the first search. The idea is to build the nested search string using a formatted search in the first search. Here is an example. We want to search for topics, do a nested search with each hit, and show the result as nested bullets. Parameters likescope="text" regex="on" nosearch="on" nototal="on" are omitted for simplicity.
|
Changed: | |
< < | Write this: |
> > | Write this: |
Changed: | |
< < | To get this: |
> > | To get this: |
Changed: | |
< < | Write this in the Know web: |
> > | Write this in the Know web: |
Changed: | |
< < | To get this: |
> > | To get this: |
Changed: | |
< < | Write this: |
> > | Write this: |
Changed: | |
< < | To get this: |
> > | To get this: |
Added: | |
> > |
Nested SearchSearch can be nested. For example, search for some topics, then form a new search for each topic found in the first search. The idea is to build the nested search string using a formatted search in the first search. Here is an example. Let's search for all topics that contain the word "culture" (first search), and let's find out where each topic found is linked from (second search).
%SEARCH{ "culture" format=" * $topic is referenced by:$n * $percntSEARCH{ \"$topic\" format=\" $dollartopic\" nosearch=\"on\" nototal=\"on\" }$nop%" nosearch="on" nototal="on" }%
To get this:
|
<<O>> Difference Topic FormattedSearch (r1.7 - 20 Apr 2002 - PeterThoeny) |
Deleted: | |||||||||||||||||||||
< < |
Overview | ||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < | Two paramters can be used to specify a customized search result: | ||||||||||||||||||||
> > | Two parameters can be used to specify a customized search result: | ||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e. header="| *Topic:* | *Summary:* |"
| ||||||||||||||||||||
> > |
Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. Example: header="| *Topic:* | *Summary:* |"
| ||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
| ||||||||||||||||||||
> > |
Use the format parameter to specify the format of one search hit.
Example: format="| $topic | $summary |"
| ||||||||||||||||||||
Deleted: | |||||||||||||||||||||
< < |
| ||||||||||||||||||||
Added: | |||||||||||||||||||||
> > |
| ||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
| ||||||||||||||||||||
> > |
| ||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
| ||||||||||||||||||||
> > |
$pattern(reg-exp) , specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, like $pattern(.*?(from here.*?to here).*) . You need to make sure that the integrity of a web page is not compromised; for example, if you include a table make sure to include everything including the table end tag.
Nested SearchSearch can be nested. For example, search for some topics, then form a new search for each topic found in the first search. The idea is to build the nested search string using a formatted search in the first search. Here is an example. We want to search for topics, do a nested search with each hit, and show the result as nested bullets. Parameters likescope="text" regex="on" nosearch="on" nototal="on" are omitted for simplicity.
| ||||||||||||||||||||
Deleted: | |||||||||||||||||||||
< < |
Note: For $pattern(reg-exp) , specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, i.e. $pattern(.*?(from here.*?to here).*) . You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag.
| ||||||||||||||||||||
Added: | |||||||||||||||||||||
> > | |||||||||||||||||||||
Changed: | |||||||||||||||||||||
< < |
-- PeterThoeny - 28 Nov 2001 | ||||||||||||||||||||
> > | -- PeterThoeny - 16 May 2002 |
<<O>> Difference Topic FormattedSearch (r1.6 - 18 Feb 2002 - PeterThoeny) |
Changed: | |||
< < |
| ||
> > |
|
<<O>> Difference Topic FormattedSearch (r1.5 - 16 Feb 2002 - PeterThoeny) |
Added: | |||
> > |
|
<<O>> Difference Topic FormattedSearch (r1.4 - 15 Jan 2002 - PeterThoeny) |
Changed: | |
< < |
By default, the format for displaying a search result is fixed, e.g. a table with rows of topic name and topic summary. Use the format="..." parameter to specify a customized format of the search result. The string of the format parameter is typically a bullet list or table row containing variables (i.e. %SEARCH{ "food" format="| $topic | $summary |" }% ).
|
> > |
The %SEARCH{...}% variable documented in TWikiVariables has a fixed format for the search result, that is, a table consisting of topic names and topic summaries. Use the format="..." parameter to specify a customized format of the search result. The string of the format parameter is typically a bullet list or table row containing variables (such as %SEARCH{ "food" format="| $topic | $summary |" }% ). |
<<O>> Difference Topic FormattedSearch (r1.3 - 02 Dec 2001 - MikeMannix) |
Deleted: | |
< < |
Formatted Search Using %SEARCH{... format="..."}% Variable
|
Added: | |
> > |
TWiki Formatted Search ResultsInline search feature allows flexible formatting of search result |
Changed: | |
< < |
Preface |
> > |
Overview |
<<O>> Difference Topic FormattedSearch (r1.2 - 29 Nov 2001 - PeterThoeny) |
Changed: | |||||
< < |
Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e. header="| *Topic:* | *Summary:* |"
| ||||
> > |
Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e. header="| *Topic:* | *Summary:* |"
| ||||
Changed: | |||||
< < |
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
| ||||
> > |
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
| ||||
Added: | |||||
> > |
| ||||
Changed: | |||||
< < |
| ||||
> > |
| ||||
Added: | |||||
> > |
| ||||
Changed: | |||||
< < |
| ||||
> > |
| ||||
Changed: | |||||
< < |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem?) | $formfield(OsVersion?) |" }%
| ||||
> > |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem) | $formfield(OsVersion) |" }%
| ||||
Changed: | |||||
< < |
-- PeterThoeny - 24 Oct 2001 | ||||
> > |
-- PeterThoeny - 28 Nov 2001 |
<<O>> Difference Topic FormattedSearch (r1.1 - 25 Oct 2001 - PeterThoeny) |
Added: | ||||||||||||||||||||||||||||||
> > |
%META:TOPICINFO{author="PeterThoeny" date="1003975981" format="1.0" version="1.1"}%
%META:TOPICPARENT{name="TWikiVariables"}%
Formatted Search Using %SEARCH{... format="..."}% Variable
PrefaceBy default, the format for displaying a search result is fixed, e.g. a table with rows of topic name and topic summary. Use theformat="..." parameter to specify a customized format of the search result. The string of the format parameter is typically a bullet list or table row containing variables (i.e. %SEARCH{ "food" format="| $topic | $summary |" }% ).
SyntaxTwo paramters can be used to specify a customized search result: 1.header="..." parameter
Use the header paramter to specify the header of a search result. It should correspond to the format of the format parameter. This parameter is optional. I.e. header="| *Topic:* | *Summary:* |"
2. format="..." parameter
Use the format paramter to specify the format of one search hit. I.e. format="| $topic | $summary |"
Variables that can be used in the format string:
$pattern(reg-exp) , specify a RegularExpression that scans from start to end and contains the text you want to keep in parenthesis, i.e. $pattern(.*?(from here.*?to here).*) . You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag.
ExamplesBullet list showing topic name and summaryWrite this:%SEARCH{ "FAQ" scope="topic" nosearch="on" nototal="on" header=" * *Topic: Summary:*" format=" * [[$topic]]: $summary" }%
To get this:
Table showing form field values of topics with a formWrite this in the Know web:| *Topic:* | *OperatingSystem:* | *OsVersion:* | %SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem?) | $formfield(OsVersion?) |" }%
To get this:
Extract some text from a topic using regular expressionWrite this:%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format=" * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }%
To get this:
TWiki FAQs:
|
Topic FormattedSearch . { View | Diffs | r1.9 | > | r1.8 | > | r1.7 | More } |
Revision r1.1 - 25 Oct 2001 - 02:13 GMT - PeterThoeny Revision r1.9 - 13 Aug 2002 - 16:46 GMT - PeterThoeny |
Copyright © 1999-2003 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback. |