Operators

The following infield: operators are available:

  • Empty (no operator)

    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.

    • Example: infield:LastName

      This will match where LastName is non-empty.

    • Example: infield:Price

      This will match where Price is non-zero.

  • Equality: (=, !=)

    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.

    • Example: infield:LastName=Smith

      This will match where LastName is set to Smith.

    • Example: infield:dataType=12

      This will match where dataTypeis set to 12.

    • Example: 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.

    • Example: infield:colorSet!=black

      This will match any result that does not contain black in its set of colors.

  • Comparison: (<, <=, >=, >)

    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.

    • Example: infield:Price>100

      This will match if the Price value is greater than 100.

    • Example: infield:LastName>=Smith

      This will match any record whose LastName is Smith, or occurs alphabetically after Smith.

    • Example: infield:PublishDate<2008-01-01

      This will match any record whose PublishDate is before 2008.

  • Range: : (colon)

    Supported types: All except Set and Enum

    A range of values may be searched for with the : operator. A lower and upper bound are specified, separated by ".." (two periods). The query will match fields whose value is greater than or equal to the lower (first) bound, and less than or equal to the upper (second) bound. (Specifying an upper bound less than than the lower bound is not currently supported.) One of the bounds may be left empty to make the range open-ended on that side.

    • Example: infield:Quantity:50..75

      This will match Quantity values from 50 to 75, inclusive.

    • Example: infield:Quantity:..60

      This will match Quantity values less than or equal to 60.

    By default, both the lower and upper bound are included in the range. This may be changed by adding a square bracket for inclusivity, or a curly brace for exclusivity. E.g. the range "{50..60]" does not include 50, but does include 60.

    Note that using a range search on an Enum field may not work, as the underlying Enum Int values must be searched - and their ordering may differ from the dictionary ordering of the given Enum tokens.

    For GMLPoint fields, the range syntax operates somewhat differently - two- instead of one-dimensionally. Each bound is instead a comma-separated latitude/longitude pair (standard GMLPoint syntax, here). Both "bound" pairs are required; together they define a rectangular box, with due-north-south/east-west sides, with the "bound" pairs as diagonally-opposite corners. The query will match all points that lie inside or on the box.

    • Example: 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.

  • Intersects: ( (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.

    • Example: infield:LastName(Smith,Johnson)

      This will match results whose LastName is either Smith or Johnson.

    • Example: infield:ColorSet(red,green,blue)

      This will match if the any of the result's ColorSet values are red, green or blue.

  • TextSearch: ~ (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.

    • Example: infield:Subject˜climbing

      This will match if the Subject field contains the word "climbing" (even if other words are present).

    • Example: infield:enc:Subject˜mountain%20climbing

      This will match if the Subject field contains the both words "mountain" and "climbing" anywhere in any order.

    • Example: infield:enc:Subject˜%22mountain%20climbing%22

      This will match if the Subject field contains the phrase "mountain climbing".

  • Match: % (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.

    • Example: infield:Color%p??k

      This will match if the Color field is exactly equal to "pink", "pork", "peak" etc.

    • Example: infield:Color%por*

      This will match if the Color field is exactly equal to "pork", "portability", etc.


Copyright © Thunderstone Software     Last updated: Nov 8 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.