Return-Path: Delivered-To: apmail-lucene-general-archive@www.apache.org Received: (qmail 15298 invoked from network); 27 Feb 2011 15:32:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Feb 2011 15:32:58 -0000 Received: (qmail 79122 invoked by uid 500); 27 Feb 2011 15:32:58 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 78788 invoked by uid 500); 27 Feb 2011 15:32:55 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Delivered-To: moderator for general@lucene.apache.org Received: (qmail 71532 invoked by uid 99); 27 Feb 2011 15:27:41 -0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=FREEMAIL_FROM,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of morofiler@gmail.com) Date: Sun, 27 Feb 2011 07:27:15 -0800 (PST) From: morofiler To: general@lucene.apache.org Message-ID: <1298820435408-2588786.post@n3.nabble.com> Subject: Search and relevance by document name and content MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 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); 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.