query string required Original search text displayed to the user.
Build deterministic mock search pages with exact pagination, relevance or date sorting, facets, highlights, empty states and suggestions.
Generated test data for fixtures and development
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
query
required
| string | allowed: 1 – 100 example: cursor pagination | Original search text displayed to the user. |
scenario | enum | default: results allowed: results | empty | suggestion example: results | Return normal results, an exact empty state or a caller-supplied suggestion state. |
suggestedQuery | string | allowed: 1 – 100 example: authentication sessions | Required, distinct alternative query for scenario=suggestion; invalid for other scenarios. |
total | int | allowed: 0 – 1000 example: 137 | Total matching records. Defaults to 47; empty requires 0. |
page | int | default: 1 allowed: 1 – 1000 example: 2 | One-based page number; beyond-last pages return an honest empty slice. |
pageSize | int | default: 10 allowed: 1 – 50 example: 20 | Maximum results returned on this page. |
sort | enum | default: relevance allowed: relevance | newest | oldest example: newest | Sort by descending score, newest timestamp or oldest timestamp. |
facets | boolean | default: true example: true | Include exact full-result category counts. |
asOf | date | example: 2026-07-10T12:00:00.000Z | Replay anchor for synthetic updatedAt values; defaults to the request clock and is echoed. |
query string required Original search text displayed to the user.
scenario enum Return normal results, an exact empty state or a caller-supplied suggestion state.
suggestedQuery string Required, distinct alternative query for scenario=suggestion; invalid for other scenarios.
total int Total matching records. Defaults to 47; empty requires 0.
page int One-based page number; beyond-last pages return an honest empty slice.
pageSize int Maximum results returned on this page.
sort enum Sort by descending score, newest timestamp or oldest timestamp.
facets boolean Include exact full-result category counts.
asOf date Replay anchor for synthetic updatedAt values; defaults to the request clock and is echoed.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: query,effectiveQuery | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: facets | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
query | string | Original caller query. | cursor pagination |
effectiveQuery | string | Query used to build result text; equals suggestedQuery in suggestion mode. | cursor pagination |
scenario | string | results | empty | suggestion. | results |
suggestedQuery nullable | string | Explicit alternative in suggestion mode, otherwise null. | null |
total | integer | Exact full-result count before paging. | 137 |
sort | string | Applied sort mode. | relevance |
pageInfo | object | Exact one-based page bounds, totals and previous/next state. | {"page":1,"pageSize":10,"totalPages":14,"from":1,"to":10,"hasPreviousPage":false,"hasNextPage":true,"previousPage":null,"nextPage":2} |
results | object[] | At most pageSize deterministic result records with safe URLs and exact Unicode code-point highlight offsets. | [{"id":"result_00001_1234abcd","title":"cursor pagination — API reference 1","url":"https://search.example/results/result_00001_1234abcd","snippet":"A fictional search fixture about cursor pagination.","category":"reference","score":0.91,"updatedAt":"2026-07-01T12:00:00.000Z","highlights":[]}] |
facets | object[] | Category counts over all matches; empty when disabled or no results. | [{"value":"reference","count":34}] |
query string Original caller query.
example: cursor pagination
effectiveQuery string Query used to build result text; equals suggestedQuery in suggestion mode.
example: cursor pagination
scenario string results | empty | suggestion.
example: results
suggestedQuery string nullable Explicit alternative in suggestion mode, otherwise null.
example: null
total integer Exact full-result count before paging.
example: 137
sort string Applied sort mode.
example: relevance
pageInfo object Exact one-based page bounds, totals and previous/next state.
example: {"page":1,"pageSize":10,"totalPages":14,"from":1,"to":10,"hasPreviousPage":false,"hasNextPage":true,"previousPage":null,"nextPage":2}
results object[] At most pageSize deterministic result records with safe URLs and exact Unicode code-point highlight offsets.
example: [{"id":"result_00001_1234abcd","title":"cursor pagination — API reference 1","url":"https://search.example/results/result_00001_1234abcd","snippet":"A fictional search fixture about cursor pagination.","category":"reference","score":0.91,"updatedAt":"2026-07-01T12:00:00.000Z","highlights":[]}]
facets object[] Category counts over all matches; empty when disabled or no results.
example: [{"value":"reference","count":34}]
/api/search-results?query=cursor%20pagination&total=137&page=2&pageSize=20&sort=relevance&asOf=2026-07-10T12%3A00%3A00.000Z {
"data": {
"query": "cursor pagination",
"effectiveQuery": "cursor pagination",
"scenario": "results",
"suggestedQuery": null,
"total": 137,
"sort": "relevance",
"pageInfo": {
"page": 2,
"pageSize": 20,
"totalPages": 7,
"from": 21,
"to": 40,
"hasPreviousPage": true,
"hasNextPage": true,
"previousPage": 1,
"nextPage": 3
},
"results": [
{
"id": "result_00057_a8975b3c",
"title": "cursor pagination — worked example 57",
"url": "https://search.example/results/result_00057_a8975b3c",
"snippet": "A fictional search fixture about cursor pagination, with deterministic ranking, highlighting and pagination metadata.",
"category": "reference",
"score": 0.910757,
"updatedAt": "2026-06-14T12:00:00.000Z",
"highlights": [
{
"field": "title",
"start": 0,
"end": 17,
"text": "cursor pagination"
},
{
"field": "snippet",
"start": 33,
"end": 50,
"text": "cursor pagination"
…
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/search-results?query=missing%20fixture&scenario=empty&total=0&asOf=2026-07-10T12%3A00%3A00.000Z {
"data": {
"query": "missing fixture",
"effectiveQuery": "missing fixture",
"scenario": "empty",
"suggestedQuery": null,
"total": 0,
"sort": "relevance",
"pageInfo": {
"page": 1,
"pageSize": 10,
"totalPages": 0,
"from": 0,
"to": 0,
"hasPreviousPage": false,
"hasNextPage": false,
"previousPage": null,
"nextPage": null
},
"results": [],
"facets": []
},
"meta": {
"endpoint": "search-results",
"params": {
"query": "missing fixture",
"scenario": "empty",
"total": 0,
"page": 1,
"pageSize": 10,
"sort": "relevance",
"facets": true,
"asOf": "2026-07-10T12:00:00.000Z"
},
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} /api/search-results?query=auth%20sesions&scenario=suggestion&suggestedQuery=authentication%20sessions&total=12&asOf=2026-07-10T12%3A00%3A00.000Z {
"data": {
"query": "auth sesions",
"effectiveQuery": "authentication sessions",
"scenario": "suggestion",
"suggestedQuery": "authentication sessions",
"total": 12,
"sort": "relevance",
"pageInfo": {
"page": 1,
"pageSize": 10,
"totalPages": 2,
"from": 1,
"to": 10,
"hasPreviousPage": false,
"hasNextPage": true,
"previousPage": null,
"nextPage": 2
},
"results": [
{
"id": "result_00002_c4520f9d",
"title": "authentication sessions — migration notes 2",
"url": "https://search.example/results/result_00002_c4520f9d",
"snippet": "A fictional search fixture about authentication sessions, with deterministic ranking, highlighting and pagination metadata.",
"category": "guides",
"score": 0.987374,
"updatedAt": "2025-08-17T12:00:00.000Z",
"highlights": [
{
"field": "title",
"start": 0,
"end": 23,
"text": "authentication sessions"
},
{
"field": "snippet",
"start": 33,
"end": 56,
"text": "authentication sessions"
…
"generatedAt": "2026-07-29T08:13:22.000Z"
}
} Builds one complete, deterministic search response fixture from the requested query and paging options. It is designed for search boxes, result lists and test assertions—not as a search engine. Every result uses a safe search.example URL and contains exact highlight offsets that point back to the returned title and snippet.
Three explicit scenarios cover the UI branches teams repeatedly hand-code: normal results, an honest empty state, and a caller-supplied suggestion. Relevance scores sort descending, date sorts use timestamps bounded by the echoed asOf, page metadata reconciles exactly, and requested facet counts sum to the full result count (facets=false deliberately returns an empty array).
This compute route deliberately has no seed parameter: identical resolved query parameters already produce identical output. Omitted asOf resolves from the request clock and is echoed for explicit replay.
Yes. Every highlight names its field and exact start/end range, and the selected substring equals the returned highlight text.
Yes. scenario=empty returns zero results, zero facets and exact zero-page metadata; a conflicting nonzero total is rejected.
This is a deterministic compute route: all resolved route parameters, including the echoed asOf anchor, completely determine the response.
Deterministic offset and opaque-cursor pagination fixtures with exact totals, stable sorting and no duplicated or skipped records.
Fake e-commerce products with category-themed names, prices in real currencies (whole yen for JPY), valid EAN-13 barcodes, SKUs, ratings and image URLs.
Generate coherent fake contact, signup, survey and application submissions with exact validation, attachment, spam and processing states.
Complete fake people — name, age-consistent birth date, email, phone, job and address — with working filters for gender, age range and email domain.
Generate privacy-safe analytics sessions and funnel summaries with exact event order, timing, outcome, conversion and revenue arithmetic.