JSON Search Parameters

Describes a set of complex search criteria broken into search, sorting and grouping rules. This structure is used specifically with the Entity service as input to the Find Data Entity resource method.

Search rules can be added to a search rules list and can be used to match data entities based on specific criteria. This rules list also specifies an operator which determines whether all rules or only one rule in the list is required to be matched.

Search rules can be based on data record values, data entity properties, finishing options, document length, template names and whether an entity's identifier is contained or not contained in a list of identifiers.

Rule groups can also be added to this search rules list, and each rule group contains it's own sub list of search rules and its' own rule operator. Rule groups can also be added to the search rule list of an existing rule group which allows for the construction of complex search criteria.

Sorting rules can be also added to a sort rules list and (depending on the data entity type) can be used to sort data entity entries in the search results by either data record values or data entity properties.

Every sort rule added will expand the value of the sort key of each entry listed in the resulting JSON Identifier Lists (with Sort Key) structure.

Grouping rules can be also added to a group rules list and (depending on the data entity type) can be used to group data entity entries in the search results by either data record values or data entity properties.

Every group rule added can expand the number of sub lists contained in the resulting JSON Identifier Lists (with Sort Key) structure.

Certain search, sorting or grouping rules can only be used with specific data entity types.

See the Finding Specific Data Entities in the Server page of the Working Examples section for further detail on the available rule combinations.

Structure

The structure consists of an object with the following name/value pairs:

  • entity – the data entity type (value of either DATARECORDS, DATASETS, CONTENTITEMS, CONTENTSETS, JOBS or JOBSETS) (type of string)

  • search – search criteria, consisting of an object with the following name/value pairs:

    • operator – the search rule operator for the base list of rules (value of either AND or OR) (type of string)

    • rules – a base list of search rules, consisting of an array of objects each with a specific rule sub-structure depending on the type of rule

  • sort – a list of sorting rules, consisting of an array of objects each with the following name/value pairs:

    • name – the name of the data value field or data entity property to sort by (type of string)

    • order – the order that matches to this rule are sorted by (value of either ASC or DESC) (type of string)

    • type – the type of sorting rule (value of either value or property) (type of string)


    Sorting rule objects with a type value of value also contain the following additional name/value pair:

    • numeric – whether the data value field is a of a numeric type (type of boolean)


  • group – a list of grouping rules, consisting of an array of objects each with the following name/value pairs:

    • name – the name of the data value field or data entity property to group by (type of string)

    • order – the order that matches to this rule are grouped by (value of either ASC or DESC) (type of string)

    • type – the type of grouping rule (value of either value or property) (type of string)


    Grouping rule objects with a type value of value also contain the following additional name/value pair:

    • numeric – whether the data value field is a of a numeric type (type of boolean)

