(self, limit=10, sortedby=None, reverse=False, groupedby=None,
                  collapse=None, collapse_limit=1, collapse_order=None,
                  optimize=True, filter=None, mask=None, terms=False,
                  maptype=None, scored=True)
return c
Low-level method: returns a configured
        :class:`whoosh.collectors.Collector` object based on the given
        arguments. You can use this object with
        :meth:`Searcher.search_with_collector` to search.

        See the documentation for the :meth:`Searcher.search` method for a
        description of the parameters.

        This method may be useful to get a basic collector object and then wrap
        it with another collector from ``whoosh.collectors`` or with a custom
        collector of your own::

            # Equivalent of
            # results = mysearcher.search(myquery, limit=10)
            # but with a time limt...

            # Create a TopCollector
            c = mysearcher.collector(limit=10)

            # Wrap it with a TimeLimitedCollector with a time limit of
            # 10.5 seconds
            from whoosh.collectors import TimeLimitedCollector
            c = TimeLimitCollector(c, 10.5)

            # Search using the custom collector
            results = mysearcher.search_with_collector(myquery, c)
Low-level method: returns a configured
        :class:`whoosh.collectors.Collector` object based on the given
        arguments. You can use this object with
        :meth:`Searcher.search_with_collector` to search.
Low - level method : returns a configured : class : whoosh . collectors . Collector object based on the given arguments . You can use this object with : meth : Searcher . search_with_collector to search .
def collector(self, limit=10, sortedby=None, reverse=False, groupedby=None,
                  collapse=None, collapse_limit=1, collapse_order=None,
                  optimize=True, filter=None, mask=None, terms=False,
                  maptype=None, scored=True):
        """Low-level method: returns a configured
        :class:`whoosh.collectors.Collector` object based on the given
        arguments. You can use this object with
        :meth:`Searcher.search_with_collector` to search.

        See the documentation for the :meth:`Searcher.search` method for a
        description of the parameters.

        This method may be useful to get a basic collector object and then wrap
        it with another collector from ``whoosh.collectors`` or with a custom
        collector of your own::

            # Equivalent of
            # results = mysearcher.search(myquery, limit=10)
            # but with a time limt...

            # Create a TopCollector
            c = mysearcher.collector(limit=10)

            # Wrap it with a TimeLimitedCollector with a time limit of
            # 10.5 seconds
            from whoosh.collectors import TimeLimitedCollector
            c = TimeLimitCollector(c, 10.5)

            # Search using the custom collector
            results = mysearcher.search_with_collector(myquery, c)
        """

        from whoosh import collectors

        if limit is not None and limit < 1:
            raise ValueError("limit must be >= 1")

        if not scored and not sortedby:
            c = collectors.UnsortedCollector()
        elif sortedby:
            c = collectors.SortingCollector(sortedby, limit=limit,
                                            reverse=reverse)
        elif groupedby or reverse or not limit or limit >= self.doc_count():
            # A collector that gathers every matching document
            c = collectors.UnlimitedCollector(reverse=reverse)
        else:
            # A collector that uses block quality optimizations and a heap
            # queue to only collect the top N documents
            c = collectors.TopCollector(limit, usequality=optimize)

        if groupedby:
            c = collectors.FacetCollector(c, groupedby, maptype=maptype)
        if terms:
            c = collectors.TermsCollector(c)
        if collapse:
            c = collectors.CollapseCollector(c, collapse, limit=collapse_limit,
                                             order=collapse_order)

        # Filtering wraps last so it sees the docs first
        if filter or mask:
            c = collectors.FilterCollector(c, filter, mask)
        return c
def collector ( self , limit = 10 , sortedby = None , reverse = False , groupedby = None , collapse = None , collapse_limit = 1 , collapse_order = None , optimize = True , filter = None , mask = None , terms = False , maptype = None , scored = True ) : from whoosh import collectors if limit is not None and limit < 1 : raise ValueError ( "limit must be >= 1" ) if not scored and not sortedby : c = collectors . UnsortedCollector ( ) elif sortedby : c = collectors . SortingCollector ( sortedby , limit = limit , reverse = reverse ) elif groupedby or reverse or not limit or limit >= self . doc_count ( ) : # A collector that gathers every matching document c = collectors . UnlimitedCollector ( reverse = reverse ) else : # A collector that uses block quality optimizations and a heap # queue to only collect the top N documents c = collectors . TopCollector ( limit , usequality = optimize ) if groupedby : c = collectors . FacetCollector ( c , groupedby , maptype = maptype ) if terms : c = collectors . TermsCollector ( c ) if collapse : c = collectors . CollapseCollector ( c , collapse , limit = collapse_limit , order = collapse_order ) # Filtering wraps last so it sees the docs first if filter or mask : c = collectors . FilterCollector ( c , filter , mask ) return c