1. Search resources

Filter

The Filter Resource is a json object that contains the information related to a filter. It is very similar to the facet value resource, with some adjustments, as follows:

NameTypeDescription
propertiesObjectA dictionary object containing the properties and values.
removeSearch LinkA hyperlink to the resource that represents the search with this filter removed. Note: if there are other filters depending on the respective filter, these will also be removed by clicking this link.
EntityLinkA hyperlink to the resource that represents the entity behind this filter value (if any)

Example of a Non-Ranged Filter Resource

{
    "properties": {
        "title": "display text/value for the filter value",
        "matches": 96,
        "identifier": "filter value identifier - could be Redis entity id or Redis definition name or solr field name",
        "operator": "filter operator",
        "positive": true if the filter is positive, false if it's negative,
        "type": "type of the solr field on which this filter is applied",
        "ranged": false
    },
    "remove": {
        "query": "myQueryWithThisFilterAndAllTheDependentFiltersRemoved",
        "href": "http://<hostname>/api/search?q=myQueryWithThisFilterAndAllTheDependentFiltersRemoved&skip=10&take=10"
    },
    "Entity": {
        "href": "http://<hostname>/api/entities/entityId"
    }
}

Example of a Ranged Filter Resource

{
    "properties": {
        "title1": "display text/value for the lower filter value",
        "identifier1": "identifier for the lower filter value",
        "title2": "display text/value for the higher filter value",
        "identifier2": "identifier for the higher filter value",
        "operator": "Between",
        "positive": true if the filter is positive, false if it's negative,
        "type": "type of the solr field on which this filter is applied",
        "ranged": true
    },
    "remove": {
        "query": "myQueryWithThisFilterAndAllTheDependentFiltersRemoved",
        "href": "http://<hostname>/api/search?q=myQueryWithThisFilterAndAllTheDependentFiltersRemoved&skip=10&take=10"
    },
    "Entity": null
}

Filter Operators

The filter operators is a set of values used to identify the operation desired as follows:

OpratorDescription
Equalswhen wanting perfect equality, unless the filter is a full-text filter, in which case use a "Contains" operator. This operator is used with non-ranged filters.
Containsthe filter value is contained by the field value. This is used for text filters, only with non-ranged filters.
StartWiththe field value starts with the filter value. This is used for text fields, only with non-ranged filters.
EndsWiththe field value ends with the filter value. This is used for text fields only with non-ranged filters.
LessThanthe filter value is smaller than the field value. This is used for date and number fields, only with non-ranged filters.
GreaterThanthe filter value is larger than the field value. This is used for date and number fields, only with non-ranged filters.
Betweenthe field value is between the 2 filter values. This is used for date and number fields, only with ranged filters.
If you have suggestions for improving this article, let us know!