(self, results)
Removes any hits that are not also in the other results object.
Removes any hits that are not also in the other results object.
Removes any hits that are not also in the other results object .
def filter(self, results):
        """Removes any hits that are not also in the other results object.
        """

        if not len(results):
            return

        otherdocs = results.docs()
        items = [item for item in self.top_n if item[1] in otherdocs]
        self.docset = self.docs() & otherdocs
        self.top_n = items
def filter ( self , results ) : if not len ( results ) : return otherdocs = results . docs ( ) items = [ item for item in self . top_n if item [ 1 ] in otherdocs ] self . docset = self . docs ( ) & otherdocs self . top_n = items