<<Previous: Using the infield: Syntax | ↑Up: Using the infield: Syntax | Next>>: Combined with Text Search |
The following infield: operators are available:
Supported types: All
Specifying no operator (and hence no value) after the field tests for "existence" of the field. For Text fields, the query will match non-empty values. For Integer and Numeric fields, the query will match non-zero values. For Set fields, the query will match non-empty (more than zero members) sets. For GMLPoint fields, the query will match valid (set) values.
This will match where LastName is non-empty.
This will match where Price is non-zero.
=
, !=
)
Supported types: All except GMLPoint
Equality operators can be used to test if contents are equal to (or not equal to) a given value. For Set fields, they check for membership (or non-membership) of the value in the set.
infield:LastName=Smith
This will match where LastName
is set to Smith
.
infield:dataType=12
This will match where dataTypeis set to 12
.
infield:colorSet=red
This will match any result that contained the color red
among its
set of color values, regardless of which other colors are present.
infield:colorSet!=black
This will match any result that does not contain black
in its
set of colors.
<
, <=
, >=
, >
)
Supported types: Text, Integer, Numeric, Date
Any of the relational operators may be used to search a field relative to a given value. Note that Text fields are related alphanumerically, which may cause confusion when searching for numeric data in them. E.g. a Text value of 67 is actually greater than 100. To avoid this issue, use an Integer or Numeric field when numeric data is searched for.
infield:Price>100
This will match if the Price value is greater than 100.
infield:LastName>=Smith
This will match any record whose LastName
is Smith
,
or occurs alphabetically after Smith
.
infield:PublishDate<2008-01-01
This will match any record whose PublishDate
is before 2008.
:
(colon)
Supported types: All except Set
and Enum
A range of values may be searched for with the :
operator.
Two values are specified, separated by ..
(two periods).
The query will match fields whose value is greater than or equal
to the first value, and less than or equal to the second value.
(Specifying a second value smaller than the first value is not
currently supported.) One of the values may be left empty to
make the range open-ended on that side.
infield:Quantity:50..75
This will match Quantity values from 50 to 75, inclusive.
infield:Quantity:..60
This will match Quantity values less than or equal to 60.
For GMLPoint fields, the range syntax operates differently. Each value is a comma-separated latitude/longitude pair (standard GMLPoint syntax, here). Both values are required; together the pair defines a rectangular box, with due-north-south/east-west sides, with the values as diagonally-opposite corners. The query will match all points that lie inside or on the box.
infield:Location:42.4N,88.15W..41.4N,87.15W
This will match Location points that are in a one-square-degree box around Chicago, IL.
(
(parentheses, must be closed)
Supported types: All except Date
and GMLPoint
A set of specific values may be given in a comma-separated list in parentheses. The query will match if the result's field is any one of the specified values. For Set values, the query will match if any of the given values is in the result's set.
infield:LastName(Smith,Johnson)
This will match results whose LastName
is either
Smith
or Johnson
.
infield:ColorSet(red,green,blue)
This will match if the any of the result's ColorSet values are red, green or blue.
~
(tilde)
Supported types: Text
The ~
operator text-searches the field. The Value is a Metamorph
query for the field, i.e. the same syntax as the main text keyword search.
The query is true if the Metamorph query matches. For non-trivial Metamorph
queries you'll need to use the "enc" option to infield; see below.
infield:Subject~climbing
This will match if the Subject field contains the word "climbing" (even if other words are present).
infield:enc:Subject~mountain%20climbing
This will match if the Subject field contains the both words "mountain" and "climbing" anywhere in any order.
infield:enc:Subject~%22mountain%20climbing%22
This will match if the Subject field contains the phrase "mountain climbing".
%
(percent)
Supported types: Text
The %
operator exact-character-matches the field, with
optional wildcards. The Value is a SQL MATCHES
query for the
field: the value must match the field character-for-character,
case-sensitively, for the result to match.
An asterisk (*
) character in the value is a wildcard, and matches any
number of (i.e. zero or more) characters. A question mark (?
)
character in the value matches exactly one character.
Added in scripts version
6.3.13.
Note: In version
6
of the Parametric Search Appliance, the wildcard operators were percent and underscore,
respectively.
infield:Color%p??k
This will match if the Color field is exactly equal to "pink", or "pork".
infield:Color%por*
This will match if the Color field is exactly equal to "pork", "portability", etc.
<<Previous: Using the infield: Syntax | ↑Up: Using the infield: Syntax | Next>>: Combined with Text Search |