ripgrep.
grep are too slow for
searching across large document sets.
With Archil’s built-in grep APIs, you can effectively search across millions of documents on your
disk using map-reduce inside of Archil. Archil’s grep API is priced the same as if you’d manually
run the search on serverless sandboxes, billed as the total compute time needed to perform the
search.
Managing concurrency
Archil’sgrep API works by performing a massively parallel search across the files stored in
the folder that you’re searching. Archil automatically manages the concurrency of each search to
optimize for search latency. If you’d prefer to control this concurrency manually, you can specify
the exact number of workers to use via the concurrency option.
TypeScript
Limiting work
For some kinds of search, you do not need an exhaustive set of results. For example, if you’re trying to find the first occurrence of an error, you only need one result. You can manage the amount of work that Archil’s search performs by specifying either themaxResults or maxDurationSeconds options.
When these options are specified, the search will stop as soon as the result or time limit is reached,
regardless of whether the search was exhaustive.
Next steps
- TypeScript SDK: searching files — the
disk.grepAPI surface - Python SDK: searching files — the
Disk.grepAPI surface - API reference: Search Files — the raw HTTP endpoint
- Serverless sandboxes — run arbitrary commands when you need more than search