I am trying to search from lucene index. I want to get unique results, but also return duplicate results. I searched on google and found that this can be done using the collector. How can i achieve this?
I am using the following code:
File outputdir= new File("path upto lucene directory");
Directory directory = FSDirectory.open(outputdir);
IndexSearcher= new IndexSearcher(directory,true);
QueryParser queryparser = new QueryParser(Version.LUCENE_36, "keyword", new StandardAnalyzer(Version.LUCENE_36));
Query query = queryparser.parse("central");
topdocs = indexSearcher.search(query, maxhits);
ScoreDoc[] score = topdocs.scoreDocs;
int length = score.length;
source
share