(self, results, reverse=False)
Re-sorts the results so any hits that are also in 'results' appear
        before hits not in 'results', otherwise keeping their current relative
        positions. This does not add the documents in the other results object
        to this one.

        :param results: another results object.
        :param reverse: if True, lower the position of hits in the other
            results object instead of raising them.
Re-sorts the results so any hits that are also in 'results' appear
        before hits not in 'results', otherwise keeping their current relative
        positions. This does not add the documents in the other results object
        to this one.
Re - sorts the results so any hits that are also in results appear before hits not in results otherwise keeping their current relative positions . This does not add the documents in the other results object to this one .
def upgrade(self, results, reverse=False):
        """Re-sorts the results so any hits that are also in 'results' appear
        before hits not in 'results', otherwise keeping their current relative
        positions. This does not add the documents in the other results object
        to this one.

        :param results: another results object.
        :param reverse: if True, lower the position of hits in the other
            results object instead of raising them.
        """

        if not len(results):
            return

        otherdocs = results.docs()
        arein = [item for item in self.top_n if item[1] in otherdocs]
        notin = [item for item in self.top_n if item[1] not in otherdocs]

        if reverse:
            items = notin + arein
        else:
            items = arein + notin

        self.top_n = items
def upgrade ( self , results , reverse = False ) : if not len ( results ) : return otherdocs = results . docs ( ) arein = [ item for item in self . top_n if item [ 1 ] in otherdocs ] notin = [ item for item in self . top_n if item [ 1 ] not in otherdocs ] if reverse : items = notin + arein else : items = arein + notin self . top_n = items