Модуль поиска по единому индексу справочников

Модуль предоставляет REST API для модуля org.unidata.dg.data для поиска по единому индексу справочников.

Поиск по справочникам

Endpoint: POST /universe-backend/api/v2/search

Запрос идентичен стандартному поисковому, но "searchDataType": "LOOKUP":

{
"payload": {
    "org.unidata.dg.rest.v1.lookup": {
    ...
    "searchDataType": "LOOKUP",
    ...
    }

Поиск по атрибуту справочника должен быть сформирован как "имя_справочника#имя_атрибута".

Отличия api от стандартного поиска:

  • entity - имя справочника. Допустимые значения: имя справочника или "" (при "" - поиск осуществляется по всем справочникам).

  • aggregations - агрегация результатов поиска по типу актива.

  • hierarchical - поиск не поддерживает Supplementary запросы, поле ни на что не влияет.

  • supplementary - удалено.

  • supplementaryGroups - удалено.

Пример запроса:

{
    "payload": {
        "org.unidata.dg.rest.v1.lookup": {
        "drafts": false,
        "countOnly": false,
        "totalCount": true,
            "aggregations": [
            {
            "aggregationType": "term",
            "aggregationName": "type_name_aggregation",
            "path": "$type_name",
            "size": 10
            }

        ],
        "returnFields": [
            "loo1#str", "loo1#id", "source#str"
        ],
        "searchFields": [
            "loo1#str", "loo1#id", "source#str"
        ],
        "fetchAll": false,
        "entity": "",
        "returnAllFields": false,
        "searchAllFields": false,
        "searchDataType": "LOOKUP",
        "formFields": [

        ],
        "page": 1,
        "count": 10,
        "sortFields": []
        }
    }
}
Пример ответа
{
"details": {
    "info": [],
    "warning": [],
    "error": []
},
"payload": {
    "org.unidata.dg.rest.v1.lookup": {
    "fields": [
        "$deleted",
        "loo1#str",
        "source#str",
        "loo1#id",
        "$type_name",
        "$etalon_id"
    ],
    "hits": [
        {
        "id": "4af20b68-444a-11ef-a028-23615e2adf8e",
        "score": 1.0,
        "status": null,
        "preview": [
            {
            "field": "loo1#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "loo1#id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "source#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "$deleted",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                false
            ],
            "extendedValues": [
                {
                "value": false,
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$etalon_id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "4af20b68-444a-11ef-a028-23615e2adf8e"
            ],
            "extendedValues": [
                {
                "value": "4af20b68-444a-11ef-a028-23615e2adf8e",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$type_name",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "source_2"
            ],
            "extendedValues": [
                {
                "value": "source_2",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            }
        ],
        "source": null
        },
        {
        "id": "424a50d2-444a-11ef-a028-23615e2adf8e",
        "score": 1.0,
        "status": null,
        "preview": [
            {
            "field": "loo1#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "loo1#id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "source#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "ss"
            ],
            "extendedValues": [
                {
                "value": "ss",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$deleted",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                false
            ],
            "extendedValues": [
                {
                "value": false,
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$etalon_id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "424a50d2-444a-11ef-a028-23615e2adf8e"
            ],
            "extendedValues": [
                {
                "value": "424a50d2-444a-11ef-a028-23615e2adf8e",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$type_name",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "source"
            ],
            "extendedValues": [
                {
                "value": "source",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            }
        ],
        "source": null
        },
        {
        "id": "26a35a9b-441b-11ef-9259-23615e2adf8e",
        "score": 1.0,
        "status": null,
        "preview": [
            {
            "field": "loo1#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "44"
            ],
            "extendedValues": [
                {
                "value": "44",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "loo1#id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "4"
            ],
            "extendedValues": [
                {
                "value": "4",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "source#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "$deleted",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                false
            ],
            "extendedValues": [
                {
                "value": false,
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$etalon_id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "26a35a9b-441b-11ef-9259-23615e2adf8e"
            ],
            "extendedValues": [
                {
                "value": "26a35a9b-441b-11ef-9259-23615e2adf8e",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$type_name",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "loo1"
            ],
            "extendedValues": [
                {
                "value": "loo1",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            }
        ],
        "source": null
        },
        {
        "id": "ebf603f7-3d3e-11ef-9b2a-23615e2adf8e",
        "score": 1.0,
        "status": null,
        "preview": [
            {
            "field": "loo1#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "z"
            ],
            "extendedValues": [
                {
                "value": "z",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "loo1#id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "zero"
            ],
            "extendedValues": [
                {
                "value": "zero",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "source#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "$deleted",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                false
            ],
            "extendedValues": [
                {
                "value": false,
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$etalon_id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "ebf603f7-3d3e-11ef-9b2a-23615e2adf8e"
            ],
            "extendedValues": [
                {
                "value": "ebf603f7-3d3e-11ef-9b2a-23615e2adf8e",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$type_name",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "loo1"
            ],
            "extendedValues": [
                {
                "value": "loo1",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            }
        ],
        "source": null
        },
        {
        "id": "08fc05c4-3a00-11ef-a8cf-23615e2adf8e",
        "score": 1.0,
        "status": null,
        "preview": [
            {
            "field": "loo1#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "2"
            ],
            "extendedValues": [
                {
                "value": "2",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "loo1#id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "2"
            ],
            "extendedValues": [
                {
                "value": "2",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "source#str",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [],
            "extendedValues": null,
            "complexValues": null
            },
            {
            "field": "$deleted",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                false
            ],
            "extendedValues": [
                {
                "value": false,
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$etalon_id",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "08fc05c4-3a00-11ef-a8cf-23615e2adf8e"
            ],
            "extendedValues": [
                {
                "value": "08fc05c4-3a00-11ef-a8cf-23615e2adf8e",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            },
            {
            "field": "$type_name",
            "fieldDisplayName": null,
            "fieldValueType": null,
            "values": [
                "loo1"
            ],
            "extendedValues": [
                {
                "value": "loo1",
                "displayValue": null,
                "linkedEtalonId": null,
                "linkedTypeName": null
                }
            ],
            "complexValues": null
            }
        ],
        "source": null
        }
    ],
    "totalCount": 5,
    "totalCountLimit": 200000,
    "hasRecords": false,
    "maxScore": 1.0,
    "aggregations": [
        {
        "aggregationName": "type_name_aggregation",
        "aggregationType": "TERM",
        "documentsCount": 11,
        "countMap": {
            "source_2": 1,
            "loo1": 8,
            "source": 2
        }
        }
    ]
    }
}
}