add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / src / site / src / documentation / content / xdocs / demo.xml
1 <?xml version="1.0"?>
2 <document>
3         <header>
4         <title>
5         Apache Lucene - Building and Installing the Basic Demo
6                 </title>
7         </header>
8 <properties>
9 <author email="acoliver@apache.org">Andrew C. Oliver</author>
10 </properties>
11 <body>
12
13 <section id="About this Document"><title>About this Document</title>
14 <p>
15 This document is intended as a "getting started" guide to using and running the Lucene demos.
16 It walks you through some basic installation and configuration.
17 </p>
18 </section>
19
20
21 <section id="About the Demo"><title>About the Demo</title>
22 <p>
23 The Lucene command-line demo code consists of an application that demonstrates various
24 functionalities of Lucene and how you can add Lucene to your applications.
25 </p>
26 </section>
27
28 <section id="Setting your CLASSPATH"><title>Setting your CLASSPATH</title>
29 <p>
30 First, you should <a href="http://www.apache.org/dyn/closer.cgi/lucene/java/">download</a> the
31 latest Lucene distribution and then extract it to a working directory.
32 </p>
33 <p>
34 You need two JARs: the Lucene JAR, and the Lucene demo JAR.  You should
35 see the Lucene JAR file in the directory you created when you extracted the archive -- it
36 should be named something like <code>lucene-core-{version}.jar</code>.  You should also see a file
37 called <code>contrib/demo/lucene-demo-{version}.jar</code>.
38 </p>
39 <p>
40 Put both of these files in your Java CLASSPATH.
41 </p>
42 </section>
43
44 <section id="Indexing Files"><title>Indexing Files</title>
45 <p>
46 Once you've gotten this far you're probably itching to go.  Let's <b>build an index!</b> Assuming
47 you've set your CLASSPATH correctly, just type:
48
49 <pre>
50     java org.apache.lucene.demo.IndexFiles -docs {path-to-lucene}/src
51 </pre>
52
53 This will produce a subdirectory called <code>index</code> which will contain an index of all of the
54 Lucene source code.
55 </p>
56 <p>
57 To <b>search the index</b> type:
58
59 <pre>
60     java org.apache.lucene.demo.SearchFiles
61 </pre>
62
63 You'll be prompted for a query.  Type in a swear word and press the enter key.  You'll see that the
64 Lucene developers are very well mannered and get no results. Now try entering the word "string".
65 That should return a whole bunch of documents.  The results will page at every tenth result and ask
66 you whether you want more results.
67 </p>
68 </section>
69
70 <section id="About the code..."><title>About the code...</title>
71 <p>
72 <a href="demo2.html">read on&gt;&gt;&gt;</a>
73 </p>
74 </section>
75
76 </body>
77 </document>
78