---
schema_version: "1"
id: e3d97abc8fee4bc3d765cad37d79a00913a6996ff2acd5d5e86b89ca3da5bdfd
title: Data Job Execution Search (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-data-job-execution-search.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-job-execution-search
source_site: developer.salesforce.com
content_type: documentation
content_hash: cbb13a150d773848a80e289dfde17852abe3bc8dfd20ceb6c8c78d07f0e3a62e
products:
  - B2C Commerce
  - Salesforce APIs
---
Data Job Execution Search (deprecated)

# Data Job Execution Search (deprecated)

Data API endpoints enable developers to build applications for merchants: Create, update, delete business objects, like products, customers, pricing and promotions or assignments. They typically provide read and write access and are designed for moderate usage.

**Version:** 25.6

## Servers

*   `https://{host}/s/-/dw/data/v25_6`

Protocols: https.

## Security

*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### POST Search Job Executions

`POST /job_execution_search`

Operation ID: `Search Job Executions`. Tags: job\_execution\_search. Security: oauth2\_application.

Searches for job executions.

The query attribute specifies a complex query that can be used to narrow down the search. This is the list of searchable attributes:

*   id - String
    
*   job\_id - String
    
*   start\_time - Date
    
*   end\_time - Date
    
*   status - String
    

This is the list of sortable attributes:

*   job\_id - String
    
*   start\_time - Date
    
*   end\_time - Date
    
*   status - String
    

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `search_request`.

#### Responses

*   **default**
    
    Media type: `application/json, text/xml`. Schema: `job_execution_search_result`.
    

## Schemas

### search\_request

Document representing a search request for retrieving items within the Data API. The query is a potentially complex set of expressions. The fields that each query supports are defined within the search resource.

*   `count` (_integer (int32)_) The number of returned documents  
    Minimum: 1. Maximum: 200.
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling  
    Minimum: 0.
*   `expand` (_array of string_) List of expansions to be applied to each search results. Expands are optional
*   `query` (_query_, required) The query to apply
*   `select` (_string_) The field to be selected.
*   `sorts` (_array of sort_) The list of sort clauses configured for the search request. Sort clauses are optional.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.

### job\_execution\_search\_result

Document representing a job execution search result.

*   `count` (_integer (int32)_) The number of returned documents
*   `data` (_array of object_)
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling  
    Minimum: 0.
*   `expand` (_array of string_) List of expansions to be applied to each search results. Expands are optional
*   `hits` (_array of job\_execution_) The sorted array of search hits. May be empty.
*   `next` (_result\_page_) The data that can be used (as parameters on the search request) to retrieve the next result page.
*   `previous` (_result\_page_) The data that can be used (as parameters on the search request) to retrieve the previous result page.
*   `query` (_query_) The query passed into the search
*   `select` (_string_) The field to be selected.
*   `sorts` (_array of sort_) The list of sort clauses configured for the search request. Sort clauses are optional.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.
*   `total` (_integer (int32)_) The number of returned documents

_Example_

```
{
  "count": 3,
  "hits": [
    {
      "domain_names": [
        "Sites-Site",
        "Sites-SiteGenesis-Site"
      ],
      "duration": 3000,
      "end_time": "2015-12-16T09:49:11.905Z",
      "exit_status": {
        "code": "OK",
        "message": "OK",
        "status": "ok"
      },
      "id": "cdYS39aaabttcaaadpCLYBAOMV",
      "is_log_file_existing": true,
      "is_restart": true,
      "job_id": "ImportProducts_stg",
      "log_file_name": "Job-ImportProducts_stg@Sites-Site-20151216094909124.log",
      "modification_time": "2015-12-16T09:49:11.617Z",
      "start_time": "2015-12-16T09:49:08.905Z",
      "status": "finished"
    }
  ]
}
```

### query

Document representing a query. A query contains a set of objects that define criteria used to select records. A query can contain one of the following:

*   match\_all\_query - returns all records.
    
*   term\_query - matches records where a field (or fields) exactly match some simple value (including null).
    
*   text\_query - matches records where a field (or fields) contain a search phrase.
    
*   boolean\_query - formulates a complex boolean expression using query objects as criteria.
    
*   filtered\_query - allows for filtering of records based on both a query and a filter.
    

Type: `any`.

### sort

Document representing a sort request.

*   `field` (_string_, required) The name of the field to sort on.
*   `sort_order` (_string_) The sort order to be applied when sorting. When omitted, the default sort order (ASC) is used.  
    Allowed values: `asc`, `desc`.

_Example_

```
{
  "field": "id",
  "sort_order": "asc"
}
```

### job\_execution

*   `client_id` (_string_) When the execution was started by a client, this represents the client's id.
*   `continue_information` (_job\_execution\_continue\_information_) The continuation information of this execution if available.
*   `creation_date` (_string (date-time)_)
*   `duration` (_integer (int64)_) Time in milliseconds, the execution was or is running.
*   `effective_duration` (_integer (int64)_) Time in milliseconds, the job has done work. Paused times are evicted.
*   `end_time` (_string (date-time)_) Timestamp, when execution was finished.
*   `executed_server_id` (_string_) The ID of the server that executed the job.
*   `execution_scopes` (_array of string_) Sorted set of all execution scopes, used by individual steps.
*   `execution_status` (_string_) The current execution status.  
    Allowed values: `pending`, `running`, `pausing`, `paused`, `resuming`, `resumed`, `restarting`, `restarted`, `retrying`, `retried`, `aborting`, `aborted`, `finished`, `unknown`.
*   `exit_status` (_status_) The exit status of the execution, if the execution is in execution status 'finished', 'paused' or 'aborted' and is not executed currently anymore.
*   `id` (_string_) ID of the execution object.
*   `is_log_file_existing` (_boolean_) True if the log file exists, otherwise false.
*   `is_restart` (_boolean_) True if this execution represents a job restart.
*   `job_description` (_string_) Description of the job, this execution belongs to.
*   `job_id` (_string_) ID of the job, this execution belongs to.
*   `last_modified` (_string (date-time)_)
*   `log_file_path` (_string_) Full WebDAV path of the log file, containing execution log.
*   `modification_time` (_string (date-time)_) Timestamp of the last modification time for the execution.
*   `parameters` (_array of job\_execution\_parameter_) List of all job execution parameters.
*   `retry_information` (_job\_execution\_retry\_information_) The retry information of this execution if available.
*   `start_time` (_string (date-time)_) Timestamp, when execution was started.
*   `status` (_string_) The current status. If the execution is currently executed the execution status is returned. If the execution is not executed currently anymore the exit status code of the execution.
*   `status_metadata` (_status\_metadata_) The metadata of the status.
*   `step_executions` (_array of job\_step\_execution_) List of all steps, called for job execution.
*   `user_login` (_string_) When the execution was started by a registered user, this represents the user's login.

_Example_

```
{
  "client_id": "af7f5c90-ffc1-4ea4-9613-f5b375b7dc19",
  "duration": 185,
  "end_time": "2016-05-20T11:54:46.220Z",
  "execution_scopes": [
    "SiteGenesis",
    "SiteGenesis-US",
    "SiteGenesis-DE"
  ],
  "execution_status": "finished",
  "exit_status": {
    "code": "OK",
    "status": "ok"
  },
  "id": "90",
  "is_log_file_existing": true,
  "is_restart": false,
  "job_id": "CustomerImportJob",
  "log_file_name": "Job-JobExecutionTestJob1-20160520115446018.log",
  "modification_time": "2016-05-20T11:54:46.224Z",
  "start_time": "2016-05-20T11:54:46.035Z",
  "status": "OK",
  "step_executions": [
    {
      "duration": 16,
      "end_time": "2016-05-20T11:54:46.075Z",
      "execution_scope": "Organization",
      "execution_status": "finished",
      "exit_status": {
        "code": "OK",
        "message": "",
        "status": "ok"
      },
      "id": "41265",
      "modification_time": "2016-05-20T11:54:46.075Z",
      "start_time": "2016-05-20T11:54:46.059Z",
      "status": "OK",
      "step_description": "A step that executes a pipeline that can be configured via a parameter",
      "step_id": "Step1",
      "step_type_id": "ExecutePipeline",
      "step_type_info": "TestScheduleJobProcessPipeline-StartEnd"
    },
    {
      "duration": 12,
      "end_time": "2016-05-20T11:54:46.102Z",
      "execution_scope": "Organization",
      "execution_status": "finished",
      "exit_status": {
        "code": "OK",
        "message": "",
        "status": "ok"
      },
      "id": "41266",
      "modification_time": "2016-05-20T11:54:46.103Z",
      "start_time": "2016-05-20T11:54:46.090Z",
      "status": "OK",
      "step_description": "A step that executes a script module function that can be configured via a parameter",
      "step_id": "Step2",
      "step_type_id": "ExecuteScriptModule",
      "step_type_info": "testScriptModuleStep.ds#execute"
    },
    {
      "duration": 16,
      "end_time": "2016-05-20T11:54:46.132Z",
      "execution_scope": "SiteGenesis-DE",
      "execution_status": "finished",
      "exit_status": {
        "code": "OK",
        "message": "",
        "status": "ok"
      },
      "id": "41267",
      "include_steps_from_job_id": "JobExecutionTestJob2",
      "modification_time": "2016-05-20T11:54:46.132Z",
      "start_time": "2016-05-20T11:54:46.116Z",
      "status": "OK",
      "step_description": "A step that executes a pipeline that can be configured via a parameter",
      "step_id": "Step3 - Step1",
      "step_type_id": "ExecutePipeline",
      "step_type_info": "TestScheduleJobProcessPipeline-StartEnd"
    },
    {
      "duration": 14,
      "end_time": "2016-05-20T11:54:46.159Z",
      "execution_scope": "SiteGenesis-DE",
      "execution_status": "finished",
      "exit_status": {
        "code": "SUCCESS",
        "message": "Step was successful!",
        "status": "ok"
      },
      "id": "41268",
      "include_steps_from_job_id": "JobExecutionTestJob2",
      "modification_time": "2016-05-20T11:54:46.159Z",
      "start_time": "2016-05-20T11:54:46.145Z",
      "status": "SUCCESS",
      "step_description": "",
      "step_id": "Step3 - Step2",
      "step_type_id": "ExecuteScriptModule",
      "step_type_info": "testScriptModuleStep.ds#testReturnStatusOkWithCodeAndMessage"
    },
    {
      "duration": 15,
      "end_time": "2016-05-20T11:54:46.189Z",
      "execution_scope": "SiteGenesis",
      "execution_status": "finished",
      "exit_status": {
        "code": "OK",
        "message": "",
        "status": "ok"
      },
      "id": "41269",
      "include_steps_from_job_id": "JobExecutionTestJob2",
      "modification_time": "2016-05-20T11:54:46.189Z",
      "start_time": "2016-05-20T11:54:46.174Z",
      "status": "OK",
      "step_description": "A step that executes a pipeline that can be configured via a parameter",
      "step_id": "Step3 - Step1",
      "step_type_id": "ExecutePipeline",
      "step_type_info": "TestScheduleJobProcessPipeline-StartEnd"
    },
    {
      "duration": 13,
      "end_time": "2016-05-20T11:54:46.216Z",
      "execution_scope": "SiteGenesis",
      "execution_status": "finished",
      "exit_status": {
        "code": "SUCCESS",
        "message": "Step was successful!",
        "status": "ok"
      },
      "id": "41270",
      "include_steps_from_job_id": "JobExecutionTestJob2",
      "modification_time": "2016-05-20T11:54:46.216Z",
      "start_time": "2016-05-20T11:54:46.203Z",
      "status": "SUCCESS",
      "step_description": "",
      "step_id": "Step3 - Step2",
      "step_type_id": "ExecuteScriptModule",
      "step_type_info": "testScriptModuleStep.ds#testReturnStatusOkWithCodeAndMessage"
    }
  ]
}
```

### result\_page

Data that can be used to get the next and previous page of a Data API results object.

*   `count` (_integer (int32)_) The number of returned documents.
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.

### job\_execution\_continue\_information

Information for a job execution continuation.

*   `continue_status` (_string_) Returns the status, this job execution will get on continuation if continuation is pending.  
    Allowed values: `pending`, `running`, `pausing`, `paused`, `resuming`, `resumed`, `restarting`, `restarted`, `retrying`, `retried`, `aborting`, `aborted`, `aborting_for_restart`, `aborted_for_restart`, `finished`, `unknown`.
*   `is_pending` (_boolean_) Returns `true` if the continuation of this job execution is pending and will be started soon, `false` otherwise.

### status

*   `code` (_string_) Status code.
*   `message` (_string_) Status message.
*   `status` (_string_) Status shows successful operation end.  
    Allowed values: `ok`, `error`.

_Example_

```
{
  "code": "SUCCESS",
  "message": "Step was successful!",
  "status": "ok"
}
```

### job\_execution\_parameter

Specification of a parameter for a job execution.  
  
Request example to execute the job in all storefront sites:

POST /dw/data/v19\_10/jobs/CustomerImportJob/executions
Host: example.com
Authorization: Bearer af7f5c90-ffc1-4ea4-9613-f5b375b7dc19
Content-Type: application/json; charset=UTF-8
{
"parameters": \[
{
"name": "SiteScope",
"value": "{\\"all\_storefront\_sites\\":true}"
}
\]
}

  
Request example to execute the job in specified sites only:

POST /dw/data/v19\_10/jobs/CustomerImportJob/executions
Host: example.com
Authorization: Bearer af7f5c90-ffc1-4ea4-9613-f5b375b7dc19
Content-Type: application/json; charset=UTF-8
{
"parameters": \[
{
"name": "SiteScope",
"value": "{\\"named\_sites\\":\[\\"SiteGenesis\\", \\"SiteGenesisGlobal\\"\]}"
}
\]
}

*   `name` (_string_, required) The name of the parameter.  
    Minimum length: 1. Maximum length: 256. Pattern: \\S|(\\S(.\*)\\S).
*   `value` (_string_, required) The value of the parameter.  
    Maximum length: 1000. Pattern: \\S|(\\S(.\*)\\S).

### job\_execution\_retry\_information

Retry information for a previous **failed** job execution.

*   `current_retry_attempt` (_integer (int32)_) The current attempt to retry the previous **failed** job execution.
*   `max_retries` (_integer (int32)_) The maximum number of retries.

### status\_metadata

*   `client_id` (_string_) The client ID that is responsible for the status.
*   `reason` (_string_) The reason of the status.
*   `user_login` (_string_) The user login that is responsible for the status.

### job\_step\_execution

*   `chunk_size` (_integer (int32)_) The chunk size for a chunk oriented step execution, otherwise null.
*   `duration` (_integer (int64)_) Time in milliseconds, the execution was or is running.
*   `end_time` (_string (date-time)_) Timestamp, when execution was finished.
*   `execution_scope` (_string_) The ID of the scope this step is or was executed for.
*   `execution_status` (_string_)
    
    Current execution status of the step.
    
    *   'pending': Execution of the step been initiated but the step is not executing yet. Possible next status: 'running'.
        
    *   'running': The step is currently actively executed. Possible next status: 'finished', 'pausing' or 'aborted'.
        
    *   'finished': The step execution is finished and is not actively executed currently. Possible next status: none.
        
    *   'pausing': Pausing of a running step execution has been initiated but the step is not paused yet. Possible next status: 'paused' or 'aborted'.
        
    *   'paused': The step execution is paused and is not actively executed currently. Possible next status: 'pending'.
        
    *   'aborted': A running step execution has been aborted and is not actively executed currently. Possible next status: none.
        
    
      
    Allowed values: `pending`, `running`, `pausing`, `paused`, `resuming`, `resumed`, `restarting`, `restarted`, `retrying`, `retried`, `aborting`, `aborted`, `finished`, `unknown`.
*   `exit_status` (_status_) The exit status of the step execution, if the step execution is in execution status 'finished', 'paused' or 'aborted' and is not executed currently anymore.
*   `id` (_string_) ID of the execution object.
*   `include_steps_from_job_id` (_string_) ID of the job the step of this step execution was included from, if the step was included from another job.
*   `is_chunk_oriented` (_boolean_) True if this execution represents a chunk oriented step execution.
*   `item_filter_count` (_integer (int32)_) The current number of items that have been filtered for a chunk oriented step execution, otherwise null.
*   `item_write_count` (_integer (int32)_) The current number of items that have been written for a chunk oriented step execution, otherwise null.
*   `modification_time` (_string (date-time)_) Timestamp of the last modification time for the execution.
*   `start_time` (_string (date-time)_) Timestamp, when execution was started.
*   `status` (_string_) The current status. If the step execution is currently executed (execution status is one of 'pending', 'running', 'pausing') the execution status is returned. If the step execution is not executed currently anymore (execution status is one one 'finished', 'paused' or 'aborted') the exit status code of the step execution is returned.
*   `status_metadata` (_status\_metadata_) The metadata of the status.
*   `step_description` (_string_) Description of the step, this execution belongs to.ID of the step
*   `step_id` (_string_) ID of the step, this execution belongs to.ID of the step
*   `step_type_id` (_string_) ID of the step's type at the time it is or was executed.
*   `step_type_info` (_string_) Additional information regarding the step's type at the time it is or was executed (e.g. name of a script module and function).
*   `total_item_count` (_integer (int64)_) The total number of items that will be processed for a chunk oriented step execution (null if unknown), otherwise null.

_Example_

```
{
  "duration": 16,
  "end_time": "2016-05-20T11:54:46.075Z",
  "execution_scope": "Organization",
  "execution_status": "finished",
  "exit_status": {
    "code": "OK",
    "message": "",
    "status": "ok"
  },
  "id": "41265",
  "modification_time": "2016-05-20T11:54:46.075Z",
  "start_time": "2016-05-20T11:54:46.059Z",
  "status": "OK",
  "step_description": "A step that executes a pipeline that can be configured via a parameter",
  "step_id": "Step1",
  "step_type_id": "ExecutePipeline",
  "step_type_info": "TestScheduleJobProcessPipeline-StartEnd"
}
```

### bool\_filter

Document representing a boolean filter.

A boolean filter allows you to combine other filters into (possibly recursive) logical expression trees. A boolean filter is configured with a boolean operator (AND, OR, NOT) and a list of filters the operator relates to. If multiple filters are given to a boolean NOT operator, this is interpreted as a NOT upon a boolean OR of the given filters.

**Example:** (id="myId" AND coupon\_id="couponOne")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "and",
filters: \[
{ term\_filter: { field: "id", operator: "is", values: \["myId"\] } },
{ term\_filter: { field: "coupon\_id", operator: "is", values: \["couponOne"\] } }
\]
}
}
}
}

