Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 14400 invoked from network); 30 Sep 2002 03:47:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Sep 2002 03:47:25 -0000 Received: (qmail 8212 invoked by uid 97); 30 Sep 2002 03:48:13 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 8181 invoked by uid 97); 30 Sep 2002 03:48:12 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 8169 invoked by uid 98); 30 Sep 2002 03:48:12 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <20020930034728.5478.qmail@web12707.mail.yahoo.com> Date: Sun, 29 Sep 2002 20:47:28 -0700 (PDT) From: Otis Gospodnetic Subject: Re: Question on the use of MultiFieldQueryParser To: Lucene Users List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello, Heh, I jsut returned from Cambridge to NYC. I don't have time to look through the old code that I wrote, which used MultiFieldQueryParser class, but the class does work as described in its API. The problem might be elsewhere. The code in the original email also looks like it's not the real code (hits vs. resultSet). But it looks correct otherwise, as far as I can tell. Otis --- Richard Belanger wrote: > > Hi: > > I am trying to use a MultiFieldQueryParser to query across three Text > fields (title, author, and content) where content is a large XML file > that > has had the XML tags stripped out. The result set I get back seems > to be > from only one field, though - the one with the highest scoring > document. > Ideally I would like to get back a result set with results from all > three > fields and then make my own decisions on results to display. Any > suggestions for how to do that would be greatly appreciated. Here's > what I > am doing now: > > String qFields[] = new String[3]; > qFields[0] = "contents"; > qFields[1] = "title"; > qFields[2] = "author"; > > Searcher searcher = new IndexSearcher(IndexDir); > Analyzer analyzer = new StandardAnalyzer(); > Query query = > MultiFieldQueryParser.parse(instring,qFields, > analyzer); > hits = searcher.search(query); > > for (int i = 0 ; i < resultSet.length() ; i++) { > thisscore = Math.round(resultSet.score(i) * 100); > if (thisscore > 10 ) { > Document doc = resultSet.doc(i); > String path = doc.get("path"); > String title = doc.get("title") + " (" + thisscore + "%)"; > v.addElement(title); } } > > > Thanks, > > Rich > > Richard C. Belanger > Chief Technology Officer > Forrester Research > 400 Technology Square > Cambridge, MA 02139 > > rbelanger@forrester.com > http://www.forrester.com > > > -- > To unsubscribe, e-mail: > > For additional commands, e-mail: > > __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: