You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Daniel Pfeifer <Da...@tradedoubler.com> on 2006/01/19 14:00:05 UTC

Limiting hits?

Hi,

I am currently looking for a way to limit the amount of Hits which are
returned by a Query.

What I am doing is following:

Searcher s = ...;
Query q = QueryParser.parse("...", "...", new StandardAnalyzer());
searcher.search(query);

We have approximately 10 million products in our Index and of these 10
million products there might be 100.000 which have the word "processor"
in it's description.

Say a user on our website is searching for processor the Index (to which
I connect by RMI) is finding 100.000 products and returns these Hits.

Is it possible to implement away to return no more than 1000 products?
Is it possible to add something like "name:processor AND
maxresults:1000"?

Thanks in advance!
/Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Limiting hits?

Posted by Yonik Seeley <ys...@gmail.com>.
Hits doesn't keep track of all 100,000 matches, only the first 100. 
It dynamically collects more matches if it needs to.

-Yonik

On 1/19/06, Daniel Pfeifer <Da...@tradedoubler.com> wrote:
> Hi,
>
> I am currently looking for a way to limit the amount of Hits which are
> returned by a Query.
>
> What I am doing is following:
>
> Searcher s = ...;
> Query q = QueryParser.parse("...", "...", new StandardAnalyzer());
> searcher.search(query);
>
> We have approximately 10 million products in our Index and of these 10
> million products there might be 100.000 which have the word "processor"
> in it's description.
>
> Say a user on our website is searching for processor the Index (to which
> I connect by RMI) is finding 100.000 products and returns these Hits.
>
> Is it possible to implement away to return no more than 1000 products?
> Is it possible to add something like "name:processor AND
> maxresults:1000"?
>
> Thanks in advance!
> /Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Search more than one index directory

Posted by Daniel Naber <lu...@danielnaber.de>.
On Donnerstag 19 Januar 2006 14:51, Ranjan K. Baisak wrote:

> I have different categories of indexes in different
> directory. When I am searching for a category of
> "ALL", lucene should search using indexes from all
> directories.
> So is it possible?

Use this class:
http://lucene.apache.org/java/docs/api/org/apache/lucene/search/MultiSearcher.html

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Search more than one index directory

Posted by "Ranjan K. Baisak" <ra...@yahoo.com>.
I have different categories of indexes in different
directory. When I am searching for a category of
"ALL", lucene should search using indexes from all
directories.
So is it possible?

regards,
Ranjan

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org