**Example:** (id="holidaySale" OR redemption\_count BETWEEN(1, 20)

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "or",
filters: \[
{ term\_filter: { field: "id", operator: "is", values: \["holidaySale"\] } },
{ range\_filter: { field: "redemption\_count", from: 1, to: 20 } }
\]
}
}
}
}

**Example:** NOT(enabled=false OR coupon\_id="special")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "not",
filters: \[
{ term\_filter: { field: "enabled", operator: "is", values: \[false\] } },
{ term\_filter: { field: "coupon\_id", operator: "is", values: \["special"\] } }
\]
}
}
}
}

*   `filters` (_array of filter_) A list of filters, which are logically combined by an operator.
*   `operator` (_string_, required) The logical operator the filters are combined with.  
    Allowed values: `and`, `or`, `not`.

### bool\_query

A boolean query allows construction of full logical expression trees consisting of other queries (usually term and text queries). A boolean query basically has 3 sets of clauses that 'must', 'should' and / or 'must not' match. If 'must', 'must\_not', or 'should' appear in the same boolean query, they are combined logically using the AND operator. The difference between must and should operators is that the must operator requires all subqueries to match whereas the should operator only requires one match

**Example:** (id = 'foo' AND description LIKE 'bar')

query: {
bool\_query: {
must: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** (id = 'foo' OR description LIKE 'bar')

query: {
bool\_query: {
should: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** (NOT (id = 'foo' AND description LIKE 'bar'))

query: {
bool\_query: {
must\_not: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** ((coupon\_id LIKE "limit" AND description LIKE "limit per customer") AND NOT (enabled=false))

query: {
bool\_query: {
must: \[
{ text\_query: { fields: \[ "coupon\_id" \], search\_phrase: "limit" } },
{ text\_query: { fields: \[ "description" \], search\_phrase: "limit per customer" } }
\],
must\_not: \[
{ term\_query: { fields: \[ "enabled" \], operator: "is", values: \[false\] } }
\]
}
}

*   `must` (_array of query_) List of queries that must match.
*   `must_not` (_array of query_) List of queries that must not match.
*   `should` (_array of query_) List of queries that should match (i.e., at least one query must match).

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### filter

Document representing a filter.

A filter contains a set of objects that define criteria used to select records. A filter can contain one of the following:

*   term\_filter - matches records where a field (or fields) exactly match some simple value (including null).
    
*   range\_filter - matches records where a field value lies in a specified range.
    
*   query\_filter - provides filtering based on a query.
    
*   bool\_filter - provides filtering of records using a set of filters combined with a specified operator.
    

Type: `any`.

### filtered\_query

A filtered query allows to filter the result of a (possibly complex) query using a (possibly complex) filter.

**Example:**

query : {
filtered\_query: {
query: {
text\_query: { fields: \["coupon\_id"\], search\_phrase: "disabled" }
},
filter: {
term\_filter: {
field: "enabled", operator: "is", values: \[ false \]
}
}
}
}

*   `filter` (_filter_, required) The (possibly complex) filter object.
*   `query` (_query_, required) The query object.

### match\_all\_query

A match all query simply matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints.

**Example:**

query: {
match\_all\_query: {}
}

Type: `any`.

### nested\_query

A nested query queries nested documents that are part of a larger document. The classical example is a product master with variants (in one big document) where you want to constrain a search to masters that have variants that match multiple constraints (like color = blue AND size = M). This query is not compatible with some search types. **Example:** finds all the documents that has firstname = "John" and lastname = "Doe"

{
"query": {
"bool\_query": {
"must": \[
{
"nested\_query": {
"path": "order.shipping\_addresses",
"query": {
"bool\_query": {
"must": \[
{
"bool\_query": {
"must": \[
{
"term\_query": {
"fields": \[ "order.shipping\_addresses.first\_name" \],
"operator": "is",
"values": \[ "John" \]
}
}
\]
}
},
{
"bool\_query": {
"must": \[
{
"term\_query": {
"fields": \[ "order.shipping\_addresses.last\_name" \],
"operator": "is",
"values": \[ "Doe" \]
}
}
\]
}
}
\]
}
},
"score\_mode": "avg"
}
}
\]
}
}
}

*   `path` (_string_, required)
*   `query` (_query_, required)
*   `score_mode` (_string_)  
    Allowed values: `avg`, `total`, `max`, `none`.

### query\_filter

Document representing a query filter. A query filter wraps any query and allows it to be used as a filter.

**Example:** (coupon\_id contains "disabled" AND (enabled=false OR active=false))

query : {
filtered\_query: {
query: { text\_query: { fields: \["coupon\_id"\], search\_phrase: "disabled" } },
filter: {
query\_filter: {
query: {
term\_query: { fields: \["enabled","active"\], operator: "is", values: \[ false \] }
}
}
}
}
}

*   `query` (_query_, required) The query to use as a filter.

### range2\_filter

Document representing a range comparison with a range filter, named Range2Filter.

A Range2Filter allows you to restrict a search result to hits where a range defined by specified attributes has a certain relationship to a specified range.

The first range (R1) is defined by a pair of attributes ("from\_field" and "to\_field") that specify the extent of a range, such as the attributes "valid\_from" and "valid\_to".

The second range (R2) is defined by "from\_value" and "to\_value".

The filter mode specifies the method used to compare the two ranges:

*   overlap: R1 overlaps fully or partially with R2
    
*   containing: R1 contains R2
    
*   contained: R1 is contained in R2
    

The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended (at one end only). You can configure whether the lower and upper bounds are inclusive or exclusive.

A range 2 filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.

**Example:** (valid dates overlap with the range January 1, 2007 through January 1, 2017)

"query" : {
"filtered\_query": {
"filter": {
"range2\_filter": {
"from\_field": "valid\_from",
"to\_field": "valid\_to",
"filter\_mode":"overlap",
"from\_value": "2007-01-01T00:00:00.000Z",
"to\_value": "2017-01-01T00:00:00.000Z"
}
},
"query": { "match\_all\_query": {} }
}
}

*   `filter_mode` (_string_) Compare mode: overlap, containing, or contained. If not specified, the default is overlap.  
    Allowed values: `overlap`, `containing`, `contained`.
*   `from_field` (_string_, required) The field name of the field that starts the first range.
*   `from_inclusive` (_boolean_) Indicates whether the lower bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `from_value` (_object_) The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
*   `to_field` (_string_, required) The field name of the field that ends the first range.
*   `to_inclusive` (_boolean_) Indicates whether the upper bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `to_value` (_object_) The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.

### range\_filter

Document representing a range filter.

A range filter allows you to restrict a search result to hits that have values for a given attribute that fall into a given value range. The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended (at one end only). You can configure whether the lower and upper bounds are inclusive or exclusive.

A range filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.

**Example:** ( redemption\_count BETWEEN (0,10\] )

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
range\_filter: {
field: "redemption\_count",
from: 0,
to: 10,
from\_inclusive: false
}
}
}
}

*   `field` (_string_, required) The search field.
*   `from` (_object_) The lower bound of the filter range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
*   `from_inclusive` (_boolean_) Indicates whether the lower bound of the range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `to` (_object_) The upper bound of the filter range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.
*   `to_inclusive` (_boolean_) Indicates whether the upper bound of the range is inclusive. If not specified, the default is true. Set to false to made the upper bound exclusive.

### term\_filter

Document representing a term filter.

A term filter allows you to restrict a search result to hits that match (exactly) one of the values configured for the filter. A term filter is useful for general restrictions that can be shared between searches. Use term filters whenever the criterion you filter on is a shared property of multiple searches (for example, like filtering by an order status). Use term filters for fields that have a discrete and small set of values only.

**Example:** (id="my\_id")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "id",
operator: "is",
values: \["my\_id"\]
}
}
}
}

