Olá a todos, boa noite!
Estou fazendo uma pesquisa via LUCENE e TXT e estou conseguindo trazer os dados.
MAS GOSTARIS DE TRAZER OS DADOS E PAGINAR
por exemplo: anterior < 1 2 3 4 5 6 … > próximo
alguém tem uma idéia?
vou postar o meu metodo search()
public void search(String searchQuery) throws IOException, ParseException {
searcher = new Searcher(indexDir);
long startTime = System.currentTimeMillis();
TopDocs hits = searcher.search(searchQuery);
long endTime = System.currentTimeMillis();
System.out.println("Aproximadamente " + hits.totalHits + " resultados (" + (endTime - startTime) + " segundos)");
for (ScoreDoc scoreDoc : hits.scoreDocs) {
Document doc = searcher.getDocument(scoreDoc);
File frDoc = new File(doc.get(DataConstants.FILE_PATH));
BufferedReader brDoc = new BufferedReader(new InputStreamReader(new FileInputStream(frDoc), "ISO-8859-1"));
while (brDoc.ready()) {
String linha = brDoc.readLine();
if (contLinha < 3) {
System.out.println("" + linha.trim());
}
contLinha++;
}
contLinha = 0;
}
}
Alguem tem alguma ideia de como acrescentarei a paginação.
att