Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 17328 invoked from network); 13 Jul 2005 12:23:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2005 12:23:51 -0000 Received: (qmail 5436 invoked by uid 500); 13 Jul 2005 12:23:41 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 5401 invoked by uid 500); 13 Jul 2005 12:23:40 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 5209 invoked by uid 99); 13 Jul 2005 12:23:39 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2005 05:23:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [206.190.48.234] (HELO web52711.mail.yahoo.com) (206.190.48.234) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 13 Jul 2005 05:23:34 -0700 Received: (qmail 4475 invoked by uid 60001); 13 Jul 2005 12:23:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=UMeYqTVHexvaZwK2cWgoQ23ll+Xp1DEHFBmXSkb2AKpO9xgrG+RnTiUUbuFW9SFzpVx5eRWxtk6VEQ+IdW8E5egXK2gAObYLj36S0zfAwOoMS9ARheHkT0TB/49RhjQ3qgJ1o6y8ErYjy0QgFWyzlP9ub2506A7ZX6ymIXvE+dQ= ; Message-ID: <20050713122335.4473.qmail@web52711.mail.yahoo.com> Received: from [84.162.100.158] by web52711.mail.yahoo.com via HTTP; Wed, 13 Jul 2005 05:23:35 PDT Date: Wed, 13 Jul 2005 05:23:35 -0700 (PDT) From: Klaus Hubert Subject: RE: SIMPLE Lucene / MySQL Indexer To: java-user@lucene.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Xing, I have the book and as I wrote in my initial message I managed to create the sample index as well managed to read mySQL. But I seem to be not able to combine those programs :-( I'm very new to Java and I haven't found a nice Debugger so far to go step by step through my code. I will try today all day to get this fixed. I know, it shouldn't be too difficult. Thank you, Klaus -----Original Message----- From: Xing Li [mailto:xing@mac.com] Sent: Wednesday, July 13, 2005 2:15 PM To: java-user@lucene.apache.org Subject: RE: SIMPLE Lucene / MySQL Indexer Don't make the mistake of complicating the task. Just read straight from mysql into lucene via java. There is no benefit of exporting data to xml just to regrab the data back into lucene. Get the Lucene In actioin book if you haven't cause all the samples there are real-world practical. Are you need to add is 10 lines of mysql type java/jdbc code and you are ready to create your first index. Download luke for lucene, GUI testing tool so you can browse the index, perform searches, validate/test search performan bottlenecks, dissect queries, etc. On Wednesday, July 13, 2005, at 05:04AM, Klaus Hubert wrote: >Hi Ian, > >That's something I'm looking for. Right, a simple source code which >reads a database and adds the fields to the index. What I've found also >so far is another solution at >http://www-128.ibm.com/developerworks/java/library/j-lucene/. >First step is >to export my MySQL database in simple XML and go from there. It is just >an additional step and I would stick with this if I don't find another >method to do all at once. > >Thanks, > > Klaus > >-----Original Message----- >From: Ian Lea [mailto:ian.lea@gmail.com] >Sent: Wednesday, July 13, 2005 10:19 AM >To: java-user@lucene.apache.org >Subject: Re: SIMPLE Lucene / MySQL Indexer > >Something like this? > >IndexWriter iw = whatever >ResultSet rs = whatever > >while (rs.next()) { > Document ldoc = new Document(); > ldoc.add(Field.Text("f1", rs.getString("f1")); > ldoc.add(Field.Unstored("f2", rs.getString("f2")); > ldoc.add(Field.Keyword("f3", rs.getString("f3")); > ... > iw.addDocument(ldoc); >} > >rs.close(); >iw.close(); > > >On the IDE front, most people seem to use Eclipse nowadays. > > >-- >Ian. > >On 13/07/05, Klaus Hubert >wrote: >> Hi, >> >> I played with several search engines to replace >MySQL FULLTEXT index >> and hope that Lucene is the best solution for that. >> >> I am reading Mannings book on Lucene in action and >it seems to be the >> most powerful search engine I found so far. >> >> I'm stuck at some problem and need help from you >experts. I managed to >> create an index as described in the examples. I also >managed to read a >> MySQL database in Java. >> >> My question is, if anybody here has some SIMPLE >example which does >> this in one step. I am good in PHP and in Visual >Basic, but very new >> to Java. Maybe I'm using the wrong tools (NetBeans >IDE and JCreator) >> but I don't get it managed to create an Lucene Index >on 3 database >> fields. >> >> I appreciate any help. >> >> Thank you so much, >> >> Klaus > >--------------------------------------------------------------------- >To unsubscribe, e-mail: >java-user-unsubscribe@lucene.apache.org >For additional commands, e-mail: >java-user-help@lucene.apache.org > > > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > >--------------------------------------------------------------------- >To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >For additional commands, e-mail: java-user-help@lucene.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org