Skip to content

Similarity Manager

Description

A block of the Similarity Manager component performs maintenance operations on Elasticsearch indexes meant to manage the similarity use case.

Input

A Similarity Manager block has these input variables:

  • createRequest (object): parameters used when requestMode is CREATE.
    The object has only one property, similarityId (string) which is the rightmost part of the name of the index to create. The block creates the name of the index by concatenating a constant prefix, a dash and the value of similarityId.
    For example, is similarityId is astro8, the name of the index will be:

    prefix-astro8

  • deleteRequest (object): parameters used when requestMode is DELETE. The object has only one property, similarityIds (array) which is the list of indexes to delete. Each item is a string representing the rightmost part of the name of the index. The block determines the full name of the index by concatenating a constant prefix, a dash and the value of the array item.
    For example:

    "deleteRequest": {
        "similarityIds": ["astro2", "astro7"]
    }
    

    will determine the deletion of indexes:

    prefix-astro2

    and:

    prefix-astro7

  • mappingRequest (object): parameters used when requestMode is MAPPING. The object has only one property, similarityId (string) which is the rightmost part of the name of the index. For example, is similarityId is astro8, the name of the index will be:

    prefix-astro8

  • requestMode (object, required): maintenance operation, Can be:

    • LIST: to list existing indexes.
    • CREATE: to create an index using the parameters specified by createRequest.
    • DELETE: to delete one or more indexes using the parameters specified by deleteRequest.
    • MAPPING: to get the list of indexed fields using the parameters specified by mappingRequest.

Block properties

Block properties can be set by editing the block.
Similarity Manager workflow blocks have the following properties:

  • Basic properties:

    • Block name, it can be edited
    • Component version (read only)
    • Block ID (read only)
  • Functional:

    • Elasticsearch Timeout: maximum time, in milliseconds, the block waits a response from Elasticsearch before giving an error.
  • Deployment:

    • Timeout: execution timeout expressed in minutes (m) or seconds (s).
    • Replicas: number of required instances.
    • Memory: required memory.
    • CPU: thousandths of a CPU required (for example: 1000 = 1 CPU).
    • Consumer Number: number of threads of the consumer, the software module of the block that provides input to process by taking it from the block's work queue.
  • Input: input properties correspond to the input variables of the component (see above).

  • Output: read-only, the output manifest of the component.

Output

The output manifest of Similarity Manager is:

{
    "createResponse": {
        "message": "abc",
        "status": "abc"
    },
    "deleteResponse": {
        "message": "abc",
        "status": "abc"
    },
    "listResponse": {
        "indexlnfo": [
            {
                "docsCount": "abc",
                "health": "abc",
                "index": "abc",
                "status": "abc",
                "storeSize": "abc"
            },
            ...
        ],
        "message": "abc",
        "status": "abc"
    },
    "mappingResponse": {
        "fieldsList": [
            "abc",
            ...
        ],
        "message": "abc",
        "status": "abc"
    },
    "responseMode": "abc"
}

where:

  • createResponse is present only if input variable requestMode is CREATE.
  • deleteResponse is present only if input variable requestMode is DELETE.
  • listResponse is present only if input variable requestMode is LIST.
  • mappingResponse is present only if input variable requestMode is MAPPING.
  • status in listResponse, createResponse and deleteResponse is SUCCESS if the operation was successful or ERROR if the operation failed.
  • message in listResponse, createResponse and deleteResponse is a description of the outcome of the operation.
  • indexInfo contains an object for every index. Each object has these properties:

    • docsCount: number of indexed documents.
    • health: condition of the index. Value green means that the index is healthy, other values (yellow, red) indicate problems.
    • status: index status. Value open means that the index can be read and written, closed means that the index cannot be read or written.
    • storeSize: index size.
  • fieldsList contains an item for every field of the Elasticsearch index.

  • responseMode: operation type, correspond to the values of the requestMode input variable.