Skip to content

Commit

Permalink
Merge pull request #33 from KIT-IBPT/search-after
Browse files Browse the repository at this point in the history
Add support for ~search_after parameter
  • Loading branch information
shroffk authored Nov 21, 2024
2 parents c7f426a + e11ab4a commit 7f2979f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions channelfinder/ChannelFinderClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ def find(self, **kwds):
(n >= 1, m >= 0)
>>> assert find(size=n, ifrom=m) == find(size=n+m)[-n:]
>>> find(search_after='channelName')
will return channels that are sorted after the specified name. This is useful
when dealing with queries that may return more channels than are allowed by
the max result window. By specifying the name of the last channel from
the previous query, one can retrieve the next page of channels.
To query for the existance of a tag or property use findTag and findProperty.
"""
if not self.__baseURL:
Expand All @@ -316,6 +322,8 @@ def find(self, **kwds):
args.append(('~size', '{0:d}'.format(int(kwds[key]))))
elif key == 'ifrom':
args.append(('~from', '{0:d}'.format(int(kwds[key]))))
elif key == 'search_after':
args.append(('~search_after', kwds[key]))
else:
raise RuntimeError('unknown find argument ' + key)
return self.findByArgs(args)
Expand Down

0 comments on commit 7f2979f

Please sign in to comment.