# `LogpointApi.Core.SearchRunner`
[🔗](https://github.com/MikaelFangel/logpoint_api/blob/v2.2.0/lib/logpoint_api/core/search_runner.ex#L1)

Blocking polling for Logpoint searches.

The Logpoint search API is asynchronous — submit a query, then poll for
results. `run/3` handles the polling loop, including resubmitting expired
searches automatically.

# `run`

```elixir
@spec run(LogpointApi.Data.Client.t(), LogpointApi.Data.SearchParams.t(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Run a search and block until final results arrive.

Polls `Search.get_result/2` until the response contains `"final" => true`.
When the API returns `"success" => false` (expired search), the original
query is resubmitted automatically.

## Options

  * `:polling_interval` — milliseconds between polls (default: `1000`)
  * `:max_attempts`     — maximum poll iterations (default: `30`)

## Examples

    {:ok, result} = SearchRunner.run(client, query)
    {:ok, result} = SearchRunner.run(client, query, polling_interval: 2_000, max_attempts: 30)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
