Dropdown filters

Dropdown filters is a way to configure values that would easily be applied to the search you wanna do.

By default you will get a standard configuration containing of Category, Priority and Time frame. These will look like following image.

Configuration

[
    {
        "label": "Category",
        "property": "ArticleMetaCategories",
        "type": "multiselect",
        "target": "query",
        "width": 100,
        "items": [
            {
                "label": "Sports",
                "match": [
                    "sport*",
                    "hockey"
                ]
            },
            {
                "label": "Economy",
                "match": [
                    "economy",
                    "*business*"
                ]
            }
        ]
    },
    {
        "label": "Priority",
        "property": "ArticleMetaNewsValue",
        "type": "multiselect",
        "target": "query",
        "width": 50,
        "items": [
            {
                "label": "Prio 1",
                "match": 1
            },
            {
                "label": "Prio 2",
                "match": 2
            },
            {
                "label": "Prio 3",
                "match": 3
            },
            {
                "label": "Prio 4",
                "match": 4
            },
            {
                "label": "Prio 5",
                "match": 5
            }
        ]
    },
    {
        "label": "Time frame",
        "property": "ObjectUpdated",
        "type": "select",
        "target": "date",
        "width": 50,
        "items": [
            {
                "label": "48 hrs",
                "match": 2880
            },
            {
                "label": "24 hrs",
                "match": 1440
            },
            {
                "label": "8 hrs",
                "match": 480
            },
            {
                "label": "1 hrs",
                "match": 60
            }
        ]
    }
]

Key

Description

label

The label of the dropdown

property

The property to target in OpenContent

type

select or multiselect - which type of dropdown you want

target

query or date - depending on if the values should affect the date part of the search or the query

width

A value between 1-100, to determine how wide the input should be

items

Array of Objects

items.label

The label of the option value in the dropdown

items.match

integer, string, array - a value to match against

Match multiple terms

In the configuration above you can see that the Category has match as an array of strings. What these means is that you'll be able to target multiple terms. So following the example above, if the user would chose the category Economy this would result in a query trying to find wires with ArticleMetaCategories: ("economy" OR *business*)

Wildcards

In the example Match multiple terms we showcase the use of multiple terms in one query. What we can see in this example is that the query contains both a quoted term "economy" as well as *business*. The asterisks points that the term will match anything that contains the word business. This mean that you'll get a hit on wires containing the category "finance and business" as well as "business and stocks". These wildcards are only valid for queries targeting the "query" part, i.e. not the "date".

Example

Description

*sport*

Target everything that has the word sport

economy*

Target everything that begins with the word enconomy, i.e. "Economy and finances"

*finances

Target everything that ends with the word finances, i.e. "Stocks and finances"

te?t

Will swap out '?' to match any character. i.e "test" and "text" will get matched.

Date

The target date modifies the date part of the query. In the default configuration we specify some time frames that would allow for a narrower search. The time match value should be inputed in minutes. So 1 hour = 60 24 hours = 1440 7 days = 10080

You are able to have multiple date filters but these will be anded in the query. So we could say that the wire should be updated within the hour and needs to be created within 1 day.

[...]
{
    "label": "Updated",
    "property": "ObjectUpdated",
    "type": "select",
    "target": "date",
    "width": 50,
    "items": [
        {
            "label": "1 hrs",
            "match": 60
        }
    ]
},
{
    "label": "Created",
    "property": "ObjectCreated",
    "type": "select",
    "target": "date",
    "width": 50,
    "items": [
        {
            "label": "1 day",
            "match": 1440
        }
    ]
}
[...]