Print

Print


Thanks Erik and Bess.  Erik:  Lamentably, your

java -cp lucene-core-2.0.0.jar:lucene-demos-2.0.0.jar
org.apache.lucene.demo.IndexFiles src/

threw the same error.  I'm going to take a look at the LuceneInAction
codebase and see if I can get it working that way.  Thanks for taking
the time to install 2.0.0.  I don't know how I ended up with 2.0.1
jars--they appeared when I ran ant . . . .

Bess:  Thanks for the advice.  I'm going to give things a whirl this way, too.

Yours,

Andrew

On 1/11/07, Bess Sadler <[log in to unmask]> wrote:
> Hi, Andrew and all the other code4libbers,
>
> I wanted to add that if your goal is to prepare for the pre-
> conference, it probably isn't necessary to get down and dirty with
> the lucene libraries. Of course I would never discourage anyone from
> playing around with them, but at the same time please don't feel you
> need to do that in order to participate in the pre-conference.
>
> Before solr, if you wanted to use lucene you had to call the low-
> level lucene libraries directly and write your own lucene
> implementation. Solr provides a very convenient wrapper for it all,
> though, and it's much easier to use. Instead of accessing the lucene
> libraries directly, you just fire up solr, massage your data into an
> XML file that matches solr's expected input format, and POST your XML
> file to a solr URL. They even provide you with a script to do the
> POSTing. You can learn all this from the solr demo and tutorial,
> available here: http://incubator.apache.org/solr/tutorial.html
>
> So, if you're not all that good with java, and you just want to be
> able to create and search a lucene index without spending the next
> month learning a new programming language, I strongly recommend
> skipping the lucene bit and jumping right into solr.
>
> Just my $0.02,
> Bess
>
> On Jan 11, 2007, at 11:26 AM, Erik Hatcher wrote:
>
> > Andrew,
> >
> >
> >
> >
> > On Jan 11, 2007, at 10:47 AM, Andrew Darby wrote:
> >> Hello, all.  I'm trying to get started with Lucene for the Code4Lib
> >> preconference
> >
> > Excellent!!!
> >
> >> and was wondering if someone could help.
> >
> > Of course....
> >
> >> I'm trying to
> >> do the first example from the Lucene site
> >> (http://lucene.apache.org/java/docs/demo.html) on my Windows XP
> >> machine but when I try to build the test index from the command line
> >> like so:
> >>
> >> C:\lucene-2.0.0>java org.apache.lucene.demo.IndexFiles C:
> >> \lucene-2.0.0/src
> >>
> >> I get the following error:
> >>
> >> Exception in thread "main" java.lang.NoClassDefFoundError:
> >> org/apache/lucene/demo/IndexFiles
> >>
> >> My CLASSPATH looks like this:
> >>
> >> .;C:\Program Files\QuickTime\QTSystem\QTJava.zip;C:\lucene-2.0.0
> >> \build\lucene-core-2.0.1-dev.jar;C:\lucene-2.0.0\build\lucene-
> >> demos-2.0.1-dev.jar;
> >
> > 2.0.1?  Where'd you get that version?
> >
> > I pulled down the latest stable release, 2.0.0, just now to run
> > through this myself.
> >
> > Rather than setting CLASSPATH (an evil thing in the Java world, it
> > can really bite you at inopportune times), I ran it this way
> > successfully:
> >
> > java -cp lucene-core-2.0.0.jar:lucene-demos-2.0.0.jar
> > org.apache.lucene.demo.IndexFiles src/
> >
> >> I assume this is a basic error, and something to do with the
> >> classpath, but as best I can tell everything is correct, the
> >> IndexFiles.class file is where it should be, etc.  I'm not familiar
> >> with Java, if you haven't guessed.  Any suggestions?
> >
> > Sadly the demo that ships with Lucene is pretty weak.  For more
> > examples, grab the Lucene in Action (LIA) codebase from http://
> > www.lucenebook.com and fire it up simply by typing "ant" and
> > following the instructions in the README too.  That code is for
> > Lucene 1.4.3 - 1.9.x.  Lucene 2.0 removed deprecated methods, and
> > there are a few tidbits of trivia to adjust LIA code to Lucene 2.0
> > available here:
> >
> >        <http://www.nabble.com/Lucene-in-Action-examples-complie-
> > problem-
> > tf2418478.html#a6743189>
> >
> > The demo that ships with Lucene is barely usable for anything other
> > than "yeah, it can search text, but boy is it a hassle to run".  Keep
> > in mind that Lucene is a low-level library, so for there to be much
> > of use out of it, you have to build something around it.  The Indexer
> > and Searcher command-line apps in the LIA code base provide a better
> > working demo "out of the box", but still quite crude.
> >
> >        Erik
>
> Elizabeth (Bess) Sadler
> Head, Technical and Metadata Services
> Digital Scholarship Services
> Box 400129
> Alderman Library
> University of Virginia
> Charlottesville, VA 22904
>
> [log in to unmask]
> (434) 243-2305
>


--
Andrew Darby
Web Services Librarian
Ithaca College Library
http://www.ithaca.edu/library/
[log in to unmask]