> ## Documentation Index
> Fetch the complete documentation index at: https://docs.repdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Elastic search for pattern

> # Description

Query text responses given a pattern and optional sentiment filters. Optionally find synonyms or antonyms.

# Payload

```json
{
    "projectId": string,
    "pattern": string,
    "questionId": [string],
    "wordType": string,
    "sentiment": [
        "vpos",
        "pos",
        "neu",
        "neg",
        "vneg"
    ],
    "conceptTestsDisplayed": array
}
```

where:

* `projectId`: unique identifier of the project. __(Required)__.
* `pattern`: term to query responses for. __(Required)__.
* `questionId`: single element array containing the unique identifier of the text question. __(Required)__.
* `wordType`: can be "none", "synonym", or "antonym". "none" searches for the provided pattern, "synonym" searches for synonyms of the pattern, and "antonym" searches for antonyms of the pattern. If not specified, this will be treated as "none". (Optional).
* `sentiment`: an array containing any of the following elements: "vpos", "pos", "neu", "neg", and "vneg". "vpos" is very positive, "pos" is positive, "neu" is neutral, "neg" is negative, and "vneg" is very negative. The service queries only responses with the selected sentiment parameters. __(Required)__.
* `conceptTestsDisplayed`: an array describing which responses within concept tests to query. (Optional).

# Responses

## 200 OK

```json
{
    "result": [
        {
            "matches": [
                "string"
            ],
            "fullText": "string",
            "sentiment": "string",
            "questionId": "string",
            "responseId": "string",
            "_score": "float"
        }
    ]
}
```
where:

* `result`: array of objects, where each object is of the following structure:
  - object:
    - `matches`: string array consisting of matches wrapped in html `<em>` tags.
    - `fullText`: full response text of the found match
    - `sentiment`: sentiment tag of the response of the found match (vpos, pos, neu, neg, vneg).
    - `questionId`: unique identifier of the text question.
    - `responseId`: unique identifier of the response of the found match.
    - `_score`: calculated score of the found match as a floating point number.

## 401 Unauthorized
> Invalid authorization.

## 500 Internal Server Error

> An error occurred processing the request. 

## 502 Bad Gateway
> Invalid or missing parameters, or other internal error.

# Description

Query text responses given a pattern and optional sentiment filters. Optionally find synonyms or antonyms.

# Payload

```json theme={null}
{
    "projectId": string,
    "pattern": string,
    "questionId": [string],
    "wordType": string,
    "sentiment": [
        "vpos",
        "pos",
        "neu",
        "neg",
        "vneg"
    ],
    "conceptTestsDisplayed": array
}
```

where:

* `projectId`: unique identifier of the project. **(Required)**.
* `pattern`: term to query responses for. **(Required)**.
* `questionId`: single element array containing the unique identifier of the text question. **(Required)**.
* `wordType`: can be "none", "synonym", or "antonym". "none" searches for the provided pattern, "synonym" searches for synonyms of the pattern, and "antonym" searches for antonyms of the pattern. If not specified, this will be treated as "none". (Optional).
* `sentiment`: an array containing any of the following elements: "vpos", "pos", "neu", "neg", and "vneg". "vpos" is very positive, "pos" is positive, "neu" is neutral, "neg" is negative, and "vneg" is very negative. The service queries only responses with the selected sentiment parameters. **(Required)**.
* `conceptTestsDisplayed`: an array describing which responses within concept tests to query. (Optional).

# Responses

## 200 OK

```json theme={null}
{
    "result": [
        {
            "matches": [
                "string"
            ],
            "fullText": "string",
            "sentiment": "string",
            "questionId": "string",
            "responseId": "string",
            "_score": "float"
        }
    ]
}
```

where:

* `result`: array of objects, where each object is of the following structure:
  * object:
    * `matches`: string array consisting of matches wrapped in html `<em>` tags.
    * `fullText`: full response text of the found match
    * `sentiment`: sentiment tag of the response of the found match (vpos, pos, neu, neg, vneg).
    * `questionId`: unique identifier of the text question.
    * `responseId`: unique identifier of the response of the found match.
    * `_score`: calculated score of the found match as a floating point number.

## 401 Unauthorized

> Invalid authorization.

## 500 Internal Server Error

> An error occurred processing the request.

## 502 Bad Gateway

> Invalid or missing parameters, or other internal error.


## OpenAPI

````yaml POST /elasticsearch-api/textSearch
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /elasticsearch-api/textSearch:
    post:
      summary: Elastic search for pattern
      description: >-
        # Description


        Query text responses given a pattern and optional sentiment filters.
        Optionally find synonyms or antonyms.


        # Payload


        ```json

        {
            "projectId": string,
            "pattern": string,
            "questionId": [string],
            "wordType": string,
            "sentiment": [
                "vpos",
                "pos",
                "neu",
                "neg",
                "vneg"
            ],
            "conceptTestsDisplayed": array
        }

        ```


        where:


        * `projectId`: unique identifier of the project. __(Required)__.

        * `pattern`: term to query responses for. __(Required)__.

        * `questionId`: single element array containing the unique identifier of
        the text question. __(Required)__.

        * `wordType`: can be "none", "synonym", or "antonym". "none" searches
        for the provided pattern, "synonym" searches for synonyms of the
        pattern, and "antonym" searches for antonyms of the pattern. If not
        specified, this will be treated as "none". (Optional).

        * `sentiment`: an array containing any of the following elements:
        "vpos", "pos", "neu", "neg", and "vneg". "vpos" is very positive, "pos"
        is positive, "neu" is neutral, "neg" is negative, and "vneg" is very
        negative. The service queries only responses with the selected sentiment
        parameters. __(Required)__.

        * `conceptTestsDisplayed`: an array describing which responses within
        concept tests to query. (Optional).


        # Responses


        ## 200 OK


        ```json

        {
            "result": [
                {
                    "matches": [
                        "string"
                    ],
                    "fullText": "string",
                    "sentiment": "string",
                    "questionId": "string",
                    "responseId": "string",
                    "_score": "float"
                }
            ]
        }

        ```

        where:


        * `result`: array of objects, where each object is of the following
        structure:
          - object:
            - `matches`: string array consisting of matches wrapped in html `<em>` tags.
            - `fullText`: full response text of the found match
            - `sentiment`: sentiment tag of the response of the found match (vpos, pos, neu, neg, vneg).
            - `questionId`: unique identifier of the text question.
            - `responseId`: unique identifier of the response of the found match.
            - `_score`: calculated score of the found match as a floating point number.

        ## 401 Unauthorized

        > Invalid authorization.


        ## 500 Internal Server Error


        > An error occurred processing the request. 


        ## 502 Bad Gateway

        > Invalid or missing parameters, or other internal error.
      operationId: elastic-search-for-pattern-post-elasticsearch-api-textsearch
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              projectId: '{{projectId}}'
              pattern: string
              questionId:
                - questionId
                - questionId2
              wordType: string
              sentiment:
                - vpos
                - pos
                - neu
                - neg
                - vneg
              conceptTestsDisplayed: []
      responses:
        '200':
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://elasticsearch-api.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````