I want to make a search using lucene and having sorting by relevance amongs the document name and its content . When I gather hits in TopDocs like :
Code: <code> QueryParser parserC = new QueryParser(Version.LUCENE_30, "contents", new StandardAnalyzer(Version.LUCENE_30)); QueryParser parserN = new QueryParser(Version.LUCENE_30, "filename", new StandardAnalyzer(Version.LUCENE_30)); QueryParser parserP = new QueryParser(Version.LUCENE_30, "fullpath", new StandardAnalyzer(Version.LUCENE_30)) Query queryC = parserC.parse(q); Query queryN = parserN.parse(q); Query queryP = parserP.parse(q); TopDocs hits = is.search(queryC, 10); hits = is.search(queryN, 10); hits = is.search(queryP, 10); </code> The content of hits is replaced everytime and its value is is.search(queryP, 10) Is there any method (like add or something or even a collector) to store all the results in one TopDocs hit and make a sort by relevance . Thank you . ps : excuse me for my very bad english . -- View this message in context: http://lucene.472066.n3.nabble.com/Search-and-relevance-by-document-name-and-content-tp2588786p2588786.html Sent from the Lucene - General mailing list archive at Nabble.com.