The search rule sub-structure consists of an object with rule specific groupings of name/value pairs as follows.

    Search rule objects with a type value of value contain the following name/value pairs:

    • type – the type of search rule (value of value) (type of string)

    • name – the name of the data field (type of string)

    • value – the value of the data field (type of string, or array of strings when condition is value of either IN or NOT IN)

    • condition – the comparison condition (value of either EQUAL, NOTEQUAL, LESS, GREAT, LESSEQUAL, GREATEQUAL, STARTSWITH, ENDSWITH, CONTAINS, LIKE, NLIKE, IN or NOT IN) (type of string)


    Search rule objects with a type value of property contain the following name/value pairs:

    • type – the type of search rule (value of property) (type of string)

    • name – the name of the data entity property (type of string)

    • value – the value of the data entity property (type of string, or array of strings when condition is value of eitherIN or NOT IN)

    • condition – the comparison condition (value of either EQUAL, NOTEQUAL, LESS, GREAT, LESSEQUAL, GREATEQUAL, STARTSWITH, ENDSWITH, CONTAINS, LIKE, NLIKE, IN or NOT IN) (type of string)


    Search rule objects with a type value of either IN or NOT IN contain the following name/value pairs:

    • type – the type of search rule (value of either IN or NOT IN) (type of string)

    • identifiers – an array of data entity identifiers (type of number)


    Search rule objects with a type value of finishing contain only one of the following sub-groups of name/value pairs:

    • type – the type of search rule (value of finishing) (type of string)

    • medianame – the name of the media used (type of string)

    • condition – the comparison condition (value of either EQUAL or NOTEQUAL) (type of string)


    • type – the type of search rule (value of finishing) (type of string)

    • duplex – whether the page sheet is duplex (type of boolean)


    • type – the type of search rule (value of finishing) (type of string)

    • frontcoating – the front coating of the media used (value of either UNSPECIFIED, NONE, COATED, GLOSSY, HIGH_GLOSS, INKJET, MATTE, SATIN or SEMI_GLOSS) (type of string)

    • backcoating – the back coating of the media used (value of either UNSPECIFIED, NONE, COATED, GLOSSY, HIGH_GLOSS, INKJET, MATTE, SATIN or SEMI_GLOSS) (type of string)

    • condition – the comparison condition (value of either EQUAL or NOTEQUAL) (type of string)


    • type – the type of search rule (value of finishing) (type of string)

    • bindingstyle – the binding style of the media used (value of either NONE, DEFAULT, STAPLED, GLUED, STITCHED, ADHESIVE, SPINETAPING, RING, WIREDCOMB, PLASTICCOMB or COIL) (type of string)

    • bindingedge – the binding edge of the media used (value of either DEFAULT, LEFT, RIGHT, TOP or BOTTOM) (type of string)

    • bindingtype – the binding type of the media used (value of either DEFAULT, SADDLE, SIDE or CORNER) (type of string)

    • bindingangle – the binding angle of the media used (value of either DEFAULT, VERTICAL, HORIZONTAL or ANGLE) (type of string)

    • condition – the comparison condition (value of either EQUAL or NOTEQUAL) (type of string)


    Search rule objects with a type value of doclength contain the following name/value pairs:

    • type – the type of search rule (value of doclength) (type of string)

    • value – the number of pages in document (type of number)

    • condition – the comparison condition (value of either EQUAL, NOTEQUAL, LESS, GREAT, LESSEQUAL or GREATEQUAL) (type of string)


    Search rule objects with a type value of templatename contain the following name/value pairs:

    • type – the type of search rule (value of templatename) (type of string)

    • template – the name of the design template used for document (type of string)

    • condition – the comparison condition (value of either EQUAL or NOTEQUAL) (type of string)


    Search rule group objects contain the following name/value pairs:

    • operator – the search rule operator for sub-list of rules in rule group (value of either AND or OR) (type of string)

    • rules – a sub-list of search rules, consisting of an array of objects each with a certain rule sub-structure depending on the type of rule

Example

The following is an example of this structure:

{
    "entity": "CONTENTITEMS",
    "search": {
        "operator": "AND",
        "rules": [
            {
                "type": "value",
                "value": "FR",
                "name": "Country"
            },
            {
                "operator": "OR",
                "rules": [
                    {
                        "type": "finishing",
                        "frontcoating": "HIGH_GLOSS",
                        "backcoating": "HIGH_GLOSS",
                        "condition": "EQUAL"
                    },
                    {
                        "type": "finishing",
                        "bindingstyle": "DEFAULT",
                        "bindingedge": "DEFAULT",
                        "bindingtype": "DEFAULT",
                        "bindingangle": "VERTICAL",
                        "condition": "EQUAL"
                    }
                ]
            }
        ]
    },
    "sort": [
        {
            "name": "LastName",
            "order": "ASC",
            "numeric": false,
            "type": "value"
        }
    ],
    "group": [
        {
            "name": "Gender",
            "order": "ASC",
            "numeric": false,
            "type": "value"
        }
    ]
}