Hi Dennis,
Sorry to disturb you again but I reaaly cannot get this code working...
should I put the code you gave me in a classe extending BasicQueryFilter?
Here is my code in its simplest form:
public class Search extends BasicQueryFilter{
{try{
Query query = new Query();
query.addRequiredTerm("term");
Configuration conf = NutchConfiguration.create();
IndexSearcher searcher = new IndexSearcher(new
Path("C:\\path\\to\\index"), conf);
NutchBean bean = new NutchBean(conf);
Hits hits = bean.search(query, 10);
HitDetails[] details =
searcher.getDetails(hits.getHits(0,hits.getLength()));
for (int i = 0; i < details.length; i++) {
HitDetails curDetail = details[i];
System.out.println(curDetail);
}
}
catch (IOException e) {
e.printStackTrace();
}
}}
Still, eclipse is not happy, asking to add a { before the try, why???...........
HELP! :D
Hope
you can help me solving this problem...
Thanks a lot
---------------------------------------------------------------------------------------------------------------------------
Try something like this. The conf folder holding the nutch-site.xml and
hadoop-site.xml file must be in the classpath here. I have the file
system set to local and I have an index on the local filesystem.
Dennis
try {
Scanner scanner = new Scanner(new File("C:\\d01\\searchterms.txt"));
Query query = new Query();
while (scanner.hasNext()) {
query.addRequiredTerm(scanner.nextLine().trim());
}
Configuration conf =
NutchConfiguration.create();
IndexSearcher searcher = new IndexSearcher(new
Path("C:\\d01\\crawl3\\index"), conf);
NutchBean bean = new NutchBean(conf);
Hits hits = bean.search(query, 10);
HitDetails[] details = searcher.getDetails(hits.getHits(0,
hits.getLength()));
for (int i = 0; i < details.length; i++) {
HitDetails curDetail = details[i];
System.out.println(curDetail);
}
}
catch (IOException e) {
e.printStackTrace();
}
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Demandez à ceux qui savent sur Yahoo! Questions/Réponses.
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Demandez à ceux qui savent sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nutch-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-general