lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: best way to get specific results
Date Mon, 18 Sep 2006 15:11:53 GMT
Thanks for the info on this. Since I should use the search function that
returns TopDocs, I was wondering what was the proper way to create a
Weight object to pass into the search function. 

There are 2 functions in the Query class that I see: createWeight and
weight, which both return a Weight object. Is there a difference between
these 2, and which one should I use?

Once I have a Weight object named, for example, w, do I just use the
search function as this?

IndexSearcher is = new IndexSearcher(fsDir);
Query q = ...
Weight w = q.createWeight(is); or Weight w = q.weight(is);, null, 100); // no filter, want top 100 docs

For the case with a filter, would it be:, f, 100);


-----Original Message-----
From: Chris Hostetter [] 
Sent: Saturday, September 16, 2006 07:22 AM
Subject: RE: best way to get specific results

:, Filter) method). Im just wrapping a
: ConstantScoreQuery around the filter, and passing it into the
: method to return a Hits object. Then Im
: asking for the 500th to 550th doc in the Hits object.
: Would such a case still cause Hits to rexecute over and over again on
: higher numbered results? Or is this different because Im using a

yes... it doesn't matter what type of query you use ... Hits is not a
good idea if you wnat results really far down the list.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message