# Execute a complex search query

Executes a search query and returns the search results. Use POST when the query parameters exceed the URL length limitations. Parameters are passed in a resource instead of URL arguments.

Endpoint: POST /api/search
Version: v1.0
Security: OAuth2.0

## Security:

  - `OAuth2.0` (unknown)
    oauth2

## Request body:

  - `application/json-patch+json, application/json, text/json, application/*+json` (unknown)
    Resource containing all the parameters needed for a search.

## Request fields (application/json-patch+json):

  - `query` (string)
    This parameter is generated automatically by Content Hub and contains the information required to restore a search state. Do not create or modify it manually.

  - `skip` (integer)
    The number of results to skip, for example, `0`.

  - `take` (integer)
    The number of results to return, for example, `10`.

  - `filters` (array)
    The filters to apply to the search query. Each filter is a `FieldFilterRequestResource` object.

  - `filters.name` (string)

  - `filters.definition` (string)

  - `filters.group_identifier` (string)

  - `filters.operator` (string)
    Enum: "None", "Equals", "LessThan", "GreaterThan", "Between", "StartsWith", "EndsWith", "Contains", "FacetEquals", "DoesNotContain", "DoesNotStartWith", "DoesNotEndWith", "LessThanOrEquals", "GreaterThanOrEquals", "DoesNotEqual", "AnyOf", "AllOf", "NoneOf", "Missing", "Exists", "Changed"

  - `filters.values` (array)

  - `filters.nested_values` (array)

  - `filters.hidden` (boolean)

  - `filters.type` (string)
    Enum: "FieldFilter", "InFilter", "DynamicFilter", "Nested", "IdFilter", "SelectionPoolFilter"

  - `filters.role` (string)

  - `filters.visible` (boolean)

  - `filters.multi_select` (boolean)

  - `filters.selection_pool_specs` (object)

  - `filters.selection_pool_specs.pool_id` (integer)

  - `filters.selection_pool_specs.sub_pool_id` (integer)

  - `sorting` (object)

  - `sorting.field` (string)

  - `sorting.asc` (boolean)

  - `aggregations` (array)
    The aggregations to apply to the search query. Each aggregation is an `AggregationRequestResource` object.

  - `aggregations.name` (string)

  - `aggregations.field` (string)

  - `aggregations.size` (integer)

  - `aggregations.datasource` (string)

  - `aggregations.children` (array)

  - `aggregations.metric_option` (object)

  - `aggregations.metric_option.name` (string)

  - `aggregations.metric_option.type` (string)

  - `aggregations.metric_option.field` (string)

  - `aggregations.type` (string)
    Enum: "Term", "Metric", "Date"

  - `aggregations.interval` (string)
    Enum: "second", "minute", "hour", "day", "week", "month", "quarter", "year"

  - `aggregations.format` (string)

  - `aggregations.include_missing` (boolean)

  - `fulltext` (array)
    The full-text search terms to apply to the query. This is an array of strings, where each string is a term to search for.

  - `fields` (array)
    The fields to include in the search results. This is an array of strings, where each string is a field name.

  - `culture` (string)
    The culture to use for the search, for example, `en-US` or `fr-FR`.

  - `view` (string)
    The view to use for the search (that is, the view name).

  - `component` (integer)
    The component ID to use for the search, for example, `1`.

  - `logical_grouping_template` (string)
    The logical grouping template to use for the search.

  - `defaults` (string)
    The default values to use for the search.

  - `configuration_category` (string)
    The configuration category to use for the search.

  - `customSorting` (object)
    Custom sorting options for the search. This is an object where keys are field names and values are integers representing the sort order.

  - `saved_selection` (integer)
    The ID of a saved selection to use for the search.

  - `calendarStartDate` (string)
    The start date for the calendar filter. This is a string in date-time format, for example, `2023-01-01T00:00:00Z`.

  - `calendarStopDate` (string)
    The stop date for the calendar filter. This is a string in date-time format, for example, `2023-12-31T23:59:59Z`.

  - `selection_pool` (object)

  - `selection_pool.selection_pool` (string)

  - `selection_pool.sub_pool_id` (integer)

  - `selection_pool.definitions` (array)

  - `nested_relations` (array)
    The nested relations to include in the search. Each item is a `NestedRelationInfo` object that specifies the relation, role, and properties to include.

  - `nested_relations.relation` (string)

  - `nested_relations.role` (string)
    Enum: "Parent", "Child"

  - `nested_relations.properties` (array)

  - `nested_relations.renditions` (array)

  - `nested_relations.limit` (integer)

  - `group` (object)

  - `group.row` (string)

  - `group.column` (string)

  - `group.rowDefinitionId` (integer)

  - `group.columnDefinitionId` (integer)

  - `group.result_count` (integer)

  - `is_initial_request` (boolean)
    Indicates whether this is the initial request for the search. This is a boolean value, where `true` means it is the initial request and `false` means it is a subsequent request.

  - `take_user_settings` (boolean)
    Indicates whether to take user settings into account for the search. This is a boolean value, where `true` means user settings are taken into account and `false` means they are not.

  - `l10n` (boolean)
    Indicates whether to use localization for the search. This is a boolean value, where `true` means localization is used and `false` means it is not.

  - `visualSearch` (object)

  - `visualSearch.image` (string)

  - `visualSearch.color` (string)

  - `visualSearch.text` (string)

  - `visualSearch.type` (string)
    Enum: "vector", "vector+text", "text", "vectorAndText", "vectorOrText"

  - `visualSearch.imageEntityId` (integer)

  - `visualSearch.IsDeepSearch` (boolean)

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

  - `self` (object)
    Represents a link to a resource.

  - `self.href` (string)
    Gets or sets the URI that points to the resource this link refers to.

  - `self.filename_properties` (array)
    Gets or sets the URI that points to the resource this link refers to.

  - `self.title` (string)
    Gets or sets the title that describes this link.

  - `self.templated` (boolean)
    Gets or sets a value indicating whether the contained URI is a template.

## Response 400:

  - `400` (unknown)
    Request is not valid

## Response 401:

  - `401` (unknown)
    Unauthorized request or invalid access token

