Mailing List Archive

Searcher->num_wanted
How do I tell the Searcher "give me all the hits"?

--
Peter Karman . http://peknet.com/ . peter@peknet.com

_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
Re: Searcher->num_wanted [ In reply to ]
On Feb 15, 2008, at 8:38 PM, Peter Karman wrote:

> How do I tell the Searcher "give me all the hits"?

my $hits = $searcher->search(
query => $query,
num_wanted => $searcher->max_doc,
);

Two notes:

First, we need to make a documentation change. Searcher->max_doc
should be made public -- or rather, Searchable should be made public
along with Searchable->max_doc, and the Searcher docs should indicate
the inheritance chain.

Second, the code above is potentially expensive for large indexes, as
it creates a HitQueue with room for max_doc() elements.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/


_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
Re: Searcher->num_wanted [ In reply to ]
On Feb 15, 2008, at 10:16 PM, Marvin Humphrey wrote:

>
> On Feb 15, 2008, at 8:38 PM, Peter Karman wrote:
>
>> How do I tell the Searcher "give me all the hits"?
>
> my $hits = $searcher->search(
> query => $query,
> num_wanted => $searcher->max_doc,
> );
>
> Two notes:
>
> First, we need to make a documentation change. Searcher->max_doc
> should be made public -- or rather, Searchable should be made public
> along with Searchable->max_doc, and the Searcher docs should
> indicate the inheritance chain.
>
> Second, the code above is potentially expensive for large indexes,
> as it creates a HitQueue with room for max_doc() elements.

Does infinity work? Can one write num_wanted => 9**9**9?


_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch