Skip to main content

Job Executor -- Search API

The Search API provides a unified search endpoint that can query across multiple entity types (jobs, steps, collections) with pagination, sorting, and column-level filtering.

Base URL: http://localhost:9000

Prefix: /search

Endpoints

MethodPathDescription
POST/searchSearch entities with filters

POST /search

Search across entity types with full-text search and column-level filters.

Query parameters:

ParameterTypeDefaultDescription
typestringallEntity type to search. Values: all, job, step, collection.

Request body (FilterRequest):

{
"page": 0,
"size": 10,
"sortBy": "updatedAt",
"sortOrder": "desc",
"searchText": "sales report",
"filters": {
"category": {
"operator": "and",
"constraints": [
{ "value": "reporting", "matchMode": "equals" }
]
},
"tags": {
"operator": "or",
"constraints": [
{ "value": "finance", "matchMode": "contains" },
{ "value": "sales", "matchMode": "contains" }
]
}
}
}

Response:

{
"status": "Success",
"message": "Search completed successfully",
"data": [
{
"id": "job-abc-123",
"type": "job",
"name": "Send Monthly Sales Report",
"description": "Generates the monthly sales report.",
"category": "reporting",
"tags": ["sales", "finance"],
"updatedAt": "2026-04-02T09:00:00Z"
}
],
"meta": {
"totalElements": 1,
"page": 0,
"size": 10
}
}

FilterRequest Structure

The FilterRequest object controls pagination, sorting, text search, and column-level filtering.

Top-level fields

FieldTypeDefaultDescription
pageinteger0Zero-based page number.
sizeinteger10Number of results per page.
sortBystringidField to sort by.
sortOrderstringdescSort direction: asc or desc.
searchTextstringnullFree-text search. Matched against the entity's name and description fields.
filtersMap<String, FilterGroup>nullColumn-level filters. The map key is the field name to filter on.

FilterGroup

Each entry in the filters map is a FilterGroup that defines how multiple constraints on the same field are combined.

FieldTypeDescription
operatorstringHow to combine constraints: and (all must match) or or (any must match).
constraintsFilterConstraint[]Array of filter conditions for this field.

FilterConstraint

Each constraint defines a single filter condition.

FieldTypeDescription
valueanyThe value to match against. Type depends on the field.
matchModestringHow to compare the field value to the constraint value.

Match Modes

matchModeDescriptionExample
equalsExact match.{ "value": "reporting", "matchMode": "equals" }
notEqualsNot equal to.{ "value": "draft", "matchMode": "notEquals" }
containsField contains the value (case-insensitive substring).{ "value": "sales", "matchMode": "contains" }
notContainsField does not contain the value.{ "value": "test", "matchMode": "notContains" }
startsWithField starts with the value.{ "value": "Send", "matchMode": "startsWith" }
endsWithField ends with the value.{ "value": "Report", "matchMode": "endsWith" }
inField value is in the provided array.{ "value": ["reporting", "it-ops"], "matchMode": "in" }
gtGreater than (for numeric/date fields).{ "value": "2026-01-01", "matchMode": "gt" }
ltLess than.{ "value": 100, "matchMode": "lt" }
gteGreater than or equal.{ "value": 0, "matchMode": "gte" }
lteLess than or equal.{ "value": 1000, "matchMode": "lte" }
betweenBetween two values (inclusive).{ "value": [10, 50], "matchMode": "between" }

MongoDB Filtering

Under the hood, FilterRequest is translated into MongoDB query criteria using MongoFilteringUtil. Each FilterGroup becomes a MongoDB $and or $or clause, and each FilterConstraint becomes a MongoDB comparison operator:

matchModeMongoDB Operator
equals$eq
notEquals$ne
contains$regex (case-insensitive)
startsWith$regex: /^value/i
in$in
gt$gt
lt$lt
between$gte + $lte

Examples

Filter jobs by category and status

{
"page": 0,
"size": 20,
"sortBy": "name",
"sortOrder": "asc",
"filters": {
"category": {
"operator": "or",
"constraints": [
{ "value": "reporting", "matchMode": "equals" },
{ "value": "it-operations", "matchMode": "equals" }
]
}
}
}

Free-text search with no column filters

{
"page": 0,
"size": 10,
"sortBy": "updatedAt",
"sortOrder": "desc",
"searchText": "monthly report"
}

Combine free-text search with column filters

{
"page": 0,
"size": 10,
"sortBy": "updatedAt",
"sortOrder": "desc",
"searchText": "backup",
"filters": {
"tags": {
"operator": "or",
"constraints": [
{ "value": "database", "matchMode": "contains" },
{ "value": "infrastructure", "matchMode": "contains" }
]
}
}
}

Per-Entity Search Endpoints

In addition to the unified /search endpoint, individual entity APIs also expose search:

EndpointDescription
POST /jobs/searchSearch jobs only (see Jobs API)
POST /step/searchSearch steps only (see Steps API)

These use the same FilterRequest body structure.