You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9d07bc3
Browse filesBrowse the repository at this point in the historyBrowse files
In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean.
@@ -1496,6 +1496,63 @@ paths:
1496
1496
x-speakeasy-name-override: listFilters
1497
1497
security:
1498
1498
- APIToken: []
1499
+
/api/search/enumeration:
1500
+
post:
1501
+
tags:
1502
+
- Search
1503
+
summary: Enumerate matching documents
1504
+
description: |
1505
+
Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance.
1506
+
Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`.
1507
+
A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`.
description: Constrains the assistant response to a caller-supplied JSON Schema.
9859
-
required:
9860
-
- type
9861
-
- name
9862
-
- schema
9863
-
properties:
9864
-
type:
9865
-
type: string
9866
-
description: Discriminator. Must be JSON_SCHEMA.
9867
-
enum:
9868
-
- JSON_SCHEMA
9869
-
name:
9870
-
type: string
9871
-
minLength: 1
9872
-
maxLength: 64
9873
-
description: A stable identifier for the schema.
9874
-
description:
9875
-
type: string
9876
-
maxLength: 1024
9877
-
description: An optional human-readable description of the schema.
9878
-
schema:
9879
-
type: object
9880
-
additionalProperties: true
9881
-
description: A JSON Schema object describing the desired output shape.
9882
-
strict:
9883
-
type: boolean
9884
-
default: true
9885
-
description: |
9886
-
When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
9887
9900
PlatformChatCreateRequest:
9888
9901
type: object
9889
9902
additionalProperties: false
9890
9903
required:
9891
9904
- input
9892
9905
example:
9893
-
input: Summarize our parental leave policy as JSON.
9894
-
text:
9895
-
format:
9896
-
type: JSON_SCHEMA
9897
-
name: policy_summary
9898
-
schema:
9899
-
type: object
9900
-
properties:
9901
-
eligible_employees:
9902
-
type: string
9903
-
duration_weeks:
9904
-
type: integer
9905
-
required:
9906
-
- eligible_employees
9907
-
- duration_weeks
9908
-
strict: true
9906
+
input: Summarize our parental leave policy.
9909
9907
properties:
9910
9908
input:
9911
9909
description: |
@@ -9932,18 +9930,6 @@ components:
9932
9930
minLength: 1
9933
9931
description: |
9934
9932
Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
9935
-
text:
9936
-
type: object
9937
-
additionalProperties: false
9938
-
description: |
9939
-
Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
9940
-
properties:
9941
-
format:
9942
-
description: |
9943
-
Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
SNIPPETS: Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt.
11134
+
x-speakeasy-enum-descriptions:
11135
+
SNIPPETS: Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt.
11136
+
PlatformSearchEnumerationRequest:
11137
+
type: object
11138
+
additionalProperties: false
11139
+
description: |
11140
+
Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set.
11141
+
example:
11142
+
query: amoxicillin
11143
+
datasources:
11144
+
- gdrive
11145
+
page_size: 500
11146
+
properties:
11147
+
query:
11148
+
type: string
11149
+
minLength: 1
11150
+
description: |
11151
+
The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
11152
+
datasources:
11153
+
type: array
11154
+
minItems: 1
11155
+
items:
11156
+
type: string
11157
+
minLength: 1
11158
+
description: |
11159
+
Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`.
11160
+
filters:
11161
+
type: array
11162
+
minItems: 1
11163
+
items:
11164
+
$ref: "#/components/schemas/PlatformFilter"
11165
+
description: |
11166
+
Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources.
11167
+
time_range:
11168
+
$ref: "#/components/schemas/PlatformTimeRange"
11169
+
page_size:
11170
+
type: integer
11171
+
minimum: 1
11172
+
maximum: 1000
11173
+
default: 100
11174
+
description: Number of results to return per page.
11175
+
cursor:
11176
+
type:
11177
+
- string
11178
+
- "null"
11179
+
description: |
11180
+
Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection.
description: Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled.
11214
+
example: Amoxicillin inventory
11215
+
datasource:
11216
+
type: string
11217
+
minLength: 1
11218
+
description: The datasource this result originates from.
11219
+
example: gdrive
11220
+
document_type:
11221
+
type:
11222
+
- string
11223
+
- "null"
11224
+
minLength: 1
11225
+
description: The document type within the datasource.
0 commit comments