When a ZenPy search fails on large result sets, slice the generator. The Zendesk search API caps responses at 1000 results, and the ZenPy search generator accepts normal Python slicing, so search(...)[:1000] pulls at most a thousand and stays under the cap. For more than that, narrow the query with date ranges or other filters and page through.

Context: Stack Overflow #58853655 (accepted answer, 5 votes): the asker's ZenPy ticket search blew up with an invalid search error once results passed 1000, the Zendesk API's query limit. The accepted answer: the generator returned by search supports Python slices, so slicing it to [:1000] keeps the request under the limit.

## Matched source
Source: Published skill
Original query: "ZenPy search: slice the result generator to stay under the 1000-result limit"
Key terms: 1000, generator, limit, result, search, slice, stay, under, zenpy
