def __getitem__(self, n):
    '\n        Support slicing the `Search` instance for pagination.\n\n        Slicing equates to the from/size parameters. E.g.::\n\n            s = Search().query(...)[0:25]\n\n        is equivalent to::\n\n            s = Search().query(...).extra(from_=0, size=25)\n\n        '
    s = self._clone()
    if isinstance(n, slice):
        if ((n.start and (n.start < 0)) or (n.stop and (n.stop < 0))):
            raise ValueError('Search does not support negative slicing.')
        s._extra['from'] = (n.start or 0)
        s._extra['size'] = max(0, ((n.stop - (n.start or 0)) if (n.stop is not None) else 10))
        return s
    else:
        if (n < 0):
            raise ValueError('Search does not support negative indexing.')
        s._extra['from'] = n
        s._extra['size'] = 1
        return s
Support slicing the `Search` instance for pagination.

Slicing equates to the from/size parameters. E.g.::

    s = Search().query(...)[0:25]

is equivalent to::

    s = Search().query(...).extra(from_=0, size=25)
def __getitem__(self, n):
    '\n        Support slicing the `Search` instance for pagination.\n\n        Slicing equates to the from/size parameters. E.g.::\n\n            s = Search().query(...)[0:25]\n\n        is equivalent to::\n\n            s = Search().query(...).extra(from_=0, size=25)\n\n        '
    s = self._clone()
    if isinstance(n, slice):
        if ((n.start and (n.start < 0)) or (n.stop and (n.stop < 0))):
            raise ValueError('Search does not support negative slicing.')
        s._extra['from'] = (n.start or 0)
        s._extra['size'] = max(0, ((n.stop - (n.start or 0)) if (n.stop is not None) else 10))
        return s
    else:
        if (n < 0):
            raise ValueError('Search does not support negative indexing.')
        s._extra['from'] = n
        s._extra['size'] = 1
        return s