Skip to main content

Function: searchSubmissionsHandler()

searchSubmissionsHandler(c, params): Promise<{ cursor: string; facets: Record<string, object[]>; hasMore: boolean; hits: object[]; impressionId: string; total: number; }>

Defined in: src/api/handlers/xrpc/preprint/searchSubmissions.ts:59

Handler for pub.chive.preprint.searchSubmissions query.

Parameters

c

Context<ChiveEnv>

Hono context with Chive environment

params

Validated search parameters

author

string = ...

cursor

string = ...

Pagination cursor.

dateFrom

string = ...

dateTo

string = ...

field

string = ...

license

string = ...

limit

number = ...

Pagination limit.

q

string = ...

Search query string.

sort

"date" | "views" | "relevance" = ...

Sort order.

Returns

Promise<{ cursor: string; facets: Record<string, object[]>; hasMore: boolean; hits: object[]; impressionId: string; total: number; }>

Search results with facets and pagination

Example

GET /xrpc/pub.chive.preprint.searchSubmissions?q=quantum+computing&limit=20

Response:
{
"hits": [...],
"total": 150,
"hasMore": true,
"cursor": "...",
"facets": { "field": [...], "license": [...] }
}