name
- name of the topic
topictitle
- title of the topic
web
- name of the web the topic is within
text
- the body text of the topic
META:FILEATTACHMENT
arraysize
name
attr
path
size
user
rev
date
comment
META:TOPICPARENT
name
META:TOPICINFO
author
date
format
rev
- topic revision (12
) to match %REVINFO{'$rev'}%
and FormattedSearch $rev
version
- internal Store topic version (1.12
for rcs based Stores)
META:TOPICMOVED
by
date
from
to
META:FORM
- the main form of the topic name
(known as the formname)
META:FIELD
- the fields in the form. arraysize
name
title
value
META:PREFERENCE
arraysize
name
value
META:TOPICPARENT
, META:TOPICINFO
etc - are structures which are indexed by keys. For example, META:TOPICINFO
has 4 entries, which are indexed by the keys author
, date
, format
and version
. META:FILEATTACHMENT
, META:FIELD
and META:PREFERENCE
are all arrays, which means they can have any number of records under them. Arrays are indexed by numbers - for example, the first entry in the META:FIELD
array is entry 0. The field specifier arraysize
returns the number of items in an array, for example, attachments.arraysize
returns the number of attachments.
It's a bit clumsy having to type META:FILEATTACHMENT
every time you want to refer to the array of attachments in a topic, so there are some predefined aliases that make it a bit less typing: attachments
means the same as META:FILEATTACHMENT
info
means the same as META:TOPICINFO
parent
means the same as META:TOPICPARENT
moved
means the same as META:TOPICMOVED
form
means the same as META:FORM
fields
means the same as META:FIELD
, You can also use the name of the form (the value of form.name
e.g. PersonForm
)
preferences
means the same as META:PREFERENCE
|
|||||||||||||||||||
fields
shortcut when accessing form fields, but always use the name of the form instead.
There is a shortcut for accessing form fields. If you use the name of a field (for example, LastName
) in the query without a . before it, that is taken to mean "the value of the field named this". This works if and only if the field name isn't the same as of the top level entry names or their aliases described above. For example, the following expressions will all evaluate to the same thing: PersonForm[name='Lastname'].value
Lastname
PersonForm.Lastname
X
would conflict with the name of an entry or alias (e.g. it's moved
or maybe parent
), you can prepend the name of the form followed by a dot, as shown in the last example.
'%TOPIC%'
representing the current topic name.
|
|||||||||||||||||||||||||||||||
"attachments"
, then this will return TRUE for all topics that have one or more attachments. If I write "attachments[size>1024 AND name ~ '*.gif']"
then it will return TRUE for all topics that have at least one attachment larger than 1024 bytes with a name ending in .gif
.
Main.JohnSmith/UserForm.FirstName
because Main.JohnSmith
will be interpreted as a form field name. If you want to refer to topics you must enclose the topic name in single quotes i.e. 'Main.JohnSmith'/UserForm.FirstName
attachments[name='purdey.gif']
- true if there is an attachment call purdey.gif
on the topic
attachments[name~'*.gif'].arraysize > 3
- true if there are at least 4 .gif
files attached to the topic
(fields[name='Firstname'].value='Emma' OR fields[name='Firstname'].value='John') AND fields[name='Lastname'].value='Peel'
- true for 'Emma Peel' and 'John Peel' but not 'Robert Peel' or 'Emma Thompson'
(Firstname='Emma' OR Firstname='John') AND Lastname='Peel'
- shortcut form of the previous query
HistoryForm[name='Age'].value>2
- true if the topic has a HistoryForm
, and the form has a field called Age
with a value > 2
HistoryForm.Age > 2
- shortcut for the previous query
preferences[name='FaveColor' AND value='Tangerine']
- true if the topic has the given preference setting and value
Person/(ClothesForm[name='Headgear'].value ~ '*Bowler*' AND attachments[name~'*hat.gif' AND date < d2n('2007-01-01')])
- true if the form attached to the topic has a field called Person
that has a value that is the name of a topic, and that topic contains the form ClothesForm
, with a field called Headgear
, and the value of that field contains the string 'Bowler'
, and the topic also has at least one attachment that has a name matching *hat.gif
and a date before 1st Jan 2007. (Phew!)
%SEARCH{"parent.name = '%TOPIC%'" web="%WEB%" type="query"}%Find all topics that have an attachment called 'grunge.gif'
%SEARCH{"attachments[name='grunge.gif']" type="query"}%Find all topics that have form
ColorForm
where the form field 'Shades' is 'green' or 'yellow' but not 'brown'
%SEARCH{"(lc(Shades)='green' OR lc(Shades)='yellow') AND NOT(lc(Shades) ~ 'brown')" type="query"}%Find all topics that have PNG attachments that have been added since 26th March 2007
%SEARCH{"attachments[name ~ '*.png' AND date >= d2n('2007-03-26')]"}%Find all topics that have a field 'Threat' set to 'Amber' and 'cold virus' somewhere in the topic text.
%SEARCH{"Threat='Amber' AND text ~ '*cold virus*'"}%Related Topics: IfStatements, SearchHelp, VarIF, VarGET, VarSET, VarSEARCH, FormattedSearch, TWiki:TWiki.QuerySearchPatternCookbook
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.