Skip to content

Commit 7f2979f

Browse files
authored
Merge pull request #33 from KIT-IBPT/search-after
Add support for ~search_after parameter
2 parents c7f426a + e11ab4a commit 7f2979f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

channelfinder/ChannelFinderClient.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ def find(self, **kwds):
291291
(n >= 1, m >= 0)
292292
>>> assert find(size=n, ifrom=m) == find(size=n+m)[-n:]
293293
294+
>>> find(search_after='channelName')
295+
will return channels that are sorted after the specified name. This is useful
296+
when dealing with queries that may return more channels than are allowed by
297+
the max result window. By specifying the name of the last channel from
298+
the previous query, one can retrieve the next page of channels.
299+
294300
To query for the existance of a tag or property use findTag and findProperty.
295301
"""
296302
if not self.__baseURL:
@@ -316,6 +322,8 @@ def find(self, **kwds):
316322
args.append(('~size', '{0:d}'.format(int(kwds[key]))))
317323
elif key == 'ifrom':
318324
args.append(('~from', '{0:d}'.format(int(kwds[key]))))
325+
elif key == 'search_after':
326+
args.append(('~search_after', kwds[key]))
319327
else:
320328
raise RuntimeError('unknown find argument ' + key)
321329
return self.findByArgs(args)

0 commit comments

Comments
 (0)