Hi:
Thanks for the note. The code is actually taken from two different methods hence the different variable names for the Hits object. Does anyone have more detailed doc on MultiFieldQuery? I can always start browsing the source but that usually takes a little time... Rich Richard C. Belanger Chief Technology Officer Forrester Research 400 Technology Square Cambridge, MA 02139 [EMAIL PROTECTED] http://www.forrester.com Otis Gospodnetic <otis_gospodnetic@ To: Lucene Users List <[EMAIL PROTECTED]> yahoo.com> cc: Subject: Re: Question on the use of MultiFieldQueryParser 09/29/2002 11:47 PM Please respond to "Lucene Users List" 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 <[EMAIL PROTECTED]> 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 > > [EMAIL PROTECTED] > http://www.forrester.com > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: < mailto:[EMAIL PROTECTED]> For additional commands, e-mail: < mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
