External Search Service

Indico provides several powerful features for aggregation and filtering when combined with an external search service supporting them, such as Citadel.

Aggregations

Aggregations, as seen in Elastic Search, provide a way to combine information in groups according to a certain metric, such as a field value, sum or average.

../../_images/search_features_aggregation.png

Indico supports any bucket or metric group, composed of a key, count and filter key:

class indico.modules.search.result_schemas.AggregationSchema

Represents an aggregation list.

buckets: list[BucketSchema]

A bucket list representing each group.

label: str

The name of the aggregation.

class indico.modules.search.result_schemas.BucketSchema

Represents an individual aggregation bucket element.

count: int

The number of elements.

filter: str

The key that identifies the element’s filter.

key: str

The aggregation key.

Filters

Filters act combined upon a certain aggregation on structured data. Consider the following bucket group composed of a single affiliation:

{
    "affiliation": {
        "label": "Affiliation",
        "buckets": {
            "key": "CERN",
            "count": 5,
            "filter": "cern"
        }
    }
}

The combination of key and filter from AggregationSchema can be used as a way to define a human-readable label to an attribute. A corresponding filter acting upon the same key in the example above would be affiliation=cern.

Placeholders

Placeholders are a special type of filters specifically designed to be part of the user-facing text based search query. Examples of valid placeholders would be: affiliation:CERN or person:”John Doe”.

../../_images/search_features_placeholders.png

Indico expects to receive a list of valid placeholders through get_placeholders() where each one will be merely hinted to the user while doing a text based search.

class indico.modules.search.base.IndicoSearchProvider
get_placeholders()

Retrieve the list of search shortcuts that will be shown to users when typing a search query.

Returns:

a list of SearchOption instances