{
  "openapi": "3.0.1",
  "info": {
    "title": "Search Extensions Service",
    "description": "Search-Extensions service that provides a set of APIs to search records\nagainst Elasticsearch\n\n```plain {% title=\"Client ID\" %}\n963f2cc6915e479fa0fcb73ec2ec90e7\n```\n",
    "version": "1.0.0",
    "x-product-id": "OSDU-Search-Extensions-Service",
    "contact": {
      "name": "SLB Customer Support for Digital",
      "url": "https://customersupport.digital.slb.com"
    }
  },
  "servers": [
    {
      "url": "https://as5.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (SGP)"
    },
    {
      "url": "https://br5.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB SaaS OSDU (BRS)"
    },
    {
      "url": "https://eu5.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (WEU)"
    },
    {
      "url": "https://eu6.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB SaaS OSDU (EUT)"
    },
    {
      "url": "https://eu7.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (MDE)"
    },
    {
      "url": "https://us5.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (PSC)"
    },
    {
      "url": "https://us7.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (USC)"
    },
    {
      "url": "https://us8.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (WUS)"
    },
    {
      "url": "https://as6.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (SAS)"
    },
    {
      "url": "https://eu8.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (SWC)"
    },
    {
      "url": "https://as7.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (MYW)"
    },
    {
      "url": "https://za1.api.enterprisedata.slb.com/api/search-extensions/v1alpha",
      "description": "SLB Saas OSDU (ZAN)"
    }
  ],
  "tags": [
    {
      "name": "Search",
      "description": "Service endpoints to search data in Data Ecosystem"
    },
    {
      "name": "Aggregations",
      "description": "Advanced aggregation and analytics endpoints"
    },
    {
      "name": "Facets",
      "description": "Faceted search and filtering capabilities"
    },
    {
      "name": "Info",
      "description": "Build and git information"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/query": {
      "post": {
        "tags": [
          "Search"
        ],
        "summary": "Queries using the input request criteria.",
        "description": "<ul>\n  <li>The API supports full text search on string fields, range queries on date, numeric or string fields, along with geo-spatial search.</li>\n  <li>Required roles: ''users.datalake.viewers'' or ''users.datalake.editors'' or ''users.datalake.admins''. In addition, users must be a member of data groups to access the data.'</li>\n</ul>\n",
        "operationId": "Query",
        "x-badges": [
          {
            "name": "Beta",
            "position": "after",
            "color": "#8152CA"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "502": {
            "description": "Search service scale-up is taking longer than expected. Wait 10 seconds and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/query_with_cursor": {
      "post": {
        "tags": [
          "Search"
        ],
        "summary": "Queries using the input request criteria.",
        "description": "<ul>\n  <li>The API supports full text search on string fields, range queries on date, numeric or string fields, along with geo-spatial search.</li>\n  <li> It can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database.</li>\n  <li>Required roles: ''users.datalake.viewers'' or ''users.datalake.editors'' or ''users.datalake.admins''. In addition, users must be a member of data groups to access the data.'</li>\n</ul>\n",
        "operationId": "query_with_cursor",
        "x-badges": [
          {
            "name": "Beta",
            "position": "after",
            "color": "#8152CA"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CursorQueryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorQueryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "502": {
            "description": "Search service scale-up is taking longer than expected. Wait 10 seconds and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/aggregations": {
      "get": {
        "tags": [
          "Aggregations"
        ],
        "summary": "Execute aggregations via query parameters",
        "description": "<ul>\n  <li>Performs advanced aggregations on search results using query parameters and headers.</li>\n  <li>Required roles: ''users.datalake.viewers'' or ''users.datalake.editors'' or ''users.datalake.admins''. In addition, users must be a member of data groups to access the data.</li>\n</ul>\n",
        "operationId": "aggregations_get",
        "x-badges": [
          {
            "name": "Beta",
            "position": "after",
            "color": "#8152CA"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/kind"
          },
          {
            "name": "x-query",
            "in": "header",
            "required": true,
            "description": "The filter to limit what data the aggregation is performed against",
            "schema": {
              "type": "string"
            },
            "example": "*:*"
          },
          {
            "name": "x-aggregation",
            "in": "header",
            "required": true,
            "description": "The calculation/aggregation to perform on the data",
            "schema": {
              "type": "string"
            },
            "example": "{\"records_over_time\":{\"date_histogram\":{\"field\":\"index.lastUpdateTime\",\"calendar_interval\":\"1y\",\"format\":\"yyyy-MM-dd\"},\"aggs\":{\"status\":{\"terms\":{\"field\":\"index.statusCode\"}}}}}"
          },
          {
            "name": "x-spatial-filter",
            "in": "header",
            "required": false,
            "description": "The spatial filter to define the area of interest where data the aggregation is performed against",
            "schema": {
              "type": "string"
            },
            "example": "{\"field\":\"data.SpatialLocation.Wgs84Coordinates\",\"byBoundingBox\":{\"topLeft\":{\"latitude\":90,\"longitude\":-180},\"bottomRight\":{\"latitude\":-90,\"longitude\":180}}}"
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonNode"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "502": {
            "description": "Search service scale-up is taking longer than expected. Wait 10 seconds and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "Aggregations"
        ],
        "summary": "Execute complex aggregations",
        "description": "<ul>\n  <li>Performs advanced aggregations on search results with complex aggregation definitions.</li>\n  <li>Required roles: ''users.datalake.viewers'' or ''users.datalake.editors'' or ''users.datalake.admins''. In addition, users must be a member of data groups to access the data.</li>\n</ul>\n",
        "operationId": "aggregations_post",
        "x-badges": [
          {
            "name": "Beta",
            "position": "after",
            "color": "#8152CA"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AggregateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonNode"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "502": {
            "description": "Search service scale-up is taking longer than expected. Wait 10 seconds and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/facets": {
      "post": {
        "tags": [
          "Facets"
        ],
        "summary": "Execute faceted search queries",
        "description": "<ul>\n  <li>Performs faceted search operations including term facets, range facets, and statistical facets.</li>\n  <li>Required roles: ''users.datalake.viewers'' or ''users.datalake.editors'' or ''users.datalake.admins''. In addition, users must be a member of data groups to access the data.</li>\n</ul>\n",
        "operationId": "queryFacets",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "502": {
            "description": "Search service scale-up is taking longer than expected. Wait 10 seconds and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "deprecated": true
      }
    },
    "/coeus": {
      "get": {
        "tags": [
          "Aggregations"
        ],
        "summary": "Execute specialized aggregation queries",
        "description": "<ul>\n  <li>Performs specialized aggregation operations optimized for specific use cases.</li>\n  <li>Required roles: ''users.datalake.viewers'' or ''users.datalake.editors'' or ''users.datalake.admins''. In addition, users must be a member of data groups to access the data.</li>\n</ul>\n",
        "operationId": "coeus",
        "x-badges": [
          {
            "name": "Beta",
            "position": "after",
            "color": "#8152CA"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/kind"
          },
          {
            "name": "x-query",
            "in": "header",
            "description": "The query string in Lucene query string syntax",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "*:*"
          },
          {
            "name": "x-aggregation",
            "in": "header",
            "description": "JSON string defining the aggregation structure",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "{\"records_over_time\":{\"date_histogram\":{\"field\":\"index.lastUpdateTime\",\"calendar_interval\":\"1y\",\"format\":\"yyyy-MM-dd\"},\"aggs\":{\"status\":{\"terms\":{\"field\":\"index.statusCode\"}}}}}"
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AggregateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "423": {
            "description": "Feature is not enabled on this partition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "502": {
            "description": "Search service scale-up is taking longer than expected. Wait 10 seconds and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/info": {
      "get": {
        "tags": [
          "Info"
        ],
        "summary": "Version info",
        "description": "For deployment available public `/info` endpoint,  which provides build and git related information.",
        "operationId": "info",
        "x-badges": [
          {
            "name": "Beta",
            "position": "after",
            "color": "#8152CA"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionInfo"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "data-partition-id": {
        "name": "data-partition-id",
        "in": "header",
        "description": "Desired data partition id",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "kind": {
        "name": "kind",
        "in": "query",
        "description": "The kind of the record to aggregate",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "*:*:*:*"
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "User Token from SLB Authenticator Service"
      }
    },
    "schemas": {
      "AppError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "reason": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ByBoundingBox": {
        "required": [
          "bottomRight",
          "topLeft"
        ],
        "type": "object",
        "properties": {
          "topLeft": {
            "$ref": "#/components/schemas/Point"
          },
          "bottomRight": {
            "$ref": "#/components/schemas/Point"
          }
        }
      },
      "ByDistance": {
        "required": [
          "point"
        ],
        "type": "object",
        "properties": {
          "distance": {
            "maximum": 9223372036854776000,
            "type": "number",
            "format": "double",
            "example": 1500,
            "description": "The radius of the circle centered on the specified location. Points which fall into this circle are considered to be matches. The distance can be specified in various units."
          },
          "point": {
            "$ref": "#/components/schemas/Point"
          }
        },
        "example": {
          "point": {
            "latitude": 37.450727,
            "longitude": -122.174762
          },
          "distance": 1500
        }
      },
      "ByGeoPolygon": {
        "required": [
          "points"
        ],
        "type": "object",
        "properties": {
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            }
          }
        }
      },
      "ByIntersection": {
        "required": [
          "polygons"
        ],
        "type": "object",
        "properties": {
          "polygons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Polygon"
            }
          }
        }
      },
      "ByWithinPolygon": {
        "required": [
          "points"
        ],
        "type": "object",
        "properties": {
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            }
          }
        }
      },
      "FacetRequest": {
        "required": [
          "queryRequest"
        ],
        "type": "object",
        "properties": {
          "termFacets": {
            "maxItems": 1,
            "minItems": 0,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermFacetDefinition"
            }
          },
          "pagedFacets": {
            "maxItems": 1,
            "minItems": 0,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PagedFacetDefinition"
            }
          },
          "rangeFacets": {
            "maxItems": 1,
            "minItems": 0,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RangeFacetDefinition"
            }
          },
          "statisticsFacets": {
            "maxItems": 1,
            "minItems": 0,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatisticsFacetDefinition"
            }
          },
          "noValueFacets": {
            "maxItems": 1,
            "minItems": 0,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoValueFacetDefinition"
            }
          },
          "queryRequest": {
            "$ref": "#/components/schemas/QueryRequest"
          }
        }
      },
      "NoValueFacetDefinition": {
        "required": [
          "field",
          "fieldType"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "fieldType": {
            "type": "string",
            "enum": [
              "TEXT",
              "NUMBER",
              "DATE"
            ]
          }
        }
      },
      "PagedFacetDefinition": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "noValueBucket": {
            "type": "string"
          },
          "cursor": {
            "type": "string"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "Point": {
        "type": "object",
        "properties": {
          "latitude": {
            "maximum": 90,
            "minimum": -90,
            "type": "number",
            "format": "double",
            "example": 37.450727
          },
          "longitude": {
            "maximum": 360,
            "minimum": -360,
            "type": "number",
            "format": "double",
            "example": -122.174762
          }
        }
      },
      "Polygon": {
        "type": "object",
        "properties": {
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            }
          }
        }
      },
      "QueryRequest": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "oneOf": [
              {
                "type": "string",
                "description": "Specify a single kind, e.g., \"slb-osdu-prod-des-prod-testing:welldb:wellbore:1.0.0\"",
                "example": "slb-osdu-prod-des-prod-testing:welldb:wellbore:1.0.0"
              },
              {
                "type": "array",
                "description": "Specify an array of kinds, e.g., [\"kind1\", \"kind2\"]",
                "items": {
                  "type": "string"
                }
              }
            ],
            "example": "The kind of the record to query e.g. \"tenant1:test:well:1.0.0\" or [\"tenant1:test:well:1.0.0\", \"tenant1:test:well:2.0.0\"].",
            "description": "'kind' to search"
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "example": 30,
            "description": "The maximum number of results to return from the given offset. If no limit is provided, then it will return 10 items. Max number of items which can be fetched by the query is 1000. (If you wish to fetch large set of items, please use query_with_cursor API)",
            "minimum": 0,
            "maximum": 1000
          },
          "query": {
            "type": "string",
            "description": "The query string in Lucene query string syntax."
          },
          "returnedFields": {
            "type": "array",
            "description": "The fields on which to project the results.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "$ref": "#/components/schemas/SortQuery"
          },
          "queryAsOwner": {
            "type": "boolean",
            "example": false,
            "description": "The queryAsOwner switches between viewer and owner to return results that you are entitled to view or results you are the owner of."
          },
          "spatialFilter": {
            "$ref": "#/components/schemas/SpatialFilter"
          },
          "offset": {
            "type": "integer",
            "format": "int32",
            "example": 0,
            "description": "The starting offset from which to return results.",
            "minimum": 0
          }
        },
        "example": {
          "kind": "slb-osdu-prod-des-prod-testing:welldb:wellbore:1.0.0",
          "limit": 30,
          "query": "data.Basin:\"Ft. Worth\"",
          "returnedFields": [
            "data.kind"
          ],
          "queryAsOwner": false,
          "offset": 0
        }
      },
      "Range": {
        "type": "object",
        "properties": {
          "from": {
            "type": "number"
          },
          "to": {
            "type": "number"
          }
        }
      },
      "RangeFacetDefinition": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "generateBuckets": {
            "maximum": 50,
            "minimum": 0,
            "type": "integer",
            "format": "int32"
          },
          "buckets": {
            "maxItems": 50,
            "minItems": 0,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Range"
            }
          }
        }
      },
      "SortQuery": {
        "type": "object",
        "properties": {
          "field": {
            "type": "array",
            "example": [
              "index.lastUpdateTime",
              "data.name.keyword"
            ],
            "items": {
              "type": "string"
            }
          },
          "order": {
            "type": "array",
            "example": [
              "DESC",
              "ASC"
            ],
            "items": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          "filter": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "field": [
            "createTime"
          ],
          "order": [
            "DESC"
          ]
        }
      },
      "SpatialFilter": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "example": "data.SpatialLocation.Wgs84Coordinates",
            "description": "The geo-point field to filter on"
          },
          "byBoundingBox": {
            "$ref": "#/components/schemas/ByBoundingBox"
          },
          "byDistance": {
            "$ref": "#/components/schemas/ByDistance"
          },
          "byGeoPolygon": {
            "$ref": "#/components/schemas/ByGeoPolygon"
          },
          "byIntersection": {
            "$ref": "#/components/schemas/ByIntersection"
          },
          "byWithinPolygon": {
            "$ref": "#/components/schemas/ByWithinPolygon"
          }
        },
        "example": {
          "field": "data.SpatialLocation.Wgs84Coordinates",
          "byBoundingBox": {
            "topLeft": {
              "latitude": 90,
              "longitude": -180
            },
            "bottomRight": {
              "latitude": -90,
              "longitude": 180
            }
          }
        }
      },
      "StatisticsFacetDefinition": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          }
        }
      },
      "TermFacetDefinition": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "asKeyword": {
            "type": "boolean"
          },
          "noValueBucket": {
            "type": "string"
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          },
          "subTermFacet": {
            "$ref": "#/components/schemas/TermFacetDefinition"
          }
        }
      },
      "FacetResponse": {
        "type": "object",
        "properties": {
          "termFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermFacet"
            }
          },
          "pagedFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PagedFacet"
            }
          },
          "rangeFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RangeFacet"
            }
          },
          "statisticsFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatisticsFacet"
            }
          },
          "noValueFacets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NoValueFacet"
            }
          }
        }
      },
      "NoValueFacet": {
        "required": [
          "count",
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "count": {
            "minimum": 0,
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PagedFacet": {
        "required": [
          "buckets",
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "cursor": {
            "type": "string"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermBucket"
            }
          }
        }
      },
      "RangeBucket": {
        "required": [
          "count"
        ],
        "type": "object",
        "properties": {
          "range": {
            "$ref": "#/components/schemas/Range"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RangeFacet": {
        "required": [
          "buckets",
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RangeBucket"
            }
          }
        }
      },
      "StatisticsFacet": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "minimum": {
            "type": "number"
          },
          "maximum": {
            "type": "number"
          },
          "average": {
            "type": "number"
          }
        }
      },
      "TermBucket": {
        "required": [
          "count",
          "key"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "subTermBucket": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermBucket"
            }
          }
        }
      },
      "TermFacet": {
        "required": [
          "buckets"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermBucket"
            }
          },
          "otherCount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AggregateRequest": {
        "required": [
          "aggregations",
          "kind"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "example": "*:*:*:*",
            "description": "The kind(s) to perform the aggregation against. Use wildcards or specific kinds."
          },
          "query": {
            "type": "string",
            "example": "data.Basin:\"Ft. Worth\"",
            "description": "The query string in Lucene query string syntax to filter data"
          },
          "spatialFilter": {
            "$ref": "#/components/schemas/SpatialFilter"
          },
          "aggregations": {
            "type": "object",
            "additionalProperties": {
              "type": "object"
            },
            "example": {
              "records_over_time": {
                "date_histogram": {
                  "field": "index.lastUpdateTime",
                  "calendar_interval": "1y",
                  "format": "yyyy-MM-dd"
                },
                "aggs": {
                  "status": {
                    "terms": {
                      "field": "index.statusCode"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "QueryResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "aggregations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AggregationResponse"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CursorQueryResponse": {
        "type": "object",
        "properties": {
          "cursor": {
            "type": "string",
            "nullable": true
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AggregationResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CursorQueryRequest": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "oneOf": [
              {
                "type": "string",
                "description": "Specify a single kind, e.g., \"slb-osdu-prod-des-prod-testing:welldb:wellbore:1.0.0\"",
                "example": "slb-osdu-prod-des-prod-testing:welldb:wellbore:1.0.0"
              },
              {
                "type": "array",
                "description": "Specify an array of kinds, e.g., [\"kind1\", \"kind2\"]",
                "items": {
                  "type": "string"
                }
              }
            ],
            "example": "The kind of the record to query e.g. \"tenant1:test:well:1.0.0\" or [\"tenant1:test:well:1.0.0\", \"tenant1:test:well:2.0.0\"].",
            "description": "'kind' to search"
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "example": 30,
            "description": "The maximum number of results to return from the given offset. If no limit is provided, then it will return 10 items. Max number of items which can be fetched by the query is 1000.",
            "minimum": 0,
            "maximum": 1000
          },
          "query": {
            "type": "string",
            "description": "The query string in Lucene query string syntax."
          },
          "returnedFields": {
            "type": "array",
            "description": "The fields on which to project the results.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "$ref": "#/components/schemas/SortQuery"
          },
          "queryAsOwner": {
            "type": "boolean",
            "example": false,
            "description": "The queryAsOwner switches between viewer and owner to return results that you are entitled to view or results you are the owner of."
          },
          "spatialFilter": {
            "$ref": "#/components/schemas/SpatialFilter"
          },
          "cursor": {
            "type": "string",
            "description": "Search context to retrieve next batch of results."
          }
        },
        "example": {
          "kind": "slb-osdu-prod-des-prod-testing:welldb:wellbore:1.0.0",
          "limit": 30,
          "query": "data.Basin:\"Ft. Worth\"",
          "returnedFields": [
            "data.kind"
          ],
          "queryAsOwner": false,
          "cursor": "<put a valid cursor or leave it blank for the first request>"
        }
      },
      "VersionInfo": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "description": "Maven artifact group ID."
          },
          "artifactId": {
            "type": "string",
            "description": "Maven artifact ID."
          },
          "version": {
            "type": "string",
            "description": "Maven artifact version"
          },
          "buildTime": {
            "type": "string",
            "description": "Maven artifact build time"
          },
          "branch": {
            "type": "string",
            "nullable": true,
            "description": "Current git branch"
          },
          "commitId": {
            "type": "string",
            "nullable": true,
            "description": "Latest commit hash"
          },
          "commitMessage": {
            "type": "string",
            "nullable": true,
            "description": "Latest commit message"
          },
          "connectedOuterServices": {
            "type": "array",
            "description": "Connected outer services information",
            "items": {
              "$ref": "#/components/schemas/ConnectedOuterService"
            }
          }
        },
        "description": "Version info."
      },
      "ConnectedOuterService": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Connected outer service name."
          },
          "version": {
            "type": "string",
            "description": "Connected outer service version."
          }
        },
        "description": "Connected outer service information."
      },
      "JsonNode": {
        "type": "object",
        "description": "Dynamic JSON response containing aggregation results in Elasticsearch format",
        "additionalProperties": true,
        "example": {
          "records_over_time": {
            "buckets": [
              {
                "key_as_string": "2021-01-01",
                "key": 1609459200000,
                "doc_count": 18259561,
                "status": {
                  "doc_count_error_upper_bound": 0,
                  "sum_other_doc_count": 0,
                  "buckets": [
                    {
                      "key": 400,
                      "doc_count": 17764002
                    },
                    {
                      "key": 200,
                      "doc_count": 332976
                    }
                  ]
                }
              }
            ]
          }
        }
      },
      "AggregateResponse": {
        "type": "object",
        "properties": {
          "aggregateResults": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "object"
              }
            }
          }
        }
      }
    }
  }
}