lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <>
Subject Making TopDocCollector a bit more consumable
Date Mon, 24 Aug 2009 14:15:56 GMT
Hey all,

Hits, which used to be the non expert search API has been deprecated -
so TopDocs is now
essentially the non expert search API. But when you go to use it you are
greeted with:

  public static TopFieldCollector create(Sort sort, int numHits,
      boolean fillFields, boolean trackDocScores, boolean trackMaxScore,
      boolean docsScoredInOrder)


  public static TopScoreDocCollector create(int numHits, boolean
docsScoredInOrder) {
    if (docsScoredInOrder) {
      return new InOrderTopScoreDocCollector(numHits);
    } else {
      return new OutOfOrderTopScoreDocCollector(numHits);

Woah ! Think of the poor noobies ;)

I don't know if I want my docs scored in order. Seriously, I don't. Its
sounds nice though. And fill fields? Please do I guess :)

What do you think about having versions that default to something
reasonable ? And you just have to give numhits and sort, numhits?

This API now has a dual role IMO - expert and non expert.

- Mark

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

View raw message