Hello,

1) I have created an "interface" to a Nutch index using the Nutch API
0.9. I am extracting all the details I need out of a "hit" except for
one: the score. Here is what I do:

[...]
int maxHits = 1000;
Configuration nutchConf = NutchConfiguration.create();
NutchBean nutchBean = new NutchBean(nutchConf);
Query nutchQuery = Query.parse(nutchSearchString, nutchConf);
Hits nutchHits = nutchBean.search(nutchQuery, maxHits);
Integer totalHits = new Integer(nutchHits.getLength());
[...]
for (int i = 0; i < nutchHits.getLength() && i < nbrResults.intValue();
i++) {
Hit hit = nutchHits.getHit(i);
HitDetails details = nutchBean.getDetails(hit);
String explanations = nutchBean.getExplanation(nutchQuery, hit);
[...]
String url = details.getValue("url")
[...]
}

The only way I managed to obtain the score is using the
NutchBean.getDetails() method, but then I have to parse an HTML string
containing details I don't need. Is there not a simpler way to do that?



2) Let say I know that a query returns 20 hits; can I ask only for the
last 10 (results 11 to 20) and not for everything? What I do now:

[...]
int maxHits = 1000;
Hits nutchHits = nutchBean.search(nutchQuery, maxHits);
[...]

Is there not a way to ask for only a subset of all the hits?

Thank you,

David

Reply via email to