An info block indexer is a Busby service that can index infoblocks from the stateStore, into Elasticsearch to enable quick and deep searching of an infoblock's contents. This service is kept up to date by the stateStore and is eventually consistent. This means that after an info block is added/updated in the stateStore, it will take a small amount of time to appear in Elasticsearch.
Elasticsearch 7 or higher is required on the hosts running the info block indexer service
From the Services tab on the left, add a new Info Block Indexer
On the info block indexer configuration page, fill out the following options:
Property | Description |
---|---|
Elasticsearch hosts | A list of Elasticsearch hosts to use |
Elasticsearch index | The name of the index that will be created in Elasticsearch |
Indexer Mode | Single will index a single info block by info type and sub type. Multiple allows multiple infoblocks to be indexed and gives additional options to incldue/exclude parts of the info block by key |
In the stateStore configuration, add a new indexer, then fill out the following options:
Property | Description |
---|---|
Indexer service name | The info block indexer (as shown above) |
Info block types to index | The info type and sub type (must be the same as the indexer configuration) and the workflow which the info blocks will be retrieved from |
Info block indexers are queried using Elasticsearch's querying language (see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html). As this is a backend service, it can be called from any other service on the bus using the search
ESB call, or from Busby scripts using the busby.stateStore.indexers
helper.
Message name: search
Params
{
"query": {
"query": {
"bool": {
"must": [
{
"match": {
"content.delivered": true
}
}
]
}
},
"size": 1000,
"sort": [
{
"indexTimestamp": {
"order": "desc"
}
}
]
}
}
Response
{
"stateStore": {
"inSync": true,
"heartbeat": "2022-10-06T13:02:19.100Z"
},
"took": 14,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": [
{
"_index": "delivery-info-index",
"_type": "_doc",
"_id": "b04c6e22-949f-4721-bdd5-f9e203c6eef2",
"_score": null,
"_source": {
"job": {
"workflow": "911c7b44-fcc3-4f19-b365-305bcb7e8e2b",
"internalRef": "Delivery_2022-09-26T13:05:34+01:00",
"externalRef": null,
"description": "Delivery",
"completeBy": "2022-10-30T00:00:00"
},
"indexTimestamp": "2022-10-06T13:00:44",
"content": {
"matId": "Test123",
"delivered": true
}
},
"sort": [
1665061244000
]
}
]
}
}
busby.stateStore.indexers.<infoBlockIndexerServiceName>.search(<params from above>)