(self)
return self.__class__(newreader, fromindex=self._ix,
                              weighting=self.weighting)
Returns a fresh searcher for the latest version of the index::

            my_searcher = my_searcher.refresh()

        If the index has not changed since this searcher was created, this
        searcher is simply returned.

        This method may CLOSE underlying resources that are no longer needed
        by the refreshed searcher, so you CANNOT continue to use the original
        searcher after calling ``refresh()`` on it.
Returns a fresh searcher for the latest version of the index::
Returns a fresh searcher for the latest version of the index ::
def refresh(self):
        """Returns a fresh searcher for the latest version of the index::

            my_searcher = my_searcher.refresh()

        If the index has not changed since this searcher was created, this
        searcher is simply returned.

        This method may CLOSE underlying resources that are no longer needed
        by the refreshed searcher, so you CANNOT continue to use the original
        searcher after calling ``refresh()`` on it.
        """

        if not self._ix:
            raise Exception("No reference to index")
        if self._ix.latest_generation() == self.reader().generation():
            return self

        # Get a new reader, re-using resources from the current reader if
        # possible
        self.is_closed = True
        newreader = self._ix.reader(reuse=self.ixreader)
        return self.__class__(newreader, fromindex=self._ix,
                              weighting=self.weighting)
def refresh ( self ) : if not self . _ix : raise Exception ( "No reference to index" ) if self . _ix . latest_generation ( ) == self . reader ( ) . generation ( ) : return self # Get a new reader, re-using resources from the current reader if # possible self . is_closed = True newreader = self . _ix . reader ( reuse = self . ixreader ) return self . __class__ ( newreader , fromindex = self . _ix , weighting = self . weighting )