**Example:** (id IN ("my\_id","other\_id"))

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "id",
operator: "one\_of",
values: \["my\_id","other\_id"\]
}
}
}
}

**Example:** (description=NULL)

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "description",
operator: "is\_null"
}
}
}
}

*   `field` (_string_, required) The filter field.
*   `operator` (_string_, required) The operator to compare the field's values with the given ones.  
    Allowed values: `is`, `one_of`, `is_null`, `is_not_null`, `less`, `greater`, `not_in`, `neq`.
*   `values` (_array of object_) The filter values.

### term\_query

A term query matches one (or more) value(s) against one (or more) document field(s). A document is considered a hit if one of the values matches (exactly) with at least one of the given fields. The operator "is" can only take one value, while "one\_of" can take multiple values. If multiple fields are specified, they are combined using the OR operator. The `less` and `greater` operators are not compatible with some search types. To query based on numeric bounds in those cases, you can use a range filter on a filtered query .

**Elastic only** : If used with multiple fields, the query is internally handled as a boolean OR of DisjointMaxQueries (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.

**Example:** (id="my\_id")

query: {
term\_query: {
fields: \["id"\],
operator: "is",
values: \["my\_id"\]
}
}

**Example:** (id IN ("my\_id","other\_id"))

query: {
term\_query: {
fields: \["id"\],
operator: "one\_of",
values: \["my\_id","other\_id"\]
}
}

**Example:** (id=null)

query: {
term\_query: {
fields: \["description"\],
operator: "is\_null"
}
}

**Example:** ((id IN ('generic', 'keyword')) OR (description IN ('generic', 'keyword'))

query: {
term\_query: {
fields: \["id", "description"\],
operator: "one\_of",
values: \["generic","keyword"\]
}
}

*   `fields` (_array of string_, required) The document field(s) the value(s) are matched against, combined with the operator.  
    Minimum items: 1.
*   `operator` (_string_, required) Returns the operator to use for the term query.  
    Allowed values: `is`, `one_of`, `is_null`, `is_not_null`, `less`, `greater`, `not_in`, `neq`.
*   `values` (_array of object_) The values the field(s) are compared against, combined with the operator.

### text\_query

A text query is used to match some text (i.e. a search phrase possibly consisting of multiple terms) against one or multiple fields. In case multiple fields are provided, the phrase conceptually forms a logical OR over the fields. In this case, the terms of the phrase basically have to match the text that would result from concatenating all given fields.

**Example:** (coupon\_id contains "xmas" )

query: {
text\_query: {
fields: \["coupon\_id"\],
search\_phrase: "xmas"
}
}

**Example:** (coupon\_id contains "xmas" OR description contains "xmas")

query: {
text\_query: {
fields: \["description", "coupon\_id"\],
search\_phrase: "xmas"
}
}

**Example:** (description contains "holiday" AND description contains "bojo")

query: {
text\_query: {
fields: \["description"\],
search\_phrase: "holiday bogo"
}
}

*   `fields` (_array of string_, required) The document fields the search phrase has to match.  
    Minimum items: 1.
*   `search_phrase` (_string_, required) A search phrase which may consist of multiple terms.