Retrieval

Grep File

Grep within a file's parsed content using a regex pattern.

post/api/v1/retrieval/files/grep

Query parameters

project_idstring uuid nullable
organization_idstring uuid nullable

Cookies

sessionstring nullable

Request body

page_sizeinteger nullable

The maximum number of items to return. The service may return fewer than this value. If unspecified, a default page size will be used. The maximum value is typically 1000; values above this will be coerced to the maximum.

page_tokenstring nullable

A page token, received from a previous list call. Provide this to retrieve the subsequent page.

index_idstring required

ID of the index the file belongs to.

file_idstring required

ID of the file to grep.

patternstring required

Regex pattern to search for.

context_charsinteger nullable

Number of characters of context to include before and after the matched pattern in the content field of the response

Example request

{
  "index_id": "idx-abc123",
  "pattern": "revenue|profit"
}

Response

Successful Response

next_page_tokenstring nullable

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

total_sizeinteger nullable

The total number of items available. This is only populated when specifically requested. The value may be an estimate and can be used for display purposes only.

Changes

Changed in 5 of the 33 revisions of this API.219

    • added the optional property detail/items/ctx to the response with the 422 status

      response-optional-property-added

    • added the optional property detail/items/input to the response with the 422 status

      response-optional-property-added

    This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 46 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • b6390803e961115See the full diff
    • removed the required property matches from the response with the 200 status

      response-required-property-removed

    • removed the request property limit

      request-property-removed

    • added the new optional request property page_size

      new-optional-request-property

    • added the new optional request property page_token

      new-optional-request-property

    • added the optional property next_page_token to the response with the 200 status

      response-optional-property-added

    • added the optional property total_size to the response with the 200 status

      response-optional-property-added

    • added the required property items to the response with the 200 status

      response-required-property-added

    This revision also has 13 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added