# searchSpaceText

Find words INSIDE one text file: the numbered lines (`N| line`) holding any of `terms` (case-insensitive, matches inside longer words), with `contextLines` (default 2) around each and `…` between blocks: one read instead of paging a long file with getSpaceTextLines. Pass a few variants of the idea ("hire", "hiring", "recruit"). `matchedLines` counts every hit; `truncated` means some were left out for space: narrow the terms or read around a hit with getSpaceTextLines.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "searchSpaceText", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `itemId`: `ID!` (required)
- `terms`: `[String!]!` (required)
- `contextLines`: `Int`
- `versionId`: `ID`

## Response (data, an example)

```json
{
  "spacesQuery": {
    "textSearch": {
      "versionId": "<ID>",
      "totalLines": 0,
      "matchedLines": 0,
      "truncated": true,
      "text": "…"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "searchSpaceText",
    "variables": {
      "itemId": "<itemId>",
      "terms": [
        "<String>"
      ]
    }
  }'
```
