This commit was manufactured by cvs2svn to create tag
'lucene_1_2_rc1'.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/tags/lucene_1_2_rc1@149602 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..ce644bd
--- /dev/null
+++ b/.cvsignore
@@ -0,0 +1,3 @@
+bin
+*~
+velocity.log
diff --git a/API.html b/API.html
new file mode 100644
index 0000000..4c76acd
--- /dev/null
+++ b/API.html
@@ -0,0 +1,174 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+   <meta name="Author" content="Doug Cutting">
+   <meta name="GENERATOR" content="Mozilla/4.72 [en] (Win98; U) [Netscape]">
+   <title>Lucene API Documentation</title>
+</head>
+<body>
+
+<h1>
+Lucene API Documentation</h1>
+The <a href="http://www.lucene.com">Lucene</a> API is divided into several
+packages:
+<ul>
+<li>
+<b><a href="api/com/lucene/util/package-summary.html">com.lucene.util</a></b>
+contains a few handy data structures, e.g., <a href="api/com/lucene/util/BitVector.html">BitVector</a>
+and <a href="api/com/lucene/util/PriorityQueue.html">PriorityQueue</a>.</li>
+
+<li>
+<b><a href="api/com/lucene/store/package-summary.html">com.lucene.store</a></b>
+defines an abstract class for storing persistent data, the <a href="api/com/lucene/store/Directory.html">Directory</a>,
+a collection of named files written by an <a href="api/com/lucene/store/OutputStream.html">OutputStream</a>
+and read by an <a href="api/com/lucene/store/InputStream.html">InputStream</a>.&nbsp;
+Two implementations are provided, <a href="api/com/lucene/store/FSDirectory.html">FSDirectory</a>,
+which uses a file system directory to store files, and <a href="api/com/lucene/store/RAMDirectory.html">RAMDirectory</a>
+which implements files as memory-resident data structures.</li>
+
+<li>
+<b><a href="api/com/lucene/document/package-summary.html">com.lucene.document</a></b>
+provides a simple <a href="api/com/lucene/document/Document.html">Document</a>
+class.&nbsp; A document is simply a set of named <a href="api/com/lucene/document/Field.html">Field</a>'s,
+whose values may be strings or instances of <a href="http://java.sun.com/products/jdk/1.2/docs/api/java/io/Reader.html">java.io.Reader</a>.</li>
+
+<li>
+<b><a href="api/com/lucene/analysis/package-summary.html">com.lucene.analysis</a></b>
+defines an abstract <a href="api/com/lucene/analysis/Analyzer.html">Analyzer</a>
+API for converting text from a <a href="http://java.sun.com/products/jdk/1.2/docs/api/java/io/Reader.html">java.io.Reader</a>
+into a <a href="api/com/lucene/analysis/TokenStream.html">TokenStream</a>,
+an enumeration of&nbsp; <a href="api/com/lucene/analysis/Token.html">Token</a>'s.&nbsp;
+A TokenStream is composed by applying <a href="api/com/lucene/analysis/TokenFilter.html">TokenFilter</a>'s
+to the output of a <a href="api/com/lucene/analysis/Tokenizer.html">Tokenizer</a>.&nbsp;
+A few simple implemenations are provided, including <a href="api/com/lucene/analysis/StopAnalyzer.html">StopAnalyzer</a>
+and the grammar-based <a href="api/com/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>.</li>
+
+<li>
+<b><a href="api/com/lucene/index/package-summary.html">com.lucene.index</a></b>
+provides two primary classes: <a href="api/com/lucene/index/IndexWriter.html">IndexWriter</a>,
+which creates and adds documents to indices; and <a href="api/com/lucene/index/IndexReader.html">IndexReader</a>,
+which accesses the data in the index.</li>
+
+<li>
+<b><a href="api/com/lucene/search/package-summary.html">com.lucene.search</a></b>
+provides data structures to represent queries (<a href="api/com/lucene/search/TermQuery.html">TermQuery</a>
+for individual words, <a href="api/com/lucene/search/PhraseQuery.html">PhraseQuery</a>
+for phrases, and <a href="api/com/lucene/search/BooleanQuery.html">BooleanQuery</a>
+for boolean combinations of queries) and the abstract <a href="api/com/lucene/search/Searcher.html">Searcher</a>
+which turns queries into <a href="api/com/lucene/search/Hits.html">Hits</a>.
+<a href="api/com/lucene/search/IndexSearcher.html">IndexSearcher</a>
+implements search over a single IndexReader.</li>
+
+<li>
+<b><a href="api/com/lucene/queryParser/package-summary.html">com.lucene.queryParser</a></b>
+uses <a href="http://www.suntest.com/JavaCC/">JavaCC</a> to implement a
+<a href="api/com/lucene/queryParser/QueryParser.html">QueryParser</a>.</li>
+</ul>
+To use Lucene, an application should:
+<ol>
+<li>
+Create <a href="api/com/lucene/document/Document.html">Document</a>'s by
+adding
+<a href="api/com/lucene/document/Field.html">Field</a>'s.</li>
+
+<li>
+Create an <a href="api/com/lucene/index/IndexWriter.html">IndexWriter</a>
+and add documents to to it with <a href="api/com/lucene/index/IndexWriter.html#addDocument(com.lucene.document.Document)">addDocument()</a>;</li>
+
+<li>
+Call <a href="api/com/lucene/queryParser/QueryParser.html#parse(java.lang.String)">QueryParser.parse()</a>
+to build a query from a string; and</li>
+
+<li>
+Create an <a href="api/com/lucene/search/IndexSearcher.html">IndexSearcher</a>
+and pass the query to it's <a href="api/com/lucene/search/Searcher.html#search(com.lucene.search.Query)">search()</a>
+method.</li>
+</ol>
+Some simple examples of code which does this are:
+<ul>
+<li>
+&nbsp;<a href="../demo/FileDocument.java">FileDocument.java</a> contains
+code to create a Document for a file.</li>
+
+<li>
+&nbsp;<a href="../demo/IndexFiles.java">IndexFiles.java</a> creates an
+index for all the files contained in a directory.</li>
+
+<li>
+&nbsp;<a href="../demo/DeleteFiles.java">DeleteFiles.java</a> deletes some
+of these files from the index.</li>
+
+<li>
+&nbsp;<a href="../demo/SearchFiles.java">SearchFiles.java</a> prompts for
+queries and searches an index.</li>
+</ul>
+To demonstrate these, try:
+<blockquote><tt>F:\> <b>java demo.IndexFiles rec.food.recipes\soups</b></tt>
+<br><tt>adding rec.food.recipes\soups\abalone-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... ]
+<p><tt>F:\> <b>java demo.SearchFiles</b></tt>
+<br><tt>Query: <b>chowder</b></tt>
+<br><tt>Searching for: chowder</tt>
+<br><tt>34 total matching documents</tt>
+<br><tt>0. rec.food.recipes\soups\spam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... thirty-four documents contain the word "chowder",
+"spam-chowder" with the greatest density.]
+<p><tt>Query: <b>path:chowder</b></tt>
+<br><tt>Searching for: path:chowder</tt>
+<br><tt>31 total matching documents</tt>
+<br><tt>0. rec.food.recipes\soups\abalone-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... only thrity-one have "chowder" in the "path"
+field. ]
+<p><tt>Query: <b>path:"clam chowder"</b></tt>
+<br><tt>Searching for: path:"clam chowder"</tt>
+<br><tt>10 total matching documents</tt>
+<br><tt>0. rec.food.recipes\soups\clam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... only ten have "clam chowder" in the "path" field.
+]
+<p><tt>Query: <b>path:"clam chowder" AND manhattan</b></tt>
+<br><tt>Searching for: +path:"clam chowder" +manhattan</tt>
+<br><tt>2 total matching documents</tt>
+<br><tt>0. rec.food.recipes\soups\clam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... only two also have "manhattan" in the contents.
+]
+<br>&nbsp;&nbsp;&nbsp; [ Note: "+" and "-" are canonical, but "AND", "OR"
+and "NOT" may be used. ]</blockquote>
+The <a href="../demo/IndexHTML.java">IndexHtml</a> demo is more sophisticated.&nbsp;
+It incrementally maintains an index of HTML files, adding new files as
+they appear, deleting old files as they disappear and re-indexing files
+as they change.
+<blockquote><tt>F:\><b>java demo.IndexHTML -create java\jdk1.1.6\docs\relnotes</b></tt>
+<br><tt>adding java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt>
+<br><tt>&nbsp; </tt>[ ... create an index containing all the relnotes ]
+<p><tt>F:\><b>del java\jdk1.1.6\docs\relnotes\smicopyright.html</b></tt>
+<p><tt>F:\><b>java demo.IndexHTML java\jdk1.1.6\docs\relnotes</b></tt>
+<br><tt>deleting java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt></blockquote>
+HTML indexes are searched using SUN's <a href="http://jserv.javasoft.com/products/webserver/index.html">JavaWebServer</a>
+(JWS) and <a href="../demo/Search.jhtml">Search.jhtml</a>.&nbsp; To use
+this:
+<ul>
+<li>
+copy <tt>Search.html</tt> and <tt>Search.jhtml</tt> to JWS's <tt>public_html</tt>
+directory;</li>
+
+<li>
+copy lucene.jar to JWS's lib directory;</li>
+
+<li>
+create and maintain your indexes with demo.IndexHTML in JWS's top-level
+directory;</li>
+
+<li>
+launch JWS, with the <tt>demo</tt> directory on CLASSPATH (only one class
+is actually needed);</li>
+
+<li>
+visit <a href="../demo/Search.html">Search.html</a>.</li>
+</ul>
+Note that indexes can be updated while searches are going on.&nbsp; <tt>Search.jhtml</tt>
+will re-open the index when it is updated so that the latest version is
+immediately available.
+<br>&nbsp;
+</body>
+</html>
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..388a2f0
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,53 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ *    "Apache Lucene" must not be used to endorse or promote products
+ *    derived from this software without prior written permission. For
+ *    written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    "Apache Lucene", nor may "Apache" appear in their name, without
+ *    prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
diff --git a/build.bat b/build.bat
new file mode 100755
index 0000000..98147a3
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,9 @@
+@echo off
+
+for %%i in (.\lib\*.jar) do call cpappend.bat %%i
+
+echo CLASSPATH="%_CP%"
+
+java -classpath "%_CP%" org.apache.tools.ant.Main -Dant.home=%_AH% %1 %2 %3
+
+SET _CP=
diff --git a/build.properties b/build.properties
new file mode 100644
index 0000000..ad065b4
--- /dev/null
+++ b/build.properties
@@ -0,0 +1,50 @@
+# ---------------------------------------------------------
+# L U C E N E  B U I L D  P R O P E R T I E S
+# ---------------------------------------------------------
+name=lucene
+Name=Lucene
+version=1.2-rc1
+year=2000-2001
+final.name=${name}-${version}
+debug=off
+
+project.name = site
+docs.src =  ./xdocs
+docs.dest = ./docs
+
+src.dir = ./src/java
+demo.src = ./src/demo
+test.src = ./src/test
+docs.dir = ./docs
+lib.dir = ./lib
+dist.dir=${final.name}
+
+# javadoc packages
+packages=org.apache.lucene.*
+
+# javadoc link
+javadoc.link=http://java.sun.com/products/jdk/1.3/docs/api/
+
+build.dir = ./bin
+build.classes = ${build.dir}/classes
+build.lib = ${build.dir}/lib
+build.javadocs = ${build.dir}/docs/api
+build.src = ${build.dir}/src
+
+build.demo = ${build.dir}/demo
+build.demo.src = ${build.demo}/src
+build.demo.classes = ${build.demo}/classes
+
+build.test = ${build.dir}/test
+build.test.src = ${build.test}/src
+build.test.classes = ${build.test}/classes
+
+junit.src = ${basedir}/test/unit
+junit.classes = ${build.dir}/unit-classes
+junit.reports = ${build.dir}/unit-reports
+
+# Home directory of JavaCC
+javacc.home = ./
+javacc.zip.dir = ${javacc.home}/lib
+javacc.zip = ${javacc.zip.dir}/JavaCC.zip
+
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..3397ffd
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+if [ "$JAVA_HOME" = "" ] ; then
+  echo You must set JAVA_HOME to point at your Java Development Kit directory
+  exit 1
+fi
+
+# convert the existing path to unix
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+   CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# Add in your .jar files first
+for i in ./lib/*.jar
+do
+    CLASSPATH=$CLASSPATH:"$i"
+done
+# Add in the jakarta-site2 library files
+for i in ../jakarta-site2/lib/*.jar
+do
+    CLASSPATH=$CLASSPATH:"$i"
+done
+
+# convert the unix path to windows
+if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
+   CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+fi
+
+BUILDFILE=build.xml
+
+#echo $CLASSPATH
+
+java $ANT_OPTS -classpath "$CLASSPATH" org.apache.tools.ant.Main \
+                -Dant.home=$ANT_HOME \
+                -buildfile ${BUILDFILE} \
+                 "$@"
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..d3841f7
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,381 @@
+<?xml version="1.0"?>
+
+<project name="Lucene" default="jar" basedir=".">
+
+  <property file="${user.home}/build.properties"/>
+  <property file="build.properties"/>
+
+  <!-- Build classpath -->
+  <path id="classpath">
+    <pathelement location="${build.classes}"/>
+    <pathelement location="${build.demo.classes}"/>
+    <pathelement location="${build.test.classes}"/>
+    <pathelement location="."/>
+    <fileset dir="lib">
+      <include name="*.jar" />
+    </fileset>
+  </path>
+
+  <path id="junit.classpath">
+    <pathelement location="${junit.classes}" />
+    <pathelement location="${build.classes}"/>
+    <fileset dir="lib">
+      <include name="*.jar" />
+    </fileset>
+    <pathelement path="${java.class.path}" />
+  </path>
+
+  <!-- ================================================================== -->
+  <!-- Prepares the build directory                                       -->
+  <!-- ================================================================== -->
+  <target name="init">
+    <mkdir dir="${build.dir}"/>
+    <mkdir dir="${build.classes}"/>
+    <mkdir dir="${build.src}"/>
+    
+    <available 
+      property="javacc.present" 
+      classname="COM.sun.labs.javacc.Main"
+      classpath="${javacc.zip}"
+    />
+    
+    <available 
+      property="junit.present" 
+      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
+    />
+  </target>
+
+  <target name="javacc_check" depends="init" unless="javacc.present">
+    <echo>
+      ##################################################################
+      JavaCC not found.  
+      JavaCC Home: ${javacc.home}
+      JavaCC Zip: ${javacc.zip}
+
+      Please download and install JavaCC 2.0 from:
+
+      &lt;http://www.webgain.com/products/metamata/java_doc.html&gt;
+
+      Then, create a .ant.properties file either in your home
+      directory, or within the Lucene directory and set the javacc.home
+      property to the path where JavaCC.zip is located. For example,
+      if you installed JavaCC in /usr/local/java/javacc2.0, then set the
+      javacc.home property to:
+
+      javacc.home=/usr/local/java/javacc2.0/bin/lib
+
+      If you get an error like the one below, then you have not installed
+      things correctly. Please check all your paths and try again.
+
+      java.lang.NoClassDefFoundError: COM/sun/labs/javacc/Main
+      ##################################################################
+    </echo>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- C O M P I L E                                                      -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="compile" depends="init,javacc_check" if="javacc.present">
+    <mkdir dir="${build.src}/org/apache/lucene/analysis/standard"/>
+    <javacc 
+      target="${src.dir}/org/apache/lucene/analysis/standard/StandardTokenizer.jj" 
+      javacchome="${javacc.zip.dir}"
+      outputdirectory="${build.src}/org/apache/lucene/analysis/standard"
+    />
+    
+    <delete file="${build.src}/org/apache/lucene/analysis/standard/ParseException.java"/>
+    <mkdir dir="${build.src}/org/apache/lucene/queryParser"/>
+    <javacc 
+      target="${src.dir}/org/apache/lucene/queryParser/QueryParser.jj" 
+      javacchome="${javacc.zip.dir}"
+      outputdirectory="${build.src}/org/apache/lucene/queryParser"
+    />
+        
+    <javac 
+      srcdir="${src.dir}:${build.src}" 
+      includes="org/**/*.java" 
+      destdir="${build.classes}" 
+      debug="${debug}">
+      <classpath refid="classpath"/>
+    </javac>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- J A R                                                              -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="jar" depends="compile" if="javacc.present">
+    <jar 
+      jarfile="${build.dir}/${final.name}.jar" 
+      basedir="${build.classes}"
+    />
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- B U I L D  D E M O                                                 -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="demo" depends="compile" if="javacc.present">
+    <mkdir dir="${build.demo}"/>
+    
+    <copy todir="${build.demo.src}">
+      <fileset dir="${demo.src}">
+        <include name="**/*.java"/>
+        <include name="**/*.jj"/>
+      </fileset>
+    </copy>
+    
+    <javacc 
+      target="${build.demo.src}/org/apache/lucene/HTMLParser/HTMLParser.jj" 
+      javacchome="${javacc.zip.dir}"
+      outputdirectory="${build.demo.src}/org/apache/lucene/HTMLParser"
+    />
+    
+    <mkdir dir="${build.demo.classes}"/>
+    
+    <javac 
+      srcdir="${build.demo.src}"
+      includes="**/*.java"
+      destdir="${build.demo.classes}"
+      debug="${debug}">
+      <classpath refid="classpath"/>
+    </javac>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- B U I L D  T E S T                                                 -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="test" depends="compile,demo">
+    <mkdir dir="${build.test}"/>
+
+    <copy todir="${build.test.src}">
+      <fileset dir="${test.src}">
+        <include name="**/*.java"/>
+      </fileset>
+    </copy>
+
+    <mkdir dir="${build.test.classes}"/>
+
+    <javac 
+      srcdir="${build.test.src}"
+      includes="**/*.java"
+      destdir="${build.test.classes}"
+      debug="${debug}">
+      <classpath refid="classpath"/>
+    </javac>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- R U N  T E S T S                                                   -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="test-unit" depends="compile" if="junit.present">
+    <!-- Import JUnit task -->
+    <taskdef 
+      name="junit" 
+      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
+    />
+
+    <mkdir dir="${junit.classes}"/>
+    <mkdir dir="${junit.reports}"/>
+    <javac 
+      srcdir="${junit.src}" 
+      includes="**/*.java" 
+      destdir="${junit.classes}" 
+      debug="${debug}">
+      <classpath refid="classpath"/>
+    </javac>      
+
+    <junit printsummary="yes" haltonfailure="no" >
+      <classpath refid="junit.classpath"/>
+      <formatter type="plain" />
+      <batchtest fork="yes" todir="${junit.reports}">
+        <fileset dir="${junit.src}" includes="**/Test*.java" />
+      </batchtest>
+    </junit>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- D O C U M E N T A T I O N                                          -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="docs-prepare">
+    <available 
+      classname="org.apache.velocity.anakia.AnakiaTask" 
+      property="AnakiaTask.present"
+      classpathref="classpath"
+    />
+  </target>
+
+  <target depends="docs-prepare" name="prepare-error" unless="AnakiaTask.present">
+    <echo>
+      AnakiaTask is not present! Please check to make sure that 
+      velocity.jar is in your classpath.
+    </echo>
+  </target>
+
+  <target name="docs" depends="prepare-error" if="AnakiaTask.present">
+    <taskdef 
+      name="anakia" 
+      classname="org.apache.velocity.anakia.AnakiaTask"
+      >
+      <classpath refid="classpath"/>
+    </taskdef>
+      
+    <anakia 
+      basedir="${docs.src}" 
+      destdir="${docs.dest}/"
+      extension=".html" style="./site.vsl"
+      projectFile="stylesheets/project.xml"
+      excludes="**/stylesheets/** empty.xml"
+      includes="**/*.xml"
+      lastModifiedCheck="true"
+      templatePath="../jakarta-site2/xdocs/stylesheets"
+    >
+    </anakia>
+
+    <copy todir="${docs.dest}/images" filtering="no">
+      <fileset dir="${docs.src}/images">
+        <include name="**/*.gif"/>
+        <include name="**/*.jpeg"/>
+        <include name="**/*.jpg"/>
+      </fileset>
+    </copy>
+    
+    <!-- In case we have CSS someday
+    <copy todir="${docs.dest}" filtering="no">
+      <fileset dir="${docs.src}">
+        <include name="**/*.css"/>
+      </fileset>
+    </copy>
+    -->
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- J A V A D O C                                                      -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="javadocs" depends="compile" if="javacc.present">
+    <mkdir dir="${build.javadocs}"/>
+    <javadoc
+      sourcepath="${src.dir}:${build.src}"
+      overview="${src.dir}/overview.html"
+      packagenames="${packages}"
+      destdir="${build.javadocs}"
+      author="true"
+      version="true"
+      use="true"
+      link="${javadoc.link}"
+      windowtitle="${Name} ${version} API"
+      doctitle="${Name} ${version} API"
+      bottom="Copyright &amp;copy; ${year} Apache Software Foundation.  All Rights Reserved."
+      >
+      <classpath refid="classpath"/>
+    </javadoc>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- D I S T R I B U T I O N                                            -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="package" depends="jar, javadocs, demo">
+    <mkdir dir="${dist.dir}"/>
+    <mkdir dir="${dist.dir}/docs"/>
+    <mkdir dir="${dist.dir}/docs/api"/>
+    <mkdir dir="${dist.dir}/demo"/>
+    <mkdir dir="${dist.dir}/demo/src"/>
+    <mkdir dir="${dist.dir}/demo/classes"/>
+
+    <copy todir="${dist.dir}/docs">
+      <fileset dir="${docs.dir}"/>
+    </copy>
+    <copy todir="${dist.dir}/docs/api">
+      <fileset dir="${build.javadocs}"/>
+    </copy>
+    <copy todir="${dist.dir}/demo/classes">
+      <fileset dir="${build.demo.classes}"/>
+    </copy>
+    <copy todir="${dist.dir}/demo/src">
+      <fileset dir="${build.demo.src}"/>
+    </copy>
+    <copy file="${build.dir}/${final.name}.jar" todir="${dist.dir}"/>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Packages the distribution with ZIP                                 -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="package-zip" depends="package"
+    description="--> generates the Lucene distribution as .zip">
+    
+    <delete file="${basedir}/${final.name}.zip"/>
+    <zip 
+      zipfile="${basedir}/${final.name}.zip" 
+      basedir="${basedir}/" 
+      includes="**/${final.name}/**"
+    />
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Packages the distribution with TAR-GZIP                            -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="package-tgz" depends="package"
+    description="--> generates the Lucene distribution as .tar.gz">
+    
+    <delete file="${basedir}/${final.name}.tar"/>
+    <delete file="${basedir}/${final.name}.tar.gz"/>
+    <tar 
+      tarfile="${basedir}/${final.name}.tar" 
+      basedir="${basedir}/" 
+      includes="**/${final.name}/**"
+    />
+    
+    <gzip 
+      zipfile="${basedir}/${final.name}.tar.gz" 
+      src="${basedir}/${final.name}.tar"
+    />
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Packages the distribution with ZIP and TAG-GZIP                    -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="package-all" depends="package-zip, package-tgz"
+    description="--> generates the .tar.gz and .zip distributions">
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Same as package-all. It is just here for compatibility.            -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="dist" depends="package-all">
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- C L E A N                                                          -->
+  <!-- ================================================================== -->
+  <!--                                                                    -->
+  <!-- ================================================================== -->
+  <target name="clean" depends="init">
+    <delete dir="${build.dir}"/>
+    <delete dir="${dist.dir}"/>
+    <delete file="${basedir}/${final.name}.tar"/>
+    <delete file="${basedir}/${final.name}.tar.gz"/>
+    <delete file="${basedir}/${final.name}.zip"/>
+  </target>
+</project>
diff --git a/cpappend.bat b/cpappend.bat
new file mode 100755
index 0000000..c625553
--- /dev/null
+++ b/cpappend.bat
@@ -0,0 +1 @@
+set _CP=%1;%_CP%
diff --git a/datasheet.html b/datasheet.html
new file mode 100644
index 0000000..3c53829
--- /dev/null
+++ b/datasheet.html
@@ -0,0 +1,128 @@
+<HTML>
+<HEAD>
+   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+   <META NAME="Author" CONTENT="Doug Cutting">
+   <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (Win95; U) [Netscape]">
+   <TITLE>Lucene: a full-text search engine in Java</TITLE>
+</HEAD>
+<BODY>
+
+<H1>
+Lucene</H1>
+Lucene is a full-text search engine written in Java.&nbsp; It is efficient,
+providing high-performance indexing and searching using few system resources.&nbsp;
+State-of-the-art search algorithms produce highest-quality search results.&nbsp;
+The use of Java allows easy integration with cross-platform applications.
+<H2>
+Potential Applications</H2>
+
+<UL>
+<LI>
+<B>Searchable E-Mail</B></LI>
+
+<BR>Search large e-mail archives instantly; update index as new messages
+arrive.
+<LI>
+<B>CD-ROM-based Online Documentation Search</B></LI>
+
+<BR>Search large publications quickly with platform-independent system.
+<LI>
+<B>Search Previously-Visited Web Pages</B></LI>
+
+<BR>Relocate a page seen weeks or months ago.
+<LI>
+<B>Web Site Searching</B></LI>
+
+<BR>Let users search all the pages on your website.</UL>
+
+<H2>
+Features</H2>
+
+<UL>
+<LI>
+<B>Scalable, High-Performance Indexing</B></LI>
+
+<DL>
+<DL>
+<LI>
+over 200MB/hour on Pentium II/266</LI>
+
+<LI>
+incremental indexing as fast as batch indexing</LI>
+
+<LI>
+small RAM requirements -- only 1MB heap</LI>
+
+<LI>
+index size roughly 30% the size of text indexed</LI>
+</DL>
+</DL>
+
+<LI>
+<B>Powerful, Accurate and Efficient Search Algorithms</B></LI>
+
+<DL>
+<DL>
+<LI>
+ranked searching -- best results returned first</LI>
+
+<LI>
+boolean and phrase queries</LI>
+
+<LI>
+fielded searching (e.g., title, author, contents)</LI>
+
+<LI>
+date-range searching</LI>
+
+<LI>
+<B><I>coming soon:</I></B></LI>
+
+<DL>
+<DL>
+<LI>
+<I>multiple-index searching with merged results</I></LI>
+
+<LI>
+<I>distributed searching over a network</I></LI>
+</DL>
+</DL>
+</DL>
+</DL>
+
+<LI>
+<B>Simple API's allow developers to:</B></LI>
+
+<DL>
+<DL>
+<LI>
+incorporate new document types</LI>
+
+<LI>
+localize for new languages (already handles most European languages)</LI>
+
+<LI>
+develop new user interfaces</LI>
+</DL>
+</DL>
+
+<LI>
+<B>Cross-Platform Solution</B></LI>
+
+<DL>
+<DL>
+<LI>
+100%-pure Java <I>(not yet certified)</I></LI>
+</DL>
+</DL>
+</UL>
+
+<H2>
+Contact</H2>
+
+<UL><B>Douglass R. Cutting</B>
+<BR>Email:&nbsp;&nbsp;&nbsp; cutting@lucene.com
+<BR>Phone:&nbsp;&nbsp; 1 (510) 595-0232</UL>
+
+</BODY>
+</HTML>
diff --git a/docs/features.html b/docs/features.html
new file mode 100644
index 0000000..d0d9a81
--- /dev/null
+++ b/docs/features.html
@@ -0,0 +1,209 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!-- Content Stylesheet for Site -->
+
+        
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+
+                                                    <meta name="author" value="Ted Husted">
+            <meta name="email" value="husted@apache.org">
+            
+            <title>Jakarta Lucene - Features - Jakarta Lucene</title>
+        </head>
+
+        <body bgcolor="#ffffff" text="#000000" link="#525D76">        
+            <table border="0" width="100%" cellspacing="0">
+                <!-- TOP IMAGE -->
+                <tr>
+                    <td align="left">
+<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
+</td>
+<td align="right">
+<a href="http://jakarta.apache.org/lucene/docs/"><img src="./images/lucene_green_300.gif" alt="Jakarta Lucene" border="0"/></a>
+</td>
+                </tr>
+            </table>
+            <table border="0" width="100%" cellspacing="4">
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                
+                <tr>
+                    <!-- LEFT SIDE NAVIGATION -->
+                    <td width="20%" valign="top" nowrap="true">
+                                <p><strong>About</strong></p>
+        <ul>
+                    <li>    <a href="./index.html">Overview</a>
+</li>
+                    <li>    <a href="./features.html">Features</a>
+</li>
+                    <li>    <a href="./applications.html">Applications</a>
+</li>
+                    <li>    <a href="./background.html">Background</a>
+</li>
+                </ul>
+            <p><strong>Documentation</strong></p>
+        <ul>
+                    <li>    <a href="http://www.lucene.com/cgi-bin/faq/faqmanager.cgi">FAQs</a>
+</li>
+                    <li>    <a href="../api/overview.html">Javadoc</a>
+</li>
+                </ul>
+            <p><strong>Download</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
+</li>
+                </ul>
+            <p><strong>Community</strong></p>
+        <ul>
+                    <li>    <a href="./whoweare.html">Who We Are</a>
+</li>
+                    <li>    <a href="./powered.html">Powered by Lucene</a>
+</li>
+                    <li>    <a href="./resources.html">Resources</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/getinvolved.html">Get Involved</a>
+</li>
+                </ul>
+            <p><strong>Jakarta</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/acknowledgements.html">Acknowledgements</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/contact.html">Contact</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/legal.html">Legal</a>
+</li>
+                </ul>
+                        </td>
+                    <td width="80%" align="left" valign="top">
+                                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="FEATURES"><strong>FEATURES</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <h3>Lucene offers powerful features through a simple API</h3>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Scalable, High-Performance Indexing"><strong>Scalable, High-Performance Indexing</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <ul>
+<li>over 200MB/hour on Pentium II/266<br /></li>
+<li>incremental indexing as fast as batch indexing</li>
+<li>small RAM requirements -- only 1MB heap</li>
+<li>index size roughly 30% the size of text indexed</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Powerful, Accurate and Efficient Search Algorithms"><strong>Powerful, Accurate and Efficient Search Algorithms</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <ul>
+<li>ranked searching -- best results returned first</li>
+<li>boolean and phrase queries</li>
+<li>fielded searching (e.g., title, author, contents)</li>
+<li>date-range searching</li>
+<li>multiple-index searching with merged results</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Simple API's allow developers to ..."><strong>Simple API's allow developers to ...</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <ul>
+<li>incorporate new document types</li>
+<li>localize for new languages (already handles most European languages)</li>
+<li>develop new user interfaces</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Cross-Platform Solution"><strong>Cross-Platform Solution</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <ul>
+<li>100%-pure Java</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                        </td>
+                </tr>
+
+                <!-- FOOTER -->
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                <tr><td colspan="2">
+                    <div align="center"><font color="#525D76" size="-1"><em>
+                    Copyright &#169; 1999-2001, Apache Software Foundation
+                    </em></font></div>
+                </td></tr>
+            </table>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/images/lucene_green_100.gif b/docs/images/lucene_green_100.gif
new file mode 100644
index 0000000..b7e06d9
--- /dev/null
+++ b/docs/images/lucene_green_100.gif
Binary files differ
diff --git a/docs/images/lucene_green_150.gif b/docs/images/lucene_green_150.gif
new file mode 100644
index 0000000..4948017
--- /dev/null
+++ b/docs/images/lucene_green_150.gif
Binary files differ
diff --git a/docs/images/lucene_green_200.gif b/docs/images/lucene_green_200.gif
new file mode 100644
index 0000000..e8ab18e
--- /dev/null
+++ b/docs/images/lucene_green_200.gif
Binary files differ
diff --git a/docs/images/lucene_green_250.gif b/docs/images/lucene_green_250.gif
new file mode 100644
index 0000000..a09bd95
--- /dev/null
+++ b/docs/images/lucene_green_250.gif
Binary files differ
diff --git a/docs/images/lucene_green_300.gif b/docs/images/lucene_green_300.gif
new file mode 100644
index 0000000..7c82298
--- /dev/null
+++ b/docs/images/lucene_green_300.gif
Binary files differ
diff --git a/docs/images/lucene_outline_100.gif b/docs/images/lucene_outline_100.gif
new file mode 100644
index 0000000..b64ea09
--- /dev/null
+++ b/docs/images/lucene_outline_100.gif
Binary files differ
diff --git a/docs/images/lucene_outline_150.gif b/docs/images/lucene_outline_150.gif
new file mode 100644
index 0000000..0100293
--- /dev/null
+++ b/docs/images/lucene_outline_150.gif
Binary files differ
diff --git a/docs/images/lucene_outline_200.gif b/docs/images/lucene_outline_200.gif
new file mode 100644
index 0000000..4e3a37e
--- /dev/null
+++ b/docs/images/lucene_outline_200.gif
Binary files differ
diff --git a/docs/images/lucene_outline_250.gif b/docs/images/lucene_outline_250.gif
new file mode 100644
index 0000000..d07b20d
--- /dev/null
+++ b/docs/images/lucene_outline_250.gif
Binary files differ
diff --git a/docs/images/lucene_outline_300.gif b/docs/images/lucene_outline_300.gif
new file mode 100644
index 0000000..10f7dcf
--- /dev/null
+++ b/docs/images/lucene_outline_300.gif
Binary files differ
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..372662d
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,183 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!-- Content Stylesheet for Site -->
+
+        
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+
+                                                    <meta name="author" value="Jon S. Stevens">
+            <meta name="email" value="jon@latchkey.com">
+                                        <meta name="author" value="Ted Husted">
+            <meta name="email" value="husted@apache.org">
+                                        <meta name="author" value="Doug Cutting">
+            <meta name="email" value="cutting@apache.org">
+            
+            <title>Jakarta Lucene - Overview - Jakarta Lucene</title>
+        </head>
+
+        <body bgcolor="#ffffff" text="#000000" link="#525D76">        
+            <table border="0" width="100%" cellspacing="0">
+                <!-- TOP IMAGE -->
+                <tr>
+                    <td align="left">
+<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
+</td>
+<td align="right">
+<a href="http://jakarta.apache.org/lucene/"><img src="./images/lucene_green_300.gif" alt="Jakarta Lucene" border="0"/></a>
+</td>
+                </tr>
+            </table>
+            <table border="0" width="100%" cellspacing="4">
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                
+                <tr>
+                    <!-- LEFT SIDE NAVIGATION -->
+                    <td width="20%" valign="top" nowrap="true">
+                                <p><strong>About</strong></p>
+        <ul>
+                    <li>    <a href="./index.html">Overview</a>
+</li>
+                    <li>    <a href="./powered.html">Powered by Lucene</a>
+</li>
+                    <li>    <a href="./whoweare.html">Who We Are</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
+</li>
+                </ul>
+            <p><strong>Documentation</strong></p>
+        <ul>
+                    <li>    <a href="http://www.lucene.com/cgi-bin/faq/faqmanager.cgi">FAQ</a>
+</li>
+                    <li>    <a href="./resources.html">Articles</a>
+</li>
+                    <li>    <a href="./api/index.html">Javadoc</a>
+</li>
+                </ul>
+            <p><strong>Download</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
+</li>
+                </ul>
+            <p><strong>Jakarta</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/getinvolved.html">Get Involved</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/acknowledgements.html">Acknowledgements</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/contact.html">Contact</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/legal.html">Legal</a>
+</li>
+                </ul>
+                        </td>
+                    <td width="80%" align="left" valign="top">
+                                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Jakarta Lucene"><strong>Jakarta Lucene</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <p>
+Jakarta Lucene is a high-performance, full-featured text search engine
+written entirely in Java.  It is a technology suitable for nearly any
+application that requires full-text search, especially
+cross-platform. 
+</p>
+                                                <p>
+Jakarta Lucene is an open source project available for 
+<a href="http://jakarta.apache.org/site/binindex.html">free download</a> from Apache Jakarta.  
+Please use the links on the left to access Lucene.
+</p>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Lucene News"><strong>Lucene News</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <p>
+<b>Lucene v1.02 released</b> - This release repackages Lucene as product 
+of the Apache Software Foundation. Download it 
+<a href="http://jakarta.apache.org/site/binindex.html">here</a>.
+</p>
+                                                <p>
+<b>Lucene Joins Jakarta</b> - The Lucene Team is happy to announce that 
+Lucene is now part of a member of the Apache Jakarta Project. This move will 
+help Lucene continue to grow, and enhance its position as the leading 
+server-side searching solution for Java.
+</p>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="About Apache Jakarta"><strong>About Apache Jakarta</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <p>
+The goal of the <a href="http://jakarta.apache.org/">Apache Jakarta Project</a> 
+is to provide commercial-quality server solutions based on the Java Platform that 
+are developed in an open and cooperative fashion.
+</p>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                        </td>
+                </tr>
+
+                <!-- FOOTER -->
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                <tr><td colspan="2">
+                    <div align="center"><font color="#525D76" size="-1"><em>
+                    Copyright &#169; 1999-2001, Apache Software Foundation
+                    </em></font></div>
+                </td></tr>
+            </table>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/powered.html b/docs/powered.html
new file mode 100644
index 0000000..37adcdc
--- /dev/null
+++ b/docs/powered.html
@@ -0,0 +1,139 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!-- Content Stylesheet for Site -->
+
+        
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+
+                                                    <meta name="author" value="Ted Husted">
+            <meta name="email" value="husted@apache.org">
+                                        <meta name="author" value="Doug Cutting">
+            <meta name="email" value="cutting@apache.org">
+            
+            <title>Jakarta Lucene - Powered by Lucene - Jakarta Lucene</title>
+        </head>
+
+        <body bgcolor="#ffffff" text="#000000" link="#525D76">        
+            <table border="0" width="100%" cellspacing="0">
+                <!-- TOP IMAGE -->
+                <tr>
+                    <td align="left">
+<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
+</td>
+<td align="right">
+<a href="http://jakarta.apache.org/lucene/"><img src="./images/lucene_green_300.gif" alt="Jakarta Lucene" border="0"/></a>
+</td>
+                </tr>
+            </table>
+            <table border="0" width="100%" cellspacing="4">
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                
+                <tr>
+                    <!-- LEFT SIDE NAVIGATION -->
+                    <td width="20%" valign="top" nowrap="true">
+                                <p><strong>About</strong></p>
+        <ul>
+                    <li>    <a href="./index.html">Overview</a>
+</li>
+                    <li>    <a href="./powered.html">Powered by Lucene</a>
+</li>
+                    <li>    <a href="./whoweare.html">Who We Are</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
+</li>
+                </ul>
+            <p><strong>Documentation</strong></p>
+        <ul>
+                    <li>    <a href="http://www.lucene.com/cgi-bin/faq/faqmanager.cgi">FAQ</a>
+</li>
+                    <li>    <a href="./resources.html">Articles</a>
+</li>
+                    <li>    <a href="./api/index.html">Javadoc</a>
+</li>
+                </ul>
+            <p><strong>Download</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
+</li>
+                </ul>
+            <p><strong>Jakarta</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/getinvolved.html">Get Involved</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/acknowledgements.html">Acknowledgements</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/contact.html">Contact</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/legal.html">Legal</a>
+</li>
+                </ul>
+                        </td>
+                    <td width="80%" align="left" valign="top">
+                                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Powered by Lucene"><strong>Powered by Lucene</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <p>Applications using Lucene include:
+<ul>
+<li><a href="http://www.bobdylan.com/">Bob Dylan</a></li>
+<li><a href="http://eyebrowse.tigris.org/">Eyebrowse</a></li>
+<li><a href="http://www.jivesoftware.com/">Jive Forums</a></li>
+<li><a href="http://www.i2a.com/websearch/"> Web Search</a></li>
+</ul>
+</p>
+                                                <p>If you wish to have your site listed on this page, send <a href="mailto:lucene-dev@jakarta.apache.org">us</a> a note.</p>
+                                                <p>Please include something like the following with your search results:</p>
+                                                <center><font size="-1"><i>search powered by</i></font> <a href="http://jakarta.apache.org/lucene"><img src="images/lucene_green_100.gif" alt="Lucene" border="0" /></a></center>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                        </td>
+                </tr>
+
+                <!-- FOOTER -->
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                <tr><td colspan="2">
+                    <div align="center"><font color="#525D76" size="-1"><em>
+                    Copyright &#169; 1999-2001, Apache Software Foundation
+                    </em></font></div>
+                </td></tr>
+            </table>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/resources.html b/docs/resources.html
new file mode 100644
index 0000000..b05b7c6
--- /dev/null
+++ b/docs/resources.html
@@ -0,0 +1,133 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!-- Content Stylesheet for Site -->
+
+        
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+
+                                                    <meta name="author" value="Ted Husted">
+            <meta name="email" value="husted@apache.org">
+                                        <meta name="author" value="Doug Cutting">
+            <meta name="email" value="cutting@apache.org">
+            
+            <title>Jakarta Lucene - Resources - Jakarta Lucene</title>
+        </head>
+
+        <body bgcolor="#ffffff" text="#000000" link="#525D76">        
+            <table border="0" width="100%" cellspacing="0">
+                <!-- TOP IMAGE -->
+                <tr>
+                    <td align="left">
+<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
+</td>
+<td align="right">
+<a href="http://jakarta.apache.org/lucene/"><img src="./images/lucene_green_300.gif" alt="Jakarta Lucene" border="0"/></a>
+</td>
+                </tr>
+            </table>
+            <table border="0" width="100%" cellspacing="4">
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                
+                <tr>
+                    <!-- LEFT SIDE NAVIGATION -->
+                    <td width="20%" valign="top" nowrap="true">
+                                <p><strong>About</strong></p>
+        <ul>
+                    <li>    <a href="./index.html">Overview</a>
+</li>
+                    <li>    <a href="./powered.html">Powered by Lucene</a>
+</li>
+                    <li>    <a href="./whoweare.html">Who We Are</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
+</li>
+                </ul>
+            <p><strong>Documentation</strong></p>
+        <ul>
+                    <li>    <a href="http://www.lucene.com/cgi-bin/faq/faqmanager.cgi">FAQ</a>
+</li>
+                    <li>    <a href="./resources.html">Articles</a>
+</li>
+                    <li>    <a href="./api/index.html">Javadoc</a>
+</li>
+                </ul>
+            <p><strong>Download</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
+</li>
+                </ul>
+            <p><strong>Jakarta</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/getinvolved.html">Get Involved</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/acknowledgements.html">Acknowledgements</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/contact.html">Contact</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/legal.html">Legal</a>
+</li>
+                </ul>
+                        </td>
+                    <td width="80%" align="left" valign="top">
+                                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Articles"><strong>Articles</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <p>Articles about Lucene:</p>
+                                                <ul>
+<li><a href="http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-lucene.html">The Lucene search engine Powerful flexible and free</a><br /> - JavaWorld September 2000</li> 
+<li><a href="http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-cooltools.html">Build your own languages with JavaCC</a><br /> - JavaWorld December 2000</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                        </td>
+                </tr>
+
+                <!-- FOOTER -->
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                <tr><td colspan="2">
+                    <div align="center"><font color="#525D76" size="-1"><em>
+                    Copyright &#169; 1999-2001, Apache Software Foundation
+                    </em></font></div>
+                </td></tr>
+            </table>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/whoweare.html b/docs/whoweare.html
new file mode 100644
index 0000000..ab801c7
--- /dev/null
+++ b/docs/whoweare.html
@@ -0,0 +1,185 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!-- Content Stylesheet for Site -->
+
+        
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+
+                                                    <meta name="author" value="Ted Husted">
+            <meta name="email" value="husted@apache.org">
+                                        <meta name="author" value="Doug Cutting">
+            <meta name="email" value="cutting@apache.org">
+            
+            <title>Jakarta Lucene - Who We Are - Jakarta Lucene</title>
+        </head>
+
+        <body bgcolor="#ffffff" text="#000000" link="#525D76">        
+            <table border="0" width="100%" cellspacing="0">
+                <!-- TOP IMAGE -->
+                <tr>
+                    <td align="left">
+<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
+</td>
+<td align="right">
+<a href="http://jakarta.apache.org/lucene/"><img src="./images/lucene_green_300.gif" alt="Jakarta Lucene" border="0"/></a>
+</td>
+                </tr>
+            </table>
+            <table border="0" width="100%" cellspacing="4">
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                
+                <tr>
+                    <!-- LEFT SIDE NAVIGATION -->
+                    <td width="20%" valign="top" nowrap="true">
+                                <p><strong>About</strong></p>
+        <ul>
+                    <li>    <a href="./index.html">Overview</a>
+</li>
+                    <li>    <a href="./powered.html">Powered by Lucene</a>
+</li>
+                    <li>    <a href="./whoweare.html">Who We Are</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
+</li>
+                </ul>
+            <p><strong>Documentation</strong></p>
+        <ul>
+                    <li>    <a href="http://www.lucene.com/cgi-bin/faq/faqmanager.cgi">FAQ</a>
+</li>
+                    <li>    <a href="./resources.html">Articles</a>
+</li>
+                    <li>    <a href="./api/index.html">Javadoc</a>
+</li>
+                </ul>
+            <p><strong>Download</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
+</li>
+                </ul>
+            <p><strong>Jakarta</strong></p>
+        <ul>
+                    <li>    <a href="http://jakarta.apache.org/site/getinvolved.html">Get Involved</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/acknowledgements.html">Acknowledgements</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/contact.html">Contact</a>
+</li>
+                    <li>    <a href="http://jakarta.apache.org/site/legal.html">Legal</a>
+</li>
+                </ul>
+                        </td>
+                    <td width="80%" align="left" valign="top">
+                                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Who We Are"><strong>Who We Are</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <p>Lucene is maintained by a team of volunteer developers.</p>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Committers"><strong>Committers</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <ul>
+<li><b>Doug Cutting</b> (cutting at apache.org)
+
+<p>Lucene was originally written in Doug's spare time during late 1997
+and early 1998.  Doug had previously written search engines at Xerox's
+Palo Alto Research Center (PARC), Apple, and Excite@Home, and authored
+several information retrieval <a href="http://www.lucene.com/publications.html">papers and
+patents</a>.</p>
+
+<p>Doug currently works for <a href="http://www.grandcentral.com/">Grand
+Central</a>.</p>
+
+<p>Please do not email Doug directly about Lucene. Instead use
+the <a href="http://jakarta.apache.org/site/mail.html">Jakarta-Lucene mailing lists</a>.</p>
+
+</li>
+<li><b>Otis Gospodnetic</b> (otis at apache.org)</li>
+<li><b>Brian Goetz</b> (briangoetz at apache.org)</li>
+<li><b>Scott Ganyo</b> (scottganyo at apache.org)</li>
+<li><b>Eugene Gluzberg</b> (drag0n at apache.org)</li>
+<li><b>Matt Tucker</b> (mtucker at apache.org)</li>
+<li><b>Cory Hubert</b> (clhubert at apache.org)</li>
+<li><b>Dave Kor</b> (davekor at apache.org)</li>
+<li><b>Jon Stevens</b> (jon at latchkey.com)</li>
+<li><b>Tal Dayan</b> (zapta at apache.org)</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr><td bgcolor="#525D76">
+        <font color="#ffffff" face="arial,helvetica,sanserif">
+          <a name="Other Contributors"><strong>Other Contributors</strong></a>
+        </font>
+      </td></tr>
+      <tr><td>
+        <blockquote>
+                                    <ul>
+<li>Josh Bloch</li>
+<li>Ted Husted</li>
+</ul>
+                            </blockquote>
+        </p>
+      </td></tr>
+      <tr><td><br/></td></tr>
+    </table>
+                                        </td>
+                </tr>
+
+                <!-- FOOTER -->
+                <tr><td colspan="2">
+                    <hr noshade="" size="1"/>
+                </td></tr>
+                <tr><td colspan="2">
+                    <div align="center"><font color="#525D76" size="-1"><em>
+                    Copyright &#169; 1999-2001, Apache Software Foundation
+                    </em></font></div>
+                </td></tr>
+            </table>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/JavaCC.zip b/lib/JavaCC.zip
new file mode 100644
index 0000000..6e4d85e
--- /dev/null
+++ b/lib/JavaCC.zip
Binary files differ
diff --git a/lib/LICENSE.txt b/lib/LICENSE.txt
new file mode 100644
index 0000000..92cbe45
--- /dev/null
+++ b/lib/LICENSE.txt
@@ -0,0 +1,194 @@
+Below is the license for JavaCC that you must agree to when you install
+JavaCC.
+
+We are not distributing JavaCC with the binary distribution of Lucene,
+therefore, we feel that we do not need a separate license with MetaMata.
+We only have a copy of the JavaCC.zip file (which contains the JavaCC
+related .class files) in CVS.
+
+Our goal is not to violate this license and do harm in any way. If you
+find that we are in violation of the license, please let us know and
+tell us the steps to correct our misuse.
+
+Thanks!
+
+The Lucene Team
+
+
+END-USER LICENSE AGREEMENT FOR JAVACC SOFTWARE
+
+THE JAVA(TM) COMPILER COMPILER(TM) SOFTWARE IS AVAILABLE FOR DOWNLOAD FROM
+THE METAMATA WEBSITE. THIS IN NO WAY IMPLIES OWNERSHIP IN, OR OBLIGATION
+FOR THE SOFTWARE ON THE PART OF METAMATA, INC. YOUR DOWNLOAD AND USE OF THE
+SOFTWARE IS SUBJECT TO THE TERMS AND CONDITIONS OF THE LICENSE FROM SUN
+MICROSYSTEMS, INC. BELOW.
+
+THE JAVA(TM) COMPILER COMPILER(TM) SOFTWARE MAY BE REDISTRIBUTED FREE OF
+CHARGE ONLY UNDER A SEPARATE AGREEMENT ENTERED INTO WITH METAMATA (NOT PART
+OF THIS LICENSE). FOR REDISTRIBUTION RIGHTS, PLEASE CONTACT METAMATA AT
+2140 PERALTA BLVD., SUITE 213B, FREMONT CA 94536.
+
+LICENSE AGREEMENT
+
+SUN MICROSYSTEMS, INC. ACTING BY AND THROUGH ITS SUN TEST GROUP("SUN") IS
+WILLING TO LICENSE THE JAVA(TM) COMPILER COMPILER(TM)SOFTWARE, SAMPLE
+GRAMMARS, AND THE ACCOMPANYING DOCUMENTATION("SOFTWARE") TO YOU ONLY ON THE
+CONDITION THAT YOU ACCEPT ALL OF THE TERMS IN THIS AGREEMENT.
+
+PLEASE READ THE TERMS CAREFULLY BEFORE CLICKING ON THE "ACCEPT" BUTTON, AS
+BY CLICKING ON THE "ACCEPT" BUTTON YOU ACKNOWLEDGE THAT YOU HAVE READ THIS
+AGREEMENT, UNDERSTAND IT AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS.
+
+IF YOU DO NOT AGREE TO THESE TERMS, SUN IS UNWILLING TO LICENSE THE
+SOFTWARE TO YOU. YOU SHOULD CLICK ON THE "DO NOT ACCEPT" BUTTON TO
+DISCONTINUE THE INSTALLATION PROCESS.
+
+1. LICENSE
+
+You are permitted to download, install, and use the Software on a single
+computer or a network server. You may use the Software as installed on a
+network server on clients of that server. You may copy the Software only
+for backup purposes in support of your use of the Software, provided that
+you reproduce all copyright and other proprietary notices that are on the
+original copy of the Software.
+
+2. SAMPLE GRAMMARS
+
+You may modify the sample grammars included in the Software to develop
+derivatives thereof ("Sample Grammar Derivatives"), and sublicense the
+Sample Grammar Derivatives directly or indirectly to your customers.
+
+3. DEVELOPED PRODUCTS
+
+You may use the Software to generate software program(s)("Developed
+Programs"). Sun claims no rights in or to the Developed Programs.
+
+4. YOUR INDEMNIFICATION OF SAMPLE GRAMMARS DERIVATIVES AND DEVELOPED
+PRODUCTS
+
+You agree to indemnify, hold harmless, and defend Sun from and against any
+claims or suits, including attorneys' fees, which arise or result from any
+use or distribution of Sample Grammar Derivatives and/orDeveloped Programs.
+
+5. RESTRICTIONS
+
+You may not use, copy, modify, or transfer the Software, or any copy
+thereof, in whole or in part, except as expressly provided for in this
+Agreement. You may not reverse engineer, disassemble, decompile or
+translate the Software, or otherwise attempt to derive the source code of
+the Software, except as allowed by law. Any attempt to transfer any of the
+rights, duties, or obligations hereunder is void. You may not rent, lease,
+loan, resell for profit, or distribute the Software, or any part of the
+Software.
+
+The Software is not designed or licensed for use in on-line control
+equipment in hazardous environments, such as operation of nuclear
+facilities, aircraft navigation or control, or direct life support
+machines.
+
+6. OWNERSHIP
+
+The Software is licensed, not sold, to you for use only under the terms of
+this Agreement, and Sun reserves all rights not expressly granted to you.
+You own the media, if any, on which the Software is recorded, but Sun
+retains ownership of all copies of the Software itself.
+
+7. CONFIDENTIALITY
+
+The Software is confidential and proprietary information of Sun and/or its
+licensors. You agree to take adequate steps to protect the Software from
+unauthorized disclosure or use.
+
+8. TERM
+
+This Agreement will immediately and automatically terminate without notice
+if you fail to comply with any material term or condition of this
+Agreement. You agree upon termination to promptly destroy the Software and
+all copies. You may terminate this Agreement at any time by destroying all
+copies of Software.
+
+9. NO WARRANTY
+
+The Software is provided to you "AS IS".
+
+SUN EXPRESSLY DISCLAIMS ALL WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. NO
+ORAL OR WRITTEN INFORMATION OF ADVICE GIVEN BY SUN, ITS EMPLOYEES,
+DISTRIBUTORS, DEALERS, LICENSORS OR AGENTS SHALL INCREASE THE SCOPE OF THE
+ABOVE WARRANTIES OR CREATE ANY NEW WARRANTIES.
+
+10. LIMITATIONS OR REMEDIES
+
+REGARDLESS OF WHETHER ANY REMEDY SET FORTH HEREIN FAILS OF ITS ESSENTIAL
+PURPOSE OR OTHERWISE, IN NO EVENT WILL SUN BE LIABLE TO YOU OR TO ANY THIRD
+PARTY FOR ANY LOST PROFITS, LOST DATA, INTERRUPTION OF BUSINESS, OR OTHER
+SPECIAL, DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND
+WHETHER IN CONTRACT OR TORT OR OTHERWISE, ARISING OUT OF THE USE OR
+INABILITY TO USE THE SOFTWARE OR ANY DATA SUPPLIED THEREWITH, EVEN IF SUN
+HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE AND WHETHER OR
+NOT SUCH LOSS OR DAMAGES ARE FORESEEABLE.
+
+11. GOVERNMENT USER
+
+The Software is provided with restricted rights.
+
+RESTRICTED RIGHTS LEGEND
+
+With respect to any acquisition of the Software by or for any unit or
+agency of the U.S. Government ("Government"), the Software shall be
+classified as "commercial computer software", as that term is defined in
+the applicable provisions of the Federal Acquisition Regulation("FAR") and
+supplements thereto, including the Department of Defense(DoD) FAR
+Supplement ("DFARS"). If the Software is supplied for use by the DoD, the
+Software is delivered subject to the terms of this Agreement and either:
+(i) in accordance with DFARS 227.7202-1(a) and227.7202-3(a), or (ii) with
+restricted rights in accordance with DFARS252.227-7013(c)(1)(ii)(OCT 1988),
+as applicable. If the Software is supplied for use by a Federal agency
+other than the DoD, the Software is restricted computer software delivered
+subject to the terms of this Agreement and (i) FAR 12.212(a); (ii) FAR
+52.227-19; or(iii) FAR52.227-14(ALT III), as applicable.
+
+Sun Microsystems Inc, 2550 Garcia Avenue, Mountain View, CA 94043.
+
+12. EXPORT LAW
+
+You acknowledge and agree that the Software may be subject to control
+imposed by the United States Export Administration Act and the regulations
+thereunder (the "Act") as well as the applicable laws of other countries.
+
+You agree and certify that neither the Software nor any direct product
+thereof is being or will be acquired, shipped,transferred or reexported,
+directly or indirectly, to a national of Cuba, Iran, Iraq, Libya, North
+Korea, Rwanda, Syria, or Sudan or any other country prohibited by the Act
+and the regulations thereunder or will be used for any purpose prohibited
+by the same, unless specifically authorized by U.S. regulations, including,
+but not limited to, the Export Administration Regulations ("EAR") or by a
+license issued by the U.S. Government. You will not reexport the Software
+you receive under this Agreement to any party involved in sensitive or
+unguarded nuclear activities, or activities related to chemical or
+biological weapons or missiles unless authorized by the EAR or a license
+for the U.S. Department of Commerce.
+
+These obligations survive the termination of this Agreement.
+
+13. GENERAL
+
+Any action related to this Agreement will be governed by California law and
+controlling U.S. federal law, and the United Nations Convention on
+Contracts for the International Sale of Goods and the choice of law rules
+of any jurisdiction shall not apply. If any provision of this Agreement is
+held to be unenforceable, that provision will be removed and the remaining
+provisions will remain in full force. This Agreement is the complete and
+exclusive statement of the agreement between us which supersedes any
+proposal or prior agreement, oral or written, and any other communications
+between us in relation to the subject matter of this Agreement. If you have
+any questions concerning this Agreement, you may contact Sun by email at
+javacc-help@eng.sun.com.
+
+Sun, Sun Microsystems, the Sun Logo, Java, Java Compiler Compiler, and all
+Java-based marks are trademarks or registered trademarks of Sun
+Microsystems, Inc. in the U.S. and other countries.
+
+THE SOFTWARE AND ACCOMPANYING USER DOCUMENTATION ARE PROTECTED BY UNITED
+STATES COPYRIGHT LAW AND INTERNATIONAL TREATY. UNAUTHORIZED REPRODUCTION OR
+DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
diff --git a/lib/ant-1.3.jar b/lib/ant-1.3.jar
new file mode 100644
index 0000000..13acd1e
--- /dev/null
+++ b/lib/ant-1.3.jar
@@ -0,0 +1,2 @@
+AnyObjectId[e4efab3ced62cc2c310add71f678bb899e2e51cd] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/jdom-b7.jar b/lib/jdom-b7.jar
new file mode 100644
index 0000000..ac5b958
--- /dev/null
+++ b/lib/jdom-b7.jar
@@ -0,0 +1,2 @@
+AnyObjectId[6be1f2de7126b91b14a11a4b00326859a85e5981] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/junit_35.jar b/lib/junit_35.jar
new file mode 100644
index 0000000..4b15176
--- /dev/null
+++ b/lib/junit_35.jar
@@ -0,0 +1,2 @@
+AnyObjectId[d74829861931a3993630b0a2e0ede9d523ce05ff] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/velocity-1.2-dev.jar b/lib/velocity-1.2-dev.jar
new file mode 100644
index 0000000..9aa4c31
--- /dev/null
+++ b/lib/velocity-1.2-dev.jar
@@ -0,0 +1,2 @@
+AnyObjectId[5f8889968e8e6ebbee53e6425ccaca3130c12fef] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/xerces-1.3.0.jar b/lib/xerces-1.3.0.jar
new file mode 100644
index 0000000..fb3d013
--- /dev/null
+++ b/lib/xerces-1.3.0.jar
@@ -0,0 +1,2 @@
+AnyObjectId[311ab8d15990e3d0b0234e37afb89fd7f21f8eb8] was removed in git history.
+Apache SVN contains full history.
\ No newline at end of file
diff --git a/src/demo/org/apache/lucene/DeleteFiles.java b/src/demo/org/apache/lucene/DeleteFiles.java
index b616f6c..ba7727c 100644
--- a/src/demo/org/apache/lucene/DeleteFiles.java
+++ b/src/demo/org/apache/lucene/DeleteFiles.java
@@ -56,10 +56,10 @@
 
 import java.io.IOException;
 
-import com.lucene.store.Directory;
-import com.lucene.store.FSDirectory;
-import com.lucene.index.IndexReader;
-import com.lucene.index.Term;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 
 class DeleteFiles {
   public static void main(String[] args) {
diff --git a/src/demo/org/apache/lucene/FileDocument.java b/src/demo/org/apache/lucene/FileDocument.java
index 0fe0fd1..f0cce6c 100644
--- a/src/demo/org/apache/lucene/FileDocument.java
+++ b/src/demo/org/apache/lucene/FileDocument.java
@@ -60,9 +60,9 @@
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 
-import com.lucene.document.Document;
-import com.lucene.document.Field;
-import com.lucene.document.DateField;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.DateField;
 
 /** A utility for making Lucene Documents from a File. */
 
diff --git a/src/demo/org/apache/lucene/HTMLDocument.java b/src/demo/org/apache/lucene/HTMLDocument.java
index 27cd200..1cabd7d 100644
--- a/src/demo/org/apache/lucene/HTMLDocument.java
+++ b/src/demo/org/apache/lucene/HTMLDocument.java
@@ -55,8 +55,8 @@
  */
 
 import java.io.*;
-import com.lucene.document.*;
-import demo.HTMLParser.HTMLParser;
+import org.apache.lucene.document.*;
+import org.apache.lucene.HTMLParser.HTMLParser;
 
 /** A utility for making Lucene Documents for HTML documents. */
 
diff --git a/src/demo/org/apache/lucene/HTMLParser/Entities.java b/src/demo/org/apache/lucene/HTMLParser/Entities.java
index cadd8ca..b2b45fe 100644
--- a/src/demo/org/apache/lucene/HTMLParser/Entities.java
+++ b/src/demo/org/apache/lucene/HTMLParser/Entities.java
@@ -1,4 +1,4 @@
-package demo.HTMLParser;
+package org.apache.lucene.HTMLParser;
 
 /* ====================================================================
  * The Apache Software License, Version 1.1
diff --git a/src/demo/org/apache/lucene/HTMLParser/Makefile b/src/demo/org/apache/lucene/HTMLParser/Makefile
deleted file mode 100644
index 78bc705..0000000
--- a/src/demo/org/apache/lucene/HTMLParser/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-# sub-directory makefile for lucene
-ROOT = ../..
-include ../../com/lucene/rules.mk
diff --git a/src/demo/org/apache/lucene/IndexFiles.java b/src/demo/org/apache/lucene/IndexFiles.java
index ad6f78a..6e6d06f 100644
--- a/src/demo/org/apache/lucene/IndexFiles.java
+++ b/src/demo/org/apache/lucene/IndexFiles.java
@@ -54,8 +54,8 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.analysis.StopAnalyzer;
-import com.lucene.index.IndexWriter;
+import org.apache.lucene.analysis.StopAnalyzer;
+import org.apache.lucene.index.IndexWriter;
 
 import java.io.File;
 import java.util.Date;
diff --git a/src/demo/org/apache/lucene/IndexHTML.java b/src/demo/org/apache/lucene/IndexHTML.java
index c622cc8..d9e3673 100644
--- a/src/demo/org/apache/lucene/IndexHTML.java
+++ b/src/demo/org/apache/lucene/IndexHTML.java
@@ -54,11 +54,11 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.analysis.StopAnalyzer;
-import com.lucene.index.*;
-import com.lucene.document.Document;
-import com.lucene.util.Arrays;
-import demo.HTMLParser.HTMLParser;
+import org.apache.lucene.analysis.StopAnalyzer;
+import org.apache.lucene.index.*;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.util.Arrays;
+import org.apache.lucene.HTMLParser.HTMLParser;
 
 import java.io.File;
 import java.util.Date;
diff --git a/src/demo/org/apache/lucene/Makefile b/src/demo/org/apache/lucene/Makefile
deleted file mode 100644
index 4b7b53f..0000000
--- a/src/demo/org/apache/lucene/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-# sub-directory makefile for lucene
-ROOT = ..
-include ../com/lucene/rules.mk
diff --git a/src/demo/org/apache/lucene/SearchFiles.java b/src/demo/org/apache/lucene/SearchFiles.java
index 4aa3bf4..c83c333c 100644
--- a/src/demo/org/apache/lucene/SearchFiles.java
+++ b/src/demo/org/apache/lucene/SearchFiles.java
@@ -58,14 +58,14 @@
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 
-import com.lucene.analysis.Analyzer;
-import com.lucene.analysis.StopAnalyzer;
-import com.lucene.document.Document;
-import com.lucene.search.Searcher;
-import com.lucene.search.IndexSearcher;
-import com.lucene.search.Query;
-import com.lucene.search.Hits;
-import com.lucene.queryParser.QueryParser;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.StopAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Hits;
+import org.apache.lucene.queryParser.QueryParser;
 
 class SearchFiles {
   public static void main(String[] args) {
diff --git a/src/java/org/apache/lucene/Makefile b/src/java/org/apache/lucene/Makefile
deleted file mode 100644
index e0c941e..0000000
--- a/src/java/org/apache/lucene/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# top-level makefile for lucene
-
-all: jar doc
-
-# root is two levels up
-ROOT = ../..
-
-include rules.mk
-
diff --git a/src/java/org/apache/lucene/analysis/Analyzer.java b/src/java/org/apache/lucene/analysis/Analyzer.java
index 7c09b23..eddc0dd 100644
--- a/src/java/org/apache/lucene/analysis/Analyzer.java
+++ b/src/java/org/apache/lucene/analysis/Analyzer.java
@@ -81,7 +81,7 @@
   /** Creates a TokenStream which tokenizes all the text in the provided
    *  Reader.  Provided for backward compatibility only.
    * @deprecated use tokenStream(String, Reader) instead.
-   * @see tokenStream(String, Reader)
+   * @see #tokenStream(String, Reader)
    */
   public TokenStream tokenStream(Reader reader)
   {
diff --git a/src/java/org/apache/lucene/analysis/Makefile b/src/java/org/apache/lucene/analysis/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/analysis/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java b/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java
new file mode 100644
index 0000000..d618a79
--- /dev/null
+++ b/src/java/org/apache/lucene/analysis/de/GermanAnalyzer.java
@@ -0,0 +1,113 @@
+package org.apache.lucene.analysis.de;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.LowerCaseFilter;
+import org.apache.lucene.analysis.StopFilter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.standard.StandardFilter;
+import org.apache.lucene.analysis.standard.StandardTokenizer;
+import java.io.File;
+import java.io.Reader;
+import java.util.Hashtable;
+
+/**
+ * Analyzer for german language. Supports an external list of stopwords (words that
+ * will not be indexed at all) and an external list of exclusions (word that will
+ * not be stemmed, but indexed).
+ *
+ * @author    Gerhard Schwarz
+ * @version   $Id$
+ */
+public final class GermanAnalyzer extends Analyzer {
+
+	/**
+	 * List of typical german stopwords.
+	 */
+	private String[] GERMAN_STOP_WORDS = {
+		"einer", "eine", "eines", "einem", "einen",
+		"der", "die", "das", "dass", "daß",
+		"du", "er", "sie", "es",
+		"was", "wer", "wie", "wir",
+		"und", "oder", "ohne", "mit",
+		"am", "im", "in", "aus", "auf",
+		"ist", "sein", "war", "wird",
+		"ihr", "ihre", "ihres",
+		"als", "für", "von", "mit",
+		"dich", "dir", "mich", "mir",
+		"mein", "sein", "kein",
+		"durch", "wegen"
+		};
+	
+	/**
+	 * Contains the stopwords used with the StopFilter.
+	 */
+	private Hashtable stoptable = new Hashtable();
+	/**
+	 * Contains words that should be indexed but not stemmed.
+	 */
+	private Hashtable excltable = new Hashtable();
+	
+	/**
+	 * Builds an analyzer.
+	 */
+	public GermanAnalyzer() {
+		stoptable = StopFilter.makeStopTable( GERMAN_STOP_WORDS );
+	}
+
+	/**
+	 * Builds an analyzer with the given stop words.
+	 */
+	public GermanAnalyzer( String[] stopwords ) {
+		stoptable = StopFilter.makeStopTable( stopwords );
+	}
+
+	/**
+	 * Builds an analyzer with the given stop words.
+	 */
+	public GermanAnalyzer( Hashtable stopwords ) {
+		stoptable = stopwords;
+	}
+
+	/**
+	 * Builds an analyzer with the given stop words.
+	 */
+	public GermanAnalyzer( File stopwords ) {
+		stoptable = WordlistLoader.getWordtable( stopwords );
+	}
+
+	/**
+	 * Builds an exclusionlist from an array of Strings.
+	 */
+	public void setStemExclusionTable( String[] exclusionlist ) {
+		excltable = StopFilter.makeStopTable( exclusionlist );
+	}
+	/**
+	 * Builds an exclusionlist from a Hashtable.
+	 */
+	public void setStemExclusionTable( Hashtable exclusionlist ) {
+		excltable = exclusionlist;
+	}
+	/**
+	 * Builds an exclusionlist from the words contained in the given file.
+	 */
+	public void setStemExclusionTable( File exclusionlist ) {
+		excltable = WordlistLoader.getWordtable( exclusionlist );
+	}
+	
+	/**
+	 * Creates a TokenStream which tokenizes all the text in the provided Reader.
+	 *
+	 * @return  A TokenStream build from a StandardTokenizer filtered with
+	 * 			StandardFilter, StopFilter, GermanStemFilter and LowerCaseFilter.
+	 */
+	public final TokenStream tokenStream(String fieldName, Reader reader) {
+		TokenStream result = new StandardTokenizer( reader );
+		result = new StandardFilter( result );
+		result = new StopFilter( result, stoptable );
+		result = new GermanStemFilter( result, excltable );
+		// Convert to lowercase after stemming!
+		result = new LowerCaseFilter( result );
+		return result;
+	}
+}
+
diff --git a/src/java/org/apache/lucene/analysis/de/GermanStemFilter.java b/src/java/org/apache/lucene/analysis/de/GermanStemFilter.java
new file mode 100644
index 0000000..17d6148
--- /dev/null
+++ b/src/java/org/apache/lucene/analysis/de/GermanStemFilter.java
@@ -0,0 +1,61 @@
+package org.apache.lucene.analysis.de;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.lucene.analysis.TokenFilter;
+import org.apache.lucene.analysis.TokenStream;
+import java.io.IOException;
+import java.util.Hashtable;
+
+/**
+ * A filter that stemms german words. It supports a table of words that should
+ * not be stemmed at all.
+ *
+ * @author    Gerhard Schwarz
+ * @version   $Id$
+ */
+public final class GermanStemFilter extends TokenFilter {
+
+	/**
+	 * The actual token in the input stream.
+	 */
+	private Token token = null;
+	private GermanStemmer stemmer = null;
+	private Hashtable exclusions = null;
+	
+	public GermanStemFilter( TokenStream in ) {
+		stemmer = new GermanStemmer();
+		input = in;
+	}
+	
+	/**
+	 * Builds a GermanStemFilter that uses an exclusiontable.
+	 */
+	public GermanStemFilter( TokenStream in, Hashtable exclusiontable ) {
+		this( in );
+		this.exclusions = exclusions;
+	}
+
+	/**
+	 * @return  Returns the next token in the stream, or null at EOS.
+	 */
+	public final Token next()
+		throws IOException {
+		if ( ( token = input.next() ) == null ) {
+			return null;
+		}
+		// Check the exclusiontable.
+		else if ( exclusions != null && exclusions.contains( token.termText() ) ) {
+			return token;
+		}
+		else {
+			String s = stemmer.stem( token.termText() );
+			// If not stemmed, dont waste the time creating a new token.
+			if ( !s.equals( token.termText() ) ) {
+				return new Token( s, 0, s.length(), token.type() );
+			}
+			return token;
+		}
+	}
+}
+
+
diff --git a/src/java/org/apache/lucene/analysis/de/GermanStemmer.java b/src/java/org/apache/lucene/analysis/de/GermanStemmer.java
new file mode 100644
index 0000000..f594a39
--- /dev/null
+++ b/src/java/org/apache/lucene/analysis/de/GermanStemmer.java
@@ -0,0 +1,282 @@
+package org.apache.lucene.analysis.de;
+
+/**
+ * A stemmer for german words. The algorithm is based on the report
+ * "A Fast and Simple Stemming Algorithm for German Words" by Jörg
+ * Caumanns (joerg.caumanns@isst.fhg.de).
+ *
+ * @author    Gerhard Schwarz
+ * @version   $Id$
+ */
+
+public class GermanStemmer {
+	
+	/**
+	 * Buffer for the terms while stemming them.
+	 */
+	private StringBuffer sb = new StringBuffer();
+	/**
+	 * Indicates if a term is handled as a noun.
+	 */
+	private boolean uppercase = false;
+	/**
+	 * Amount of characters that are removed with <tt>substitute()</tt> while stemming.
+	 */
+	private int substCount = 0;
+
+	public GermanStemmer() {
+	}
+	
+	/**
+	 * Stemms the given term to an unique <tt>discriminator</tt>.
+	 *
+	 * @param word  The term that should be stemmed.
+	 * @return      Discriminator for <tt>term</tt>
+	 */
+	protected String stem( String term ) {
+		if ( !isStemmable( term ) ) {
+			return term;
+		}
+		// Mark a possible noun.
+		if ( Character.isUpperCase( term.charAt( 0 ) ) ) {
+			uppercase = true;
+		}
+		// Use lowercase for medium stemming.
+		term = term.toLowerCase();
+		// Reset the StringBuffer.
+		sb.delete( 0, sb.length() );
+		sb.insert( 0, term );
+		sb = substitute( sb );
+		// Nouns have only seven possible suffixes.
+		if ( uppercase && sb.length() > 3 ) {
+			if ( sb.substring( sb.length() - 3, sb.length() ).equals( "ern" ) ) {
+				sb.delete( sb.length() - 3, sb.length() );
+			}
+			else if ( sb.substring( sb.length() - 2, sb.length() ).equals( "en" ) ) {
+				sb.delete( sb.length() - 2, sb.length() );
+			}
+			else if ( sb.substring( sb.length() - 2, sb.length() ).equals( "er" ) ) {
+				sb.delete( sb.length() - 2, sb.length() );
+			}
+			else if ( sb.substring( sb.length() - 2, sb.length() ).equals( "es" ) ) {
+				sb.delete( sb.length() - 2, sb.length() );
+			}
+			else if ( sb.charAt( sb.length() - 1 ) == 'e' ) {
+				sb.deleteCharAt( sb.length() - 1 );
+			}
+			else if ( sb.charAt( sb.length() - 1 ) == 'n' ) {
+				sb.deleteCharAt( sb.length() - 1 );
+			}
+			else if ( sb.charAt( sb.length() - 1 ) == 's' ) {
+				sb.deleteCharAt( sb.length() - 1 );
+			}
+			// Additional step for female plurals of professions and inhabitants.
+			if ( sb.length() > 5 && sb.substring( sb.length() - 3, sb.length() ).equals( "erin*" ) ) {
+				sb.deleteCharAt( sb.length() -1 );
+			}
+			// Additional step for irregular plural nouns like "Matrizen -> Matrix".
+			if ( sb.charAt( sb.length() - 1 ) == ( 'z' ) ) {
+				sb.setCharAt( sb.length() - 1, 'x' );
+			}
+		}
+		// Check the 7 "base" suffixes: "e", "s", "n", "t", "em", "er", "nd" for all
+		// other terms. Adjectives, Verbs and Adverbs have a total of 52 different
+		// possible suffixes.
+		else {
+			// Strip base suffixes as long as enough characters remain.
+			boolean doMore = true;
+			while ( sb.length() > 3 && doMore ) {
+				if ( ( sb.length() + substCount > 5 ) && sb.substring( sb.length() - 2, sb.length() ).equals( "nd" ) ) {
+					sb.delete( sb.length() - 2, sb.length() );
+				}
+				else if ( ( sb.length() + substCount > 4 ) && sb.substring( sb.length() - 2, sb.length() ).equals( "er" ) ) {
+					sb.delete( sb.length() - 2, sb.length() );
+				}
+				else if ( ( sb.length() + substCount > 4 ) && sb.substring( sb.length() - 2, sb.length() ).equals( "em" ) ) {
+					sb.delete( sb.length() - 2, sb.length() );
+				}
+				else if ( sb.charAt( sb.length() - 1 ) == 't' ) {
+					sb.deleteCharAt( sb.length() - 1 );
+				}
+				else if ( sb.charAt( sb.length() - 1 ) == 'n' ) {
+					sb.deleteCharAt( sb.length() - 1 );
+				}
+				else if ( sb.charAt( sb.length() - 1 ) == 's' ) {
+					sb.deleteCharAt( sb.length() - 1 );
+				}
+				else if ( sb.charAt( sb.length() - 1 ) == 'e' ) {
+					sb.deleteCharAt( sb.length() - 1 );
+				}
+				else {
+					doMore = false;
+				}
+			}
+		}
+		if ( !uppercase ) {
+			sb = removeParticleDenotion( sb );
+		}
+		sb = resubstitute( sb );
+		return sb.toString();
+	}
+
+	/**
+	 * Removes a particle denotion ("ge") from a term, but only if at least 3
+	 * characters will remain.
+	 *
+	 * @return  The term without particle denotion, if there was one.
+	 */
+	private StringBuffer removeParticleDenotion( StringBuffer buffer ) {
+		for ( int c = 0; c < buffer.length(); c++ ) {
+			// Strip from the beginning of the string to the "ge" inclusive.
+			if ( c < ( sb.length() - 3 ) && buffer.charAt( c ) == 'g' && buffer.charAt ( c + 1 ) == 'e' ) {
+				buffer.delete( 0, c + 2 );
+			}
+		}
+		return sb;
+	}
+
+	/**
+	 * Do some substitutions for the term to reduce overstemming:
+	 *
+	 * - Substitute Umlauts with their corresponding vowel: äöü -> aou,
+	 *   "ß" is substituted by "ss"
+	 * - Substitute an second char of an pair of equal characters with
+	 *   an asterisk: ?? -> ?*
+	 * - Substitute some common character combinations with a token:
+	 *   sch/ch/ei/ie/ig/st -> $/§/%/&/#/!
+	 *
+	 * @return  The term with all needed substitutions.
+	 */
+	private StringBuffer substitute( StringBuffer buffer ) {
+		for ( int c = 0; c < buffer.length(); c++ ) {
+			// Replace the second char of a pair of the equal characters with an asterisk.
+			if ( c > 0 && buffer.charAt( c ) == buffer.charAt ( c - 1 )  ) {
+				buffer.setCharAt( c, '*' );
+			}
+			// Substitute Umlauts.
+			else if ( buffer.charAt( c ) == 'ä' ) {
+				buffer.setCharAt( c, 'a' );
+			}
+			else if ( buffer.charAt( c ) == 'ö' ) {
+				buffer.setCharAt( c, 'o' );
+			}
+			else if ( buffer.charAt( c ) == 'ü' ) {
+				buffer.setCharAt( c, 'u' );
+			}
+			// Take care that enough characters at left for search.
+			if ( c < buffer.length() - 1 ) {
+				if ( buffer.charAt( c ) == 'ß' ) {
+					buffer.setCharAt( c, 's' );
+					buffer.insert( c + 1, 's' );
+					substCount++;
+				}
+				// Masking several common character combinations with an token.
+				else if ( ( c < buffer.length() - 2 ) && buffer.charAt( c ) == 's' && buffer.charAt( c + 1 ) == 'c' && buffer.charAt( c + 2 ) == 'h' ) {
+					buffer.setCharAt( c, '$' );
+					buffer.delete( c + 1, c + 3 );
+					substCount =+ 2;
+				}
+				else if ( buffer.charAt( c ) == 'c' && buffer.charAt( c + 1 ) == 'h' ) {
+					buffer.setCharAt( c, '§' );
+					buffer.deleteCharAt( c + 1 );
+					substCount++;
+				}
+				else if ( buffer.charAt( c ) == 'e' && buffer.charAt( c + 1 ) == 'i' ) {
+					buffer.setCharAt( c, '%' );
+					buffer.deleteCharAt( c + 1 );
+					substCount++;
+				}
+				else if ( buffer.charAt( c ) == 'i' && buffer.charAt( c + 1 ) == 'e' ) {
+					buffer.setCharAt( c, '&' );
+					buffer.deleteCharAt( c + 1 );
+					substCount++;
+				}
+				else if ( buffer.charAt( c ) == 'i' && buffer.charAt( c + 1 ) == 'g' ) {
+					buffer.setCharAt( c, '#' );
+					buffer.deleteCharAt( c + 1 );
+					substCount++;
+				}
+				else if ( buffer.charAt( c ) == 's' && buffer.charAt( c + 1 ) == 't' ) {
+					buffer.setCharAt( c, '!' );
+					buffer.deleteCharAt( c + 1 );
+					substCount++;
+				}
+			}
+		}
+		return buffer;
+	}
+
+	/**
+	 * Checks a term if it can be processed correctly.
+	 *
+	 * @return  true if, and only if, the given term consists in letters.
+	 */
+	private boolean isStemmable( String term ) {
+		boolean upper = false;
+		int first = -1;
+		for ( int c = 0; c < term.length(); c++ ) {
+			// Discard terms that contain non-letter characters.
+			if ( !Character.isLetter( term.charAt( c ) ) ) {
+				return false;
+			}
+			// Discard terms that contain multiple uppercase letters.
+			if ( Character.isUpperCase( term.charAt( c ) ) ) {
+				if ( upper ) {
+					return false;
+				}
+				// First encountered uppercase letter, set flag and save
+				// position.
+				else {
+					first = c;
+					upper = true;
+				}
+			}
+		}
+		// Discard the term if it contains a single uppercase letter that
+		// is not starting the term.
+		if ( first > 0 ) {
+			return false;
+		}
+		return true;
+	}
+	/**
+	 * Undoes some changes made by substitute(). That are character pairs and
+	 * character combinations.
+	 *
+	 * @return  The term without the not human reaqdable substitutions.
+	 */
+	private StringBuffer resubstitute( StringBuffer buffer ) {
+		for ( int c = 0; c < buffer.length(); c++ ) {
+			if ( buffer.charAt( c ) == '*' ) {
+				char x = buffer.charAt( c - 1 );
+				buffer.setCharAt( c, x );
+			}
+			else if ( buffer.charAt( c ) == '$' ) {
+				buffer.setCharAt( c, 's' );
+				buffer.insert( c + 1, new char[]{'c', 'h'}, 0, 2 );
+			}
+			else if ( buffer.charAt( c ) == '§' ) {
+				buffer.setCharAt( c, 'c' );
+				buffer.insert( c + 1, 'h' );
+			}
+			else if ( buffer.charAt( c ) == '%' ) {
+				buffer.setCharAt( c, 'e' );
+				buffer.insert( c + 1, 'i' );
+			}
+			else if ( buffer.charAt( c ) == '&' ) {
+				buffer.setCharAt( c, 'i' );
+				buffer.insert( c + 1, 'e' );
+			}
+			else if ( buffer.charAt( c ) == '#' ) {
+				buffer.setCharAt( c, 'i' );
+				buffer.insert( c + 1, 'g' );
+			}
+			else if ( buffer.charAt( c ) == '!' ) {
+				buffer.setCharAt( c, 's' );
+				buffer.insert( c + 1, 't' );
+			}
+		}
+		return buffer;
+	}
+}
+
diff --git a/src/java/org/apache/lucene/analysis/de/WordlistLoader.java b/src/java/org/apache/lucene/analysis/de/WordlistLoader.java
new file mode 100644
index 0000000..f55b865
--- /dev/null
+++ b/src/java/org/apache/lucene/analysis/de/WordlistLoader.java
@@ -0,0 +1,85 @@
+package org.apache.lucene.analysis.de;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.util.Hashtable;
+
+/**
+ * Loads a textfile and adds every entry to a Hashtable. If a file is not found
+ * or on any error, an empty table is returned.
+ *
+ * @author    Gerhard Schwarz
+ * @version   $Id$
+ */
+public class WordlistLoader {
+
+	/**
+	 * @param path      Path to the wordlist.
+	 * @param wordfile  Name of the wordlist.
+	 */
+	public static Hashtable getWordtable( String path, String wordfile ) {
+		if ( path == null || wordfile == null ) {
+			return new Hashtable();
+		}
+		File absoluteName = new File( path, wordfile );
+		return getWordtable( absoluteName );
+	}
+	/**
+	 * @param wordfile  Complete path to the wordlist
+	 */
+	public static Hashtable getWordtable( String wordfile ) {
+		if ( wordfile == null ) {
+			return new Hashtable();
+		}
+		File absoluteName = new File( wordfile );
+		return getWordtable( absoluteName );
+	}
+
+	/**
+	 * @param wordfile  File containing the wordlist.
+	 */
+	public static Hashtable getWordtable( File wordfile ) {
+		if ( wordfile == null ) {
+			return new Hashtable();
+		}
+		Hashtable result = null;
+		try {
+			LineNumberReader lnr = new LineNumberReader( new FileReader( wordfile ) );
+			String word = null;
+			String[] stopwords = new String[100];
+			int wordcount = 0;
+			while ( ( word = lnr.readLine() ) != null ) {
+				wordcount++;
+				if ( wordcount == stopwords.length ) {
+					String[] tmp = new String[stopwords.length + 50];
+					System.arraycopy( stopwords, 0, tmp, 0, wordcount );
+					stopwords = tmp;
+				}
+				stopwords[wordcount] = word;
+			}
+			result = makeWordTable( stopwords, wordcount );
+		}
+		// On error, use an empty table.
+		catch ( IOException e ) {
+			result = new Hashtable();
+		}
+		return result;
+	}
+
+	/**
+	 * Builds the wordlist table.
+	 *
+	 * @param words   Word that where read.
+	 * @param length  Amount of words that where read into <tt>words</tt>.
+	 */
+	private static Hashtable makeWordTable( String[] words, int length ) {
+		Hashtable table = new Hashtable( length );
+		for ( int i = 0; i < length; i++ ) {
+			table.put( words[i], words[i] );
+		}
+		return table;
+	}
+}
+
diff --git a/src/java/org/apache/lucene/analysis/de/package.html b/src/java/org/apache/lucene/analysis/de/package.html
new file mode 100644
index 0000000..05b4a9e
--- /dev/null
+++ b/src/java/org/apache/lucene/analysis/de/package.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+Support for indexing and searching German text.
+</body>
+</html>
diff --git a/src/java/org/apache/lucene/analysis/standard/Makefile b/src/java/org/apache/lucene/analysis/standard/Makefile
deleted file mode 100644
index 5a3ad75..0000000
--- a/src/java/org/apache/lucene/analysis/standard/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-ROOT = ../../../..
-
-include ../../rules.mk
-
-# Don't delete ParseException.java -- we've changed it by hand.
-DIRT := $(patsubst ParseException.java,,${DIRT})
-
diff --git a/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj b/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj
index 6abdc67..c1fe602 100644
--- a/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj
+++ b/src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj
@@ -168,7 +168,7 @@
 
 /** Returns the next token in the stream, or null at EOS.
  * <p>The returned token's type is set to an element of {@link
- * StandardTokenizerConstants.tokenImage}.
+ * StandardTokenizerConstants#tokenImage}.
  */
 org.apache.lucene.analysis.Token next() throws IOException :
 {
diff --git a/src/java/org/apache/lucene/document/Makefile b/src/java/org/apache/lucene/document/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/document/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/index/IndexReader.java b/src/java/org/apache/lucene/index/IndexReader.java
index 6aeca66..0abdb2c 100644
--- a/src/java/org/apache/lucene/index/IndexReader.java
+++ b/src/java/org/apache/lucene/index/IndexReader.java
@@ -58,6 +58,7 @@
 import java.io.File;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.Lock;
 import org.apache.lucene.document.Document;
 
 /** IndexReader is an abstract class, providing an interface for accessing an
@@ -89,17 +90,21 @@
   }
 
   /** Returns an IndexReader reading the index in the given Directory. */
-  public static IndexReader open(Directory directory) throws IOException {
-    synchronized (directory) {
-      SegmentInfos infos = new SegmentInfos();
-      infos.read(directory);
-      if (infos.size() == 1)			  // index is optimized
-	return new SegmentReader(infos.info(0), true);
-      
-      SegmentReader[] readers = new SegmentReader[infos.size()];
-      for (int i = 0; i < infos.size(); i++)
-	readers[i] = new SegmentReader(infos.info(i), i == infos.size() - 1);
-      return new SegmentsReader(readers);
+  public static IndexReader open(final Directory directory) throws IOException{
+    synchronized (directory) {			  // in- & inter-process sync
+      return (IndexReader)new Lock.With(directory.makeLock("commit.lock")) {
+	  public Object doBody() throws IOException {
+	    SegmentInfos infos = new SegmentInfos();
+	    infos.read(directory);
+	    if (infos.size() == 1)		  // index is optimized
+	      return new SegmentReader(infos.info(0), true);
+
+	    SegmentReader[] readers = new SegmentReader[infos.size()];
+	    for (int i = 0; i < infos.size(); i++)
+	      readers[i] = new SegmentReader(infos.info(i), i==infos.size()-1);
+	    return new SegmentsReader(readers);
+	  }
+	}.run();
     }
   }
 
diff --git a/src/java/org/apache/lucene/index/IndexWriter.java b/src/java/org/apache/lucene/index/IndexWriter.java
index 5136d64..fa1335c 100644
--- a/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/src/java/org/apache/lucene/index/IndexWriter.java
@@ -62,6 +62,7 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.Lock;
 import org.apache.lucene.store.InputStream;
 import org.apache.lucene.store.OutputStream;
 import org.apache.lucene.document.Document;
@@ -112,16 +113,25 @@
     analyzed with <code>a</code>.  If <code>create</code> is true, then a new,
     empty index will be created in <code>d</code>, replacing the index already
     there, if any. */
-  public IndexWriter(Directory d, Analyzer a, boolean create)
+  public IndexWriter(Directory d, Analyzer a, final boolean create)
        throws IOException {
     directory = d;
     analyzer = a;
 
-    synchronized (directory) {
-      if (create)
-	segmentInfos.write(directory);
-      else
-	segmentInfos.read(directory);
+    Lock writeLock = directory.makeLock("write.lock");
+    if (!writeLock.obtain())			  // obtain write lock
+      throw new IOException("Index locked for write: " + writeLock);
+
+    synchronized (directory) {			  // in- & inter-process sync
+      new Lock.With(directory.makeLock("commit.lock")) {
+	  public Object doBody() throws IOException {
+	    if (create)
+	      segmentInfos.write(directory);
+	    else
+	      segmentInfos.read(directory);
+	    return null;
+	  }
+	}.run();
     }
   }
 
@@ -130,6 +140,7 @@
   public final synchronized void close() throws IOException {
     flushRamSegments();
     ramDirectory.close();
+    directory.makeLock("write.lock").release();  // release write lock
     directory.close();
   }
 
@@ -286,7 +297,7 @@
     int mergedDocCount = 0;
     if (infoStream != null) infoStream.print("merging segments");
     SegmentMerger merger = new SegmentMerger(directory, mergedName);
-    Vector segmentsToDelete = new Vector();
+    final Vector segmentsToDelete = new Vector();
     for (int i = minSegment; i < segmentInfos.size(); i++) {
       SegmentInfo si = segmentInfos.info(i);
       if (infoStream != null)
@@ -307,9 +318,14 @@
     segmentInfos.addElement(new SegmentInfo(mergedName, mergedDocCount,
 					    directory));
     
-    synchronized (directory) {
-      segmentInfos.write(directory);		  // commit before deleting
-      deleteSegments(segmentsToDelete);		  // delete now-unused segments
+    synchronized (directory) {			  // in- & inter-process sync
+      new Lock.With(directory.makeLock("commit.lock")) {
+	  public Object doBody() throws IOException {
+	    segmentInfos.write(directory);	  // commit before deleting
+	    deleteSegments(segmentsToDelete);	  // delete now-unused segments
+	    return null;
+	  }
+	}.run();
     }
   }
 
diff --git a/src/java/org/apache/lucene/index/Makefile b/src/java/org/apache/lucene/index/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/index/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/index/SegmentReader.java b/src/java/org/apache/lucene/index/SegmentReader.java
index 6729220..ac054f7 100644
--- a/src/java/org/apache/lucene/index/SegmentReader.java
+++ b/src/java/org/apache/lucene/index/SegmentReader.java
@@ -61,6 +61,7 @@
 
 import org.apache.lucene.util.BitVector;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.Lock;
 import org.apache.lucene.store.InputStream;
 import org.apache.lucene.document.Document;
 
@@ -116,9 +117,14 @@
   
   public final synchronized void close() throws IOException {
     if (deletedDocsDirty) {
-      synchronized (directory) {
-	deletedDocs.write(directory, segment + ".tmp");
-	directory.renameFile(segment + ".tmp", segment + ".del");
+      synchronized (directory) {		  // in- & inter-process sync
+	new Lock.With(directory.makeLock("commit.lock")) {
+	    public Object doBody() throws IOException {
+	      deletedDocs.write(directory, segment + ".tmp");
+	      directory.renameFile(segment + ".tmp", segment + ".del");
+	      return null;
+	    }
+	  }.run();
       }
       deletedDocsDirty = false;
     }
diff --git a/src/java/org/apache/lucene/queryParser/Makefile b/src/java/org/apache/lucene/queryParser/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/queryParser/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/queryParser/QueryParser.jj b/src/java/org/apache/lucene/queryParser/QueryParser.jj
index 6eab8f0..ec87328 100644
--- a/src/java/org/apache/lucene/queryParser/QueryParser.jj
+++ b/src/java/org/apache/lucene/queryParser/QueryParser.jj
@@ -197,6 +197,35 @@
     }
   }
 
+  private Query getRangeQuery(String field, Analyzer analyzer, String queryText, boolean inclusive) 
+  {
+    // Use the analyzer to get all the tokens.  There should be 1 or 2.
+    TokenStream source = analyzer.tokenStream(field, new StringReader(queryText));
+    Term[] terms = new Term[2];
+    org.apache.lucene.analysis.Token t;
+
+    for (int i = 0; i < 2; i++)
+    {
+      try 
+      {
+        t = source.next();
+      } 
+      catch (IOException e) 
+      {
+        t = null;
+      }
+      if (t != null)
+      {
+        String text = t.termText();
+        if (!text.equalsIgnoreCase("NULL"))
+        {
+          terms[i] = new Term(field, text);
+        }
+      }
+    }
+    return new RangeQuery(terms[0], terms[1], inclusive);
+  }
+
   public static void main(String[] args) throws Exception {
     QueryParser qp = new QueryParser("field", 
                                      new org.apache.lucene.analysis.SimpleAnalyzer());
@@ -245,10 +274,12 @@
 | <QUOTED:     "\"" (~["\""])+ "\"">
 | <NUMBER:    (<_NUM_CHAR>)+ "." (<_NUM_CHAR>)+ >
 | <TERM:      <_IDENTIFIER_CHAR> 
-              ( ~["\"", " ", "\t", "(", ")", ":", "&", "|", "^", "*", "?", "~" ] )* >
+              ( ~["\"", " ", "\t", "(", ")", ":", "&", "|", "^", "*", "?", "~", "{", "}", "[", "]" ] )* >
 | <FUZZY:     "~" >
 | <WILDTERM:  <_IDENTIFIER_CHAR>
-              ( ~["\"", " ", "\t", "(", ")", ":", "&", "|", "^", "~" ] )* <_IDENTIFIER_CHAR>>
+              ( ~["\"", " ", "\t", "(", ")", ":", "&", "|", "^", "~", "{", "}", "[", "]" ] )* <_IDENTIFIER_CHAR>>
+| <RANGEIN:   "[" (~["]"])+ "]">
+| <RANGEEX:   "{" (~["}"])+ "}">
 }
 
 <DEFAULT> SKIP : {
@@ -327,6 +358,7 @@
   boolean prefix = false;
   boolean wildcard = false;
   boolean fuzzy = false;
+  boolean rangein = false;
   Query q;
 }
 {
@@ -340,6 +372,11 @@
           q = new FuzzyQuery(new Term(field, term.image));
         else
           q = getFieldQuery(field, analyzer, term.image); }
+    | (term=<RANGEIN>{rangein=true;}|term=<RANGEEX>)
+        {
+          q = getRangeQuery(field, analyzer, 
+                            term.image.substring(1, term.image.length()-1), rangein);
+        }
     | term=<QUOTED> 
       { q = getFieldQuery(field, analyzer, 
                           term.image.substring(1, term.image.length()-1)); }
diff --git a/src/java/org/apache/lucene/rootrules.mk b/src/java/org/apache/lucene/rootrules.mk
deleted file mode 100644
index 04b788f..0000000
--- a/src/java/org/apache/lucene/rootrules.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-# rules to enable the running of "make jar" and the like from any dir..
-
-# directories containing java source code
-DIRS = store util document analysis analysis/standard index search queryParser
-PACKAGES = $(subst /,.,$(patsubst %,com.lucene.%,$(DIRS)))
-
-ifeq ($(JAVALINK),) 
-  JAVALINK = http://java.sun.com/products/jdk/1.3/docs/api/
-endif
-
-# OLDJAVA does not have a -link option
-ifeq ($(OLDJAVA),)
-  JLINK_OPT = -link $(JAVALINK)
-  JAR_CMD = $(JAR) -cvfm lucene.jar com/lucene/manifest
-else
-  JAR_CMD = $(JAR) -cvf lucene.jar
-endif
-
-.PHONY: jar doc demo release
-
-jar:	all_classes
-	cd $(ROOT) && $(JAR_CMD) \
-	 `ls com/lucene/*/*.class` `ls com/lucene/*/*/*.class`
-
-doc:	all_classes
-	if [ -d $(ROOT)/doc/api ]; then rm -rf $(ROOT)/doc/api ;fi
-	mkdir $(ROOT)/doc/api
-	$(JAVADOC) -classpath '$(CLASSPATH)' -author -version \
-	 -d $(ROOT)/doc/api $(JLINK_OPT) $(PACKAGES)
-
-demo: all_classes
-	$(MAKE) -C $(ROOT)/demo/HTMLParser -w
-	$(MAKE) -C $(ROOT)/demo -w CLASSPATH=..
-
-release: jar demo doc
-	cd $(ROOT) && tar cvf lucene.tar lucene.jar doc/*.html doc/api \
-	   demo/*.java demo/*.class demo/*.html demo/*.jhtml \
-	   demo/HTMLParser/*.class demo/HTMLParser/*.jj \
-	   demo/HTMLParser/*.java
-
-# make all the Lucene classes 
-all_classes : TARGET = classes
-all_classes : $(DIRS)
-
-.PHONY: $(DIRS)
-$(DIRS):
-	$(MAKE) -C $(ROOT)/com/lucene/$@ -w $(TARGET)
-
-# Removes all generated files from src directories.
-src_clean: TARGET = clean
-src_clean: $(DIRS) clean
-
-# Removes all generated files.
-real_clean: DIRS += demo
-real_clean: DIRS += demo/HTMLParser
-real_clean: TARGET = clean
-real_clean: $(DIRS) clean
-	cd $(ROOT) && rm -rf lucene.jar lucene.tar doc/api
diff --git a/src/java/org/apache/lucene/rules.mk b/src/java/org/apache/lucene/rules.mk
deleted file mode 100644
index 9222636..0000000
--- a/src/java/org/apache/lucene/rules.mk
+++ /dev/null
@@ -1,128 +0,0 @@
-# GNU make rules for lucene
-
-# determine whether we're on Win32 or Unix
-ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
-  OS = win32
-else
-  OS = unix
-endif
-
-# DOS compatibility:
-# These should be used in variables that end up in CLASSPATH.
-ifeq ($(OS),win32)
-  SLASH=\\
-  COLON=;
-else
-  SLASH=/
-  COLON=:
-endif
-
-# ROOT should be set to the root directory of the Lucene package
-# hierarchy.  This is typically ../../.., as most packages are of the
-# form com.lucene.<package>.
-ifeq ($(ROOT),)
-  ROOT = ..$(SLASH)..$(SLASH)..
-else
-  ROOT := $(subst /,$(SLASH),$(ROOT))
-endif
-
-#include all the relevant variables
-include $(subst $(SLASH),/,$(ROOT))/com/lucene/variables.mk
-
-# directories containing java source code
-DIRS = store util document analysis analysis/standard index search queryParser
-PACKAGES = $(subst /,.,$(patsubst %,com.lucene.%,$(DIRS)))
-
-ifeq ($(JDK_HOME),)
-  ifneq ($(JAVA_HOME),)
-     JDK_HOME=$(JAVA_HOME)
-   else
-     ifeq ($(OS),win32)
-       JDK_HOME = C:/jdk1.3.1
-     else
-       JDK_HOME = /usr/local/java/jdk1.3.1
-     endif
-   endif
-endif
-
-# Location of JavaCC
-ifeq ($(JAVACC),)
- ifeq ($(OS),win32)
-  JAVACC = C:/javacc2_0/bin/lib/JavaCC.zip
- else
-  JAVACC = /usr/local/java/javacc2_0/bin/lib/JavaCC.zip
- endif
-endif
-
-JAVADIR = $(subst \,/,$(JDK_HOME))
-
-# The compiler executable.
-ifeq ($(JAVAC),)
-  JAVAC = $(JAVADIR)/bin/javac
-endif
-
-# The java executable
-JAVA = $(JAVADIR)/bin/java
-
-# The jar executable
-JAR = $(JAVADIR)/bin/jar
-
-# javadoc
-JAVADOC = $(JAVADIR)/bin/javadoc
-
-# Options to pass to Java compiler
-ifeq ($(JFLAGS),)
-  JFLAGS = -O
-endif
-
-
-# CLASSPATH
-# By default include the Lucene root, and Java's builtin classes
-ifeq ($(OLDJAVA),)
-  export CLASSPATH=$(PREPENDCLASSPATH)$(COLON)$(ROOT)$(COLON)$(JDK_HOME)$(SLASH)jre$(SLASH)lib$(SLASH)rt.jar
-else
-  export CLASSPATH=$(PREPENDCLASSPATH)$(COLON)$(ROOT)$(COLON)$(JDK_HOME)$(SLASH)lib$(SLASH)classes.zip
-endif
-
-# JIKESPATH overrides the classpath variable for jikes, so we need to set it
-# here to avoid problems with a jikes user
-export JIKESPATH=$(CLASSPATH)
-
-## Rules
-
-# Use JAVAC to compile .java files into .class files
-%.class : %.java
-	$(JAVAC) $(JFLAGS) $<
-
-# Compile .jj files to .java with JavaCC
-%.java : %.jj
-	$(JAVA) -classpath '$(CLASSPATH)$(COLON)$(JAVACC)' COM.sun.labs.javacc.Main $<
-
-# Add JavaCC generated files to 'classes' and 'clean' targets.
-JJFILES = $(wildcard *.jj)
-ifneq ($(JJFILES),)
-  CLASSES += $(patsubst %.jj,%.class,  $(JJFILES))
-  DIRT += $(patsubst %.jj,%.java, $(JJFILES))
-  DIRT += $(patsubst %.jj,%Constants.java, $(JJFILES))
-  DIRT += $(patsubst %.jj,%TokenManager.java, $(JJFILES))
-  DIRT += Token.java TokenMgrError.java TokenManager.java \
-          CharStream.java ASCII_CharStream.java ParseException.java
-endif
-
-
-# Don't delete parser's .java file -- it's needed by javadoc.
-.PRECIOUS: $(patsubst %.jj,%.java, $(JJFILES))
-
-
-# Assume all .java files should have a .class file.
-CLASSES += $(patsubst %.java,%.class,$(wildcard *.java))
-
-# default rule
-classes : $(CLASSES)
-
-# Removes all generated files from the connected src directory.
-clean:
-	rm -f *.class $(DIRT)
-
-# include all the rules for the root directory..
-include $(subst $(SLASH),/,$(ROOT))/com/lucene/rootrules.mk
diff --git a/src/java/org/apache/lucene/search/HitCollector.java b/src/java/org/apache/lucene/search/HitCollector.java
index ca66b56..de22ddb 100644
--- a/src/java/org/apache/lucene/search/HitCollector.java
+++ b/src/java/org/apache/lucene/search/HitCollector.java
@@ -55,7 +55,7 @@
  */
 
 /** Lower-level search API.
- * @see IndexSearcher#search(Query,HitCollector)
+ * @see Searcher#search(Query,HitCollector)
  */
 public abstract class HitCollector {
   /** Called once for every non-zero scoring document, with the document number
@@ -71,6 +71,12 @@
    *       }
    *     });
    * </pre>
-   */
+   *
+   * <p>Note: This is called in an inner search loop.  For good search
+   * performance, implementations of this method should not call {@link
+   * Searcher#doc(int)} or {@link
+   * org.apache.lucene.index.IndexReader#document(int)} on every document
+   * number encountered.  Doing so can slow searches by an order of magnitude
+   * or more. */
   public abstract void collect(int doc, float score);
 }
diff --git a/src/java/org/apache/lucene/search/IndexSearcher.java b/src/java/org/apache/lucene/search/IndexSearcher.java
index 69fda6b..9744a70 100644
--- a/src/java/org/apache/lucene/search/IndexSearcher.java
+++ b/src/java/org/apache/lucene/search/IndexSearcher.java
@@ -91,7 +91,8 @@
     return reader.docFreq(term);
   }
 
-  final Document doc(int i) throws IOException {
+  /** For use by {@link HitCollector} implementations. */
+  public final Document doc(int i) throws IOException {
     return reader.document(i);
   }
 
@@ -140,21 +141,12 @@
    * <p>Applications should only use this if they need <it>all</it> of the
    * matching documents.  The high-level search API ({@link
    * Searcher#search(Query)}) is usually more efficient, as it skips
-   * non-high-scoring hits.  */
-  public final void search(Query query, HitCollector results)
-      throws IOException {
-    search(query, null, results);
-  }
-
-  /** Lower-level search API.
+   * non-high-scoring hits.
    *
-   * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
-   * scoring document.
-   *
-   * <p>Applications should only use this if they need <it>all</it> of the
-   * matching documents.  The high-level search API ({@link
-   * Searcher#search(Query)}) is usually more efficient, as it skips
-   * non-high-scoring hits.  */
+   * @param query to match documents
+   * @param filter if non-null, a bitset used to eliminate some documents
+   * @param results to receive hits
+   */
   public final void search(Query query, Filter filter,
 			   final HitCollector results) throws IOException {
     HitCollector collector = results;
diff --git a/src/java/org/apache/lucene/search/Makefile b/src/java/org/apache/lucene/search/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/search/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/search/MultiSearcher.java b/src/java/org/apache/lucene/search/MultiSearcher.java
index 86e9c3c..ec14aaa 100644
--- a/src/java/org/apache/lucene/search/MultiSearcher.java
+++ b/src/java/org/apache/lucene/search/MultiSearcher.java
@@ -92,13 +92,16 @@
     return docFreq;
   }
 
-  final Document doc(int n) throws IOException {
+  /** For use by {@link HitCollector} implementations. */
+  public final Document doc(int n) throws IOException {
     int i = searcherIndex(n);			  // find searcher index
     return searchers[i].doc(n - starts[i]);	  // dispatch to searcher
   }
 
-  // replace w/ call to Arrays.binarySearch in Java 1.2
-  private final int searcherIndex(int n) {	  // find searcher for doc n:
+  /** For use by {@link HitCollector} implementations to identify the
+   * index of the sub-searcher that a particular hit came from. */
+  public final int searcherIndex(int n) {	  // find searcher for doc n:
+    // replace w/ call to Arrays.binarySearch in Java 1.2
     int lo = 0;					  // search starts array
     int hi = searchers.length - 1;		  // for first element less
 						  // than n, return its index
@@ -149,4 +152,35 @@
     
     return new TopDocs(totalHits, scoreDocs);
   }
+
+
+  /** Lower-level search API.
+   *
+   * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
+   * scoring document.
+   *
+   * <p>Applications should only use this if they need <it>all</it> of the
+   * matching documents.  The high-level search API ({@link
+   * Searcher#search(Query)}) is usually more efficient, as it skips
+   * non-high-scoring hits.
+   *
+   * @param query to match documents
+   * @param filter if non-null, a bitset used to eliminate some documents
+   * @param results to receive hits
+   */
+  public final void search(Query query, Filter filter,
+			   final HitCollector results)
+    throws IOException {
+    for (int i = 0; i < searchers.length; i++) {
+      
+      final int start = starts[i];
+
+      searchers[i].search(query, filter, new HitCollector() {
+	  public void collect(int doc, float score) {
+	    results.collect(doc + start, score);
+	  }
+	});
+
+    }
+  }
 }
diff --git a/src/java/org/apache/lucene/search/RangeQuery.java b/src/java/org/apache/lucene/search/RangeQuery.java
new file mode 100644
index 0000000..5464238
--- /dev/null
+++ b/src/java/org/apache/lucene/search/RangeQuery.java
@@ -0,0 +1,223 @@
+package org.apache.lucene.search;
+
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ *    "Apache Lucene" must not be used to endorse or promote products
+ *    derived from this software without prior written permission. For
+ *    written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    "Apache Lucene", nor may "Apache" appear in their name, without
+ *    prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+import java.io.IOException;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.index.TermDocs;
+import org.apache.lucene.index.IndexReader;
+
+/** A Query that matches documents within an exclusive range. */
+public final class RangeQuery extends Query
+{
+    private Term lowerTerm;
+    private Term upperTerm;
+    private boolean inclusive;
+    private IndexReader reader;
+    private float boost = 1.0f;
+    private BooleanQuery query;
+    
+    /** Constructs a query selecting all terms greater than 
+     * <code>lowerTerm</code> but less than <code>upperTerm</code>.
+     * There must be at least one term and either term may be null--
+     * in which case there is no bound on that side, but if there are 
+     * two term, both terms <b>must</b> be for the same field.
+     */
+    public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive)
+    {
+        if (lowerTerm == null && upperTerm == null)
+        {
+            throw new IllegalArgumentException("At least one term must be non-null");
+        }
+        if (lowerTerm != null && upperTerm != null && lowerTerm.field() != upperTerm.field())
+        {
+            throw new IllegalArgumentException("Both terms must be for the same field");
+        }
+        this.lowerTerm = lowerTerm;
+        this.upperTerm = upperTerm;
+        this.inclusive = inclusive;
+    }
+    
+    /** Sets the boost for this term to <code>b</code>.  Documents containing
+    this term will (in addition to the normal weightings) have their score
+    multiplied by <code>boost</code>. */
+    public void setBoost(float boost)
+    {
+        this.boost = boost;
+    }
+    
+    /** Returns the boost for this term. */
+    public float getBoost()
+    {
+        return boost;
+    }
+    
+    final void prepare(IndexReader reader)
+    {
+        this.query = null;
+        this.reader = reader;
+    }
+    
+    final float sumOfSquaredWeights(Searcher searcher) throws IOException
+    {
+        return getQuery().sumOfSquaredWeights(searcher);
+    }
+    
+    void normalize(float norm)
+    {
+        try
+        {
+            getQuery().normalize(norm);
+        } 
+        catch (IOException e)
+        {
+            throw new RuntimeException(e.toString());
+        }
+    }
+    
+    Scorer scorer(IndexReader reader) throws IOException
+    {
+        return getQuery().scorer(reader);
+    }
+    
+    private BooleanQuery getQuery() throws IOException
+    {
+        if (query == null)
+        {
+            BooleanQuery q = new BooleanQuery();
+            // if we have a lowerTerm, start there. otherwise, start at beginning
+            if (lowerTerm == null) lowerTerm = new Term(getField(), "");
+            TermEnum enum = reader.terms(lowerTerm);
+            try
+            {
+                String lowerText = null;
+                String field;
+                boolean checkLower = false;
+                if (!inclusive) // make adjustments to set to exclusive
+                {
+                    if (lowerTerm != null)
+                    {
+                        lowerText = lowerTerm.text();
+                        checkLower = true;
+                    }
+                    if (upperTerm != null)
+                    {
+                        // set upperTerm to an actual term in the index
+                        TermEnum uppEnum = reader.terms(upperTerm);
+                        upperTerm = uppEnum.term();
+                    }
+                }
+                String testField = getField();
+                do
+                {
+                    Term term = enum.term();
+                    if (term != null && term.field() == testField)
+                    {
+                        if (!checkLower || term.text().compareTo(lowerText) > 0) 
+                        {
+                            checkLower = false;
+                            // if exclusive and this is last term, don't count it and break
+                            if (!inclusive && (upperTerm != null) && (upperTerm.compareTo(term) <= 0)) break;
+                            TermQuery tq = new TermQuery(term);	  // found a match
+                            tq.setBoost(boost);               // set the boost
+                            q.add(tq, false, false);		  // add to q
+                            // if inclusive just added last term, break out
+                            if (inclusive && (upperTerm != null) && (upperTerm.compareTo(term) <= 0)) break;
+                        }
+                    } 
+                    else
+                    {
+                        break;
+                    }
+                }
+                while (enum.next());
+            } 
+            finally
+            {
+                enum.close();
+            }
+            query = q;
+        }
+        return query;
+    }
+    
+    private String getField()
+    {
+        return (lowerTerm != null ? lowerTerm.field() : upperTerm.field());
+    }
+    
+    /** Prints a user-readable version of this query. */
+    public String toString(String field)
+    {
+        StringBuffer buffer = new StringBuffer();
+        if (!getField().equals(field))
+        {
+            buffer.append(getField());
+            buffer.append(":");
+        }
+        buffer.append(inclusive ? "[" : "{");
+        buffer.append(lowerTerm != null ? lowerTerm.text() : "null");
+        buffer.append("-");
+        buffer.append(upperTerm != null ? upperTerm.text() : "null");
+        buffer.append(inclusive ? "]" : "}");
+        if (boost != 1.0f)
+        {
+            buffer.append("^");
+            buffer.append(Float.toString(boost));
+        }
+        return buffer.toString();
+    }
+}
diff --git a/src/java/org/apache/lucene/search/Searcher.java b/src/java/org/apache/lucene/search/Searcher.java
index 9c98810..90d8bc7 100644
--- a/src/java/org/apache/lucene/search/Searcher.java
+++ b/src/java/org/apache/lucene/search/Searcher.java
@@ -66,15 +66,46 @@
 
   /** Returns the documents matching <code>query</code>. */
   public final Hits search(Query query) throws IOException {
-    return search(query, null);
+    return search(query, (Filter)null);
   }
 
   /** Returns the documents matching <code>query</code> and
     <code>filter</code>. */
-  public final Hits search(Query query, Filter filter) throws IOException {
+  public Hits search(Query query, Filter filter) throws IOException {
     return new Hits(this, query, filter);
   }
 
+  /** Lower-level search API.
+   *
+   * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
+   * scoring document.
+   *
+   * <p>Applications should only use this if they need <it>all</it> of the
+   * matching documents.  The high-level search API ({@link
+   * Searcher#search(Query)}) is usually more efficient, as it skips
+   * non-high-scoring hits.  */
+  public void search(Query query, HitCollector results)
+    throws IOException {
+    search(query, (Filter)null, results);
+  }    
+
+  /** Lower-level search API.
+   *
+   * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
+   * scoring document.
+   *
+   * <p>Applications should only use this if they need <it>all</it> of the
+   * matching documents.  The high-level search API ({@link
+   * Searcher#search(Query)}) is usually more efficient, as it skips
+   * non-high-scoring hits.
+   *
+   * @param query to match documents
+   * @param filter if non-null, a bitset used to eliminate some documents
+   * @param results to receive hits
+   */
+  public abstract void search(Query query, Filter filter, HitCollector results)
+    throws IOException;
+
   /** Frees resources associated with this Searcher. */
   abstract public void close() throws IOException;
 
@@ -82,6 +113,7 @@
   abstract int maxDoc() throws IOException;
   abstract TopDocs search(Query query, Filter filter, int n)
        throws IOException;
-  abstract Document doc(int i) throws IOException;
 
+  /** For use by {@link HitCollector} implementations. */
+  public abstract Document doc(int i) throws IOException;
 }
diff --git a/src/java/org/apache/lucene/store/Directory.java b/src/java/org/apache/lucene/store/Directory.java
index 2660c03..2aaacbf 100644
--- a/src/java/org/apache/lucene/store/Directory.java
+++ b/src/java/org/apache/lucene/store/Directory.java
@@ -108,6 +108,11 @@
   abstract public InputStream openFile(String name)
        throws IOException, SecurityException;
 
+  /** Construct a {@link Lock}.
+   * @param name the name of the lock file
+   */
+  abstract public Lock makeLock(String name);
+
   /** Closes the store. */
   abstract public void close()
        throws IOException, SecurityException;
diff --git a/src/java/org/apache/lucene/store/FSDirectory.java b/src/java/org/apache/lucene/store/FSDirectory.java
index e158501..6587e4f 100644
--- a/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/src/java/org/apache/lucene/store/FSDirectory.java
@@ -206,6 +206,24 @@
     return new FSInputStream(new File(directory, name));
   }
 
+  /** Construct a {@link Lock}.
+   * @param name the name of the lock file
+   */
+  public final Lock makeLock(String name) {
+    final File lockFile = new File(directory, name);
+    return new Lock() {
+	public boolean obtain() throws IOException {
+	  return lockFile.createNewFile();
+	}
+	public void release() {
+	  lockFile.delete();
+	}
+	public String toString() {
+	  return "Lock@" + lockFile;
+	}
+      };
+  }
+
   /** Closes the store to future operations. */
   public final synchronized void close() throws IOException {
     if (--refCount <= 0) {
@@ -214,6 +232,11 @@
       }
     }
   }
+
+  /** For debug output. */
+  public String toString() {
+    return "FSDirectory@" + directory;
+  }
 }
 
 
@@ -278,8 +301,6 @@
   RandomAccessFile file = null;
 
   public FSOutputStream(File path) throws IOException {
-    if (path.isFile())
-      throw new IOException(path + " already exists");
     file = new RandomAccessFile(path, "rw");
   }
 
diff --git a/src/java/org/apache/lucene/store/Lock.java b/src/java/org/apache/lucene/store/Lock.java
new file mode 100644
index 0000000..46d8a03
--- /dev/null
+++ b/src/java/org/apache/lucene/store/Lock.java
@@ -0,0 +1,125 @@
+package org.apache.lucene.store;
+
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ *    "Apache Lucene" must not be used to endorse or promote products
+ *    derived from this software without prior written permission. For
+ *    written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    "Apache Lucene", nor may "Apache" appear in their name, without
+ *    prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+import java.io.IOException;
+
+/** An interprocess mutex lock.
+ * <p>Typical use might look like:<pre>
+ * new Lock.With(directory.makeLock("my.lock")) {
+ *     public Object doBody() {
+ *       <it>... code to execute while locked ...</it>
+ *     }
+ *   }.run();
+ * </pre>
+ *
+ * @author Doug Cutting
+ * @see Directory#makeLock(String)
+*/
+
+public abstract class Lock {
+  /** Attempt to obtain exclusive access.
+   *
+   * @return true iff exclusive access is obtained
+   */
+  public abstract boolean obtain() throws IOException;
+
+  /** Release exclusive access. */
+  public abstract void release();
+
+  /** Utility class for executing code with exclusive access. */
+  public abstract static class With {
+    private Lock lock;
+    private int sleepInterval = 1000;
+    private int maxSleeps = 10;
+    
+    /** Constructs an executor that will grab the named lock. */
+    public With(Lock lock) {
+      this.lock = lock;
+    }
+
+    /** Code to execute with exclusive access. */
+    protected abstract Object doBody() throws IOException;
+
+    /** Calls {@link #doBody} while <it>lock</it> is obtained.  Blocks if lock
+     * cannot be obtained immediately.  Retries to obtain lock once per second
+     * until it is obtained, or until it has tried ten times. */
+    public Object run() throws IOException {
+      boolean locked = false;
+      try {
+	locked = lock.obtain();
+	int sleepCount = 0;
+	while (!locked) {
+	  if (++sleepCount == maxSleeps) {
+	    throw new IOException("Timed out waiting for: " + lock);
+	  }
+	  try {
+	    Thread.sleep(sleepInterval);
+	  } catch (InterruptedException e) {
+	    throw new IOException(e.toString());
+	  }
+	  locked = lock.obtain();
+	}
+
+	return doBody();
+	
+      } finally {
+	if (locked)
+	  lock.release();
+      }
+    }
+  }
+
+}
diff --git a/src/java/org/apache/lucene/store/Makefile b/src/java/org/apache/lucene/store/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/store/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/store/RAMDirectory.java b/src/java/org/apache/lucene/store/RAMDirectory.java
index c67e5d5..93dbc93 100644
--- a/src/java/org/apache/lucene/store/RAMDirectory.java
+++ b/src/java/org/apache/lucene/store/RAMDirectory.java
@@ -123,6 +123,26 @@
     return new RAMInputStream(file);
   }
 
+  /** Construct a {@link Lock}.
+   * @param name the name of the lock file
+   */
+  public final Lock makeLock(final String name) {
+    return new Lock() {
+	public boolean obtain() throws IOException {
+	  synchronized (files) {
+	    if (!fileExists(name)) {
+	      createFile(name).close();
+	      return true;
+	    }
+	    return false;
+	  }
+	}
+	public void release() {
+	  deleteFile(name);
+	}
+      };
+  }
+
   /** Closes the store to future operations. */
   public final void close() {
   }
diff --git a/src/java/org/apache/lucene/util/Makefile b/src/java/org/apache/lucene/util/Makefile
deleted file mode 100644
index 09c091d..0000000
--- a/src/java/org/apache/lucene/util/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# sub-directory makefile for lucene
-include ../rules.mk
diff --git a/src/java/org/apache/lucene/variables.mk b/src/java/org/apache/lucene/variables.mk
deleted file mode 100644
index d6a15ec..0000000
--- a/src/java/org/apache/lucene/variables.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# User variables for make. Customize for your installation as needed.
-# Anything set here override the defaults set in rules.mk
-
-# where your JDK is installed. 
-# Please note: this is not the same as JAVA_HOME!
-# Default is: C:/jdk1.3 or /usr/local/java/jdk1.3 depending on OS
-# JDK_HOME=
-
-# set this if you are using JDK1.1.x
-# OLDJAVA=1
-
-# set this if you are using a custom java compiler (i.e. jikes)
-# Default is: $JDK_HOME/bin/javac
-# JAVAC=jikes
-
-# set this to the location of the javacc zip file
-# Default is:
-# JAVACC=/usr/local/java/javacc2_0/bin/lib/JavaCC.zip
-
-# Set this to the flags you want to give your java compiler
-# -O by default.
-# Use JFLAGS=-g to generate debuggable code.
-# JFLAGS= -O
-
-# prepend any custom classpath here:
-# PREPENDCLASSPATH=
-
-# where the default java documentation is
-# Default is:
-# JAVALINK = http://java.sun.com/products/jdk/1.3/docs/api/
diff --git a/src/java/overview.html b/src/java/overview.html
new file mode 100644
index 0000000..adfcf83
--- /dev/null
+++ b/src/java/overview.html
@@ -0,0 +1,168 @@
+<html>
+<head>
+   <title>Jakarta Lucene API</title>
+</head>
+<body>
+
+<h1>Jakarta Lucene API</h1>
+The Jakarta Lucene API is divided into several packages:
+<ul>
+<li>
+<b><a href="org/apache/lucene/util/package-summary.html">com.lucene.util</a></b>
+contains a few handy data structures, e.g., <a href="org/apache/lucene/util/BitVector.html">BitVector</a>
+and <a href="org/apache/lucene/util/PriorityQueue.html">PriorityQueue</a>.</li>
+
+<li>
+<b><a href="org/apache/lucene/store/package-summary.html">com.lucene.store</a></b>
+defines an abstract class for storing persistent data, the <a href="org/apache/lucene/store/Directory.html">Directory</a>,
+a collection of named files written by an <a href="org/apache/lucene/store/OutputStream.html">OutputStream</a>
+and read by an <a href="org/apache/lucene/store/InputStream.html">InputStream</a>.&nbsp;
+Two implementations are provided, <a href="org/apache/lucene/store/FSDirectory.html">FSDirectory</a>,
+which uses a file system directory to store files, and <a href="org/apache/lucene/store/RAMDirectory.html">RAMDirectory</a>
+which implements files as memory-resident data structures.</li>
+
+<li>
+<b><a href="org/apache/lucene/document/package-summary.html">com.lucene.document</a></b>
+provides a simple <a href="org/apache/lucene/document/Document.html">Document</a>
+class.&nbsp; A document is simply a set of named <a href="org/apache/lucene/document/Field.html">Field</a>'s,
+whose values may be strings or instances of <a href="http://java.sun.com/products/jdk/1.2/docs/api/java/io/Reader.html">java.io.Reader</a>.</li>
+
+<li>
+<b><a href="org/apache/lucene/analysis/package-summary.html">com.lucene.analysis</a></b>
+defines an abstract <a href="org/apache/lucene/analysis/Analyzer.html">Analyzer</a>
+API for converting text from a <a href="http://java.sun.com/products/jdk/1.2/docs/api/java/io/Reader.html">java.io.Reader</a>
+into a <a href="org/apache/lucene/analysis/TokenStream.html">TokenStream</a>,
+an enumeration of&nbsp; <a href="org/apache/lucene/analysis/Token.html">Token</a>'s.&nbsp;
+A TokenStream is composed by applying <a href="org/apache/lucene/analysis/TokenFilter.html">TokenFilter</a>'s
+to the output of a <a href="org/apache/lucene/analysis/Tokenizer.html">Tokenizer</a>.&nbsp;
+A few simple implemenations are provided, including <a href="org/apache/lucene/analysis/StopAnalyzer.html">StopAnalyzer</a>
+and the grammar-based <a href="org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>.</li>
+
+<li>
+<b><a href="org/apache/lucene/index/package-summary.html">com.lucene.index</a></b>
+provides two primary classes: <a href="org/apache/lucene/index/IndexWriter.html">IndexWriter</a>,
+which creates and adds documents to indices; and <a href="org/apache/lucene/index/IndexReader.html">IndexReader</a>,
+which accesses the data in the index.</li>
+
+<li>
+<b><a href="org/apache/lucene/search/package-summary.html">com.lucene.search</a></b>
+provides data structures to represent queries (<a href="org/apache/lucene/search/TermQuery.html">TermQuery</a>
+for individual words, <a href="org/apache/lucene/search/PhraseQuery.html">PhraseQuery</a>
+for phrases, and <a href="org/apache/lucene/search/BooleanQuery.html">BooleanQuery</a>
+for boolean combinations of queries) and the abstract <a href="org/apache/lucene/search/Searcher.html">Searcher</a>
+which turns queries into <a href="org/apache/lucene/search/Hits.html">Hits</a>.
+<a href="org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>
+implements search over a single IndexReader.</li>
+
+<li>
+<b><a href="org/apache/lucene/queryParser/package-summary.html">com.lucene.queryParser</a></b>
+uses <a href="http://www.suntest.com/JavaCC/">JavaCC</a> to implement a
+<a href="org/apache/lucene/queryParser/QueryParser.html">QueryParser</a>.</li>
+</ul>
+To use Lucene, an application should:
+<ol>
+<li>
+Create <a href="org/apache/lucene/document/Document.html">Document</a>'s by
+adding
+<a href="org/apache/lucene/document/Field.html">Field</a>'s.</li>
+
+<li>
+Create an <a href="org/apache/lucene/index/IndexWriter.html">IndexWriter</a>
+and add documents to to it with <a href="org/apache/lucene/index/IndexWriter.html#addDocument(com.lucene.document.Document)">addDocument()</a>;</li>
+
+<li>
+Call <a href="org/apache/lucene/queryParser/QueryParser.html#parse(java.lang.String)">QueryParser.parse()</a>
+to build a query from a string; and</li>
+
+<li>
+Create an <a href="org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>
+and pass the query to it's <a href="org/apache/lucene/search/Searcher.html#search(com.lucene.search.Query)">search()</a>
+method.</li>
+</ol>
+Some simple examples of code which does this are:
+<ul>
+<li>
+&nbsp;<a href="../../demo/src/org/apache/lucene/FileDocument.java">FileDocument.java</a> contains
+code to create a Document for a file.</li>
+
+<li>
+&nbsp;<a href="../../demo/src/org/apache/lucene/IndexFiles.java">IndexFiles.java</a> creates an
+index for all the files contained in a directory.</li>
+
+<li>
+&nbsp;<a href="../../demo/src/org/apache/lucene/DeleteFiles.java">DeleteFiles.java</a> deletes some
+of these files from the index.</li>
+
+<li>
+&nbsp;<a href="../../demo/src/org/apache/lucene/SearchFiles.java">SearchFiles.java</a> prompts for
+queries and searches an index.</li>
+</ul>
+To demonstrate these, try something like:
+<blockquote><tt>> <b>java -cp lucene.jar:demo/classes org.apache.lucene.IndexFiles rec.food.recipes/soups</b></tt>
+<br><tt>adding rec.food.recipes/soups/abalone-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... ]
+<p><tt>> <b>java -cp lucene.jar:demo/classes org.apache.lucene.IndexFilesSearchFiles</b></tt>
+<br><tt>Query: <b>chowder</b></tt>
+<br><tt>Searching for: chowder</tt>
+<br><tt>34 total matching documents</tt>
+<br><tt>0. rec.food.recipes/soups/spam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... thirty-four documents contain the word "chowder",
+"spam-chowder" with the greatest density.]
+<p><tt>Query: <b>path:chowder</b></tt>
+<br><tt>Searching for: path:chowder</tt>
+<br><tt>31 total matching documents</tt>
+<br><tt>0. rec.food.recipes/soups/abalone-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... only thrity-one have "chowder" in the "path"
+field. ]
+<p><tt>Query: <b>path:"clam chowder"</b></tt>
+<br><tt>Searching for: path:"clam chowder"</tt>
+<br><tt>10 total matching documents</tt>
+<br><tt>0. rec.food.recipes/soups/clam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... only ten have "clam chowder" in the "path" field.
+]
+<p><tt>Query: <b>path:"clam chowder" AND manhattan</b></tt>
+<br><tt>Searching for: +path:"clam chowder" +manhattan</tt>
+<br><tt>2 total matching documents</tt>
+<br><tt>0. rec.food.recipes/soups/clam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... only two also have "manhattan" in the contents.
+]
+<br>&nbsp;&nbsp;&nbsp; [ Note: "+" and "-" are canonical, but "AND", "OR"
+and "NOT" may be used. ]</blockquote>
+The <a href="../../demo/src/org/apache/lucene/IndexHTML.java">IndexHtml</a> demo is more sophisticated.&nbsp;
+It incrementally maintains an index of HTML files, adding new files as
+they appear, deleting old files as they disappear and re-indexing files
+as they change.
+<blockquote><tt>> <b>java -cp lucene.jar:demo/classes org.apache.lucene.IndexFilesIndexHTML -create java/jdk1.1.6/docs/relnotes</b></tt>
+<br><tt>adding java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt>
+<br><tt>&nbsp; </tt>[ ... create an index containing all the relnotes ]
+<p><tt>> <b>rm java/jdk1.1.6/docs/relnotes/smicopyright.html</b></tt>
+<p><tt>> <b>java -cp lucene.jar:demo/classes org.apache.lucene.IndexFilesIndexHTML java/jdk1.1.6/docs/relnotes</b></tt>
+<br><tt>deleting java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt></blockquote>
+HTML indexes are searched using SUN's <a href="http://jserv.javasoft.com/products/webserver/index.html">JavaWebServer</a>
+(JWS) and <a href="../../demo/src/org/apache/lucene/Search.jhtml">Search.jhtml</a>.&nbsp; To use
+this:
+<ul>
+<li>
+copy <tt>Search.html</tt> and <tt>Search.jhtml</tt> to JWS's <tt>public_html</tt>
+directory;</li>
+
+<li>
+copy lucene.jar to JWS's lib directory;</li>
+
+<li>
+create and maintain your indexes with demo.IndexHTML in JWS's top-level
+directory;</li>
+
+<li>
+launch JWS, with the <tt>demo</tt> directory on CLASSPATH (only one class
+is actually needed);</li>
+
+<li>
+visit <a href="../../demo/src/org/apache/lucene/Search.html">Search.html</a>.</li>
+</ul>
+Note that indexes can be updated while searches are going on.&nbsp; <tt>Search.jhtml</tt>
+will re-open the index when it is updated so that the latest version is
+immediately available.
+<br>&nbsp;
+</body>
+</html>
diff --git a/src/test/org/apache/lucene/AnalysisTest.java b/src/test/org/apache/lucene/AnalysisTest.java
index c0c6aaa..6e6118e 100644
--- a/src/test/org/apache/lucene/AnalysisTest.java
+++ b/src/test/org/apache/lucene/AnalysisTest.java
@@ -54,10 +54,10 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.analysis.SimpleAnalyzer;
-import com.lucene.analysis.Analyzer;
-import com.lucene.analysis.TokenStream;
-import com.lucene.analysis.Token;
+import org.apache.lucene.analysis.SimpleAnalyzer;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.Token;
 
 import java.io.Reader;
 import java.io.StringReader;
diff --git a/src/test/org/apache/lucene/HighFreqTerms.java b/src/test/org/apache/lucene/HighFreqTerms.java
index 58566a4..24206fc 100644
--- a/src/test/org/apache/lucene/HighFreqTerms.java
+++ b/src/test/org/apache/lucene/HighFreqTerms.java
@@ -54,12 +54,12 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.util.PriorityQueue;
-import com.lucene.store.Directory;
-import com.lucene.store.FSDirectory;
-import com.lucene.index.IndexReader;
-import com.lucene.index.Term;
-import com.lucene.index.TermEnum;
+import org.apache.lucene.util.PriorityQueue;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
 
 class HighFreqTerms {
   public static int numTerms = 100;
diff --git a/src/test/org/apache/lucene/IndexTest.java b/src/test/org/apache/lucene/IndexTest.java
index b2dc121..88935a1 100644
--- a/src/test/org/apache/lucene/IndexTest.java
+++ b/src/test/org/apache/lucene/IndexTest.java
@@ -54,11 +54,11 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.analysis.SimpleAnalyzer;
-import com.lucene.index.IndexWriter;
-import com.lucene.index.TermPositions;
-import com.lucene.document.Document;
-import demo.FileDocument;
+import org.apache.lucene.analysis.SimpleAnalyzer;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.TermPositions;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.FileDocument;
 
 import java.io.File;
 import java.util.Date;
diff --git a/src/test/org/apache/lucene/SearchTest.java b/src/test/org/apache/lucene/SearchTest.java
index 06f8095..5b4c698 100644
--- a/src/test/org/apache/lucene/SearchTest.java
+++ b/src/test/org/apache/lucene/SearchTest.java
@@ -58,12 +58,12 @@
 import java.util.Date;
 import java.util.GregorianCalendar;
 
-import com.lucene.store.*;
-import com.lucene.document.*;
-import com.lucene.analysis.*;
-import com.lucene.index.*;
-import com.lucene.search.*;
-import com.lucene.queryParser.*;
+import org.apache.lucene.store.*;
+import org.apache.lucene.document.*;
+import org.apache.lucene.analysis.*;
+import org.apache.lucene.index.*;
+import org.apache.lucene.search.*;
+import org.apache.lucene.queryParser.*;
 
 class SearchTest {
   public static void main(String[] args) {
diff --git a/src/test/org/apache/lucene/SearchTestForDuplicates.java b/src/test/org/apache/lucene/SearchTestForDuplicates.java
index 6b8a834..9b5920b 100644
--- a/src/test/org/apache/lucene/SearchTestForDuplicates.java
+++ b/src/test/org/apache/lucene/SearchTestForDuplicates.java
@@ -58,12 +58,12 @@
 import java.util.Date;
 import java.util.GregorianCalendar;
 
-import com.lucene.store.*;
-import com.lucene.document.*;
-import com.lucene.analysis.*;
-import com.lucene.index.*;
-import com.lucene.search.*;
-import com.lucene.queryParser.*;
+import org.apache.lucene.store.*;
+import org.apache.lucene.document.*;
+import org.apache.lucene.analysis.*;
+import org.apache.lucene.index.*;
+import org.apache.lucene.search.*;
+import org.apache.lucene.queryParser.*;
 
 class SearchTestForDuplicates {
 
diff --git a/src/test/org/apache/lucene/StoreTest.java b/src/test/org/apache/lucene/StoreTest.java
index ead63dd..f34750a 100644
--- a/src/test/org/apache/lucene/StoreTest.java
+++ b/src/test/org/apache/lucene/StoreTest.java
@@ -54,11 +54,11 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.store.Directory;
-import com.lucene.store.InputStream;
-import com.lucene.store.OutputStream;
-import com.lucene.store.FSDirectory;
-import com.lucene.store.RAMDirectory;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.InputStream;
+import org.apache.lucene.store.OutputStream;
+import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.RAMDirectory;
 
 import java.util.Date;
 import java.util.Random;
diff --git a/src/test/org/apache/lucene/ThreadSafetyTest.java b/src/test/org/apache/lucene/ThreadSafetyTest.java
index 8da1702..3770829 100644
--- a/src/test/org/apache/lucene/ThreadSafetyTest.java
+++ b/src/test/org/apache/lucene/ThreadSafetyTest.java
@@ -54,12 +54,12 @@
  * <http://www.apache.org/>.
  */
 
-import com.lucene.store.*;
-import com.lucene.document.*;
-import com.lucene.analysis.*;
-import com.lucene.index.*;
-import com.lucene.search.*;
-import com.lucene.queryParser.*;
+import org.apache.lucene.store.*;
+import org.apache.lucene.document.*;
+import org.apache.lucene.analysis.*;
+import org.apache.lucene.index.*;
+import org.apache.lucene.search.*;
+import org.apache.lucene.queryParser.*;
 
 import java.io.File;
 import java.util.Random;
@@ -69,6 +69,8 @@
   private static final Random RANDOM = new Random();
   private static Searcher SEARCHER;
 
+  private static int ITERATIONS = 1;
+
   private static int random(int i) {		  // for JDK 1.1 compatibility
     int r = RANDOM.nextInt();
     if (r < 0) r = -r;
@@ -85,7 +87,7 @@
 
     public void run() {
       try {
-	for (int i = 0; i < 1024*16; i++) {
+	for (int i = 0; i < 1024*ITERATIONS; i++) {
 	  Document d = new Document();
 	  int n = RANDOM.nextInt();
 	  d.add(Field.Keyword("id", Integer.toString(n)));
@@ -98,6 +100,9 @@
 	    writer = new IndexWriter("index", ANALYZER, false);
 	  }
 	}
+	
+	writer.close();
+
       } catch (Exception e) {
 	System.out.println(e.toString());
 	e.printStackTrace();
@@ -117,7 +122,7 @@
 
     public void run() {
       try {
-	for (int i = 0; i < 1024*8; i++) {
+	for (int i = 0; i < 512*ITERATIONS; i++) {
 	  searchFor(RANDOM.nextInt(), (searcher==null)?SEARCHER:searcher);
 	  if (i%reopenInterval == 0) {
 	    if (searcher == null) {
@@ -150,12 +155,24 @@
 
   public static void main(String[] args) throws Exception {
 
-    IndexWriter writer = new IndexWriter("index", ANALYZER, true);
+    boolean readOnly = false;
+    boolean add = false;
 
-    Thread indexerThread = new IndexerThread(writer);
-    indexerThread.start();
+    for (int i = 0; i < args.length; i++) {
+      if ("-ro".equals(args[i]))
+	readOnly = true;
+      if ("-add".equals(args[i]))
+	add = true;
+    }
 
-    Thread.sleep(1000);
+    if (!readOnly) {
+      IndexWriter writer = new IndexWriter("index", ANALYZER, !add);
+      
+      Thread indexerThread = new IndexerThread(writer);
+      indexerThread.start();
+      
+      Thread.sleep(1000);
+    }
       
     SearcherThread searcherThread1 = new SearcherThread(false);
     searcherThread1.start();
diff --git a/src/test/org/apache/lucene/index/DocTest.java b/src/test/org/apache/lucene/index/DocTest.java
index 704d6f4..f6f1d53 100644
--- a/src/test/org/apache/lucene/index/DocTest.java
+++ b/src/test/org/apache/lucene/index/DocTest.java
@@ -59,7 +59,7 @@
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.document.Document;
-import demo.FileDocument;
+import org.apache.lucene.FileDocument;
 
 import java.io.File;
 import java.util.Date;
diff --git a/src/test/org/apache/lucene/queryParser/TestQueryParser.java b/src/test/org/apache/lucene/queryParser/TestQueryParser.java
index a38f2dc..fb66ff5 100644
--- a/src/test/org/apache/lucene/queryParser/TestQueryParser.java
+++ b/src/test/org/apache/lucene/queryParser/TestQueryParser.java
@@ -57,11 +57,11 @@
 import java.io.*;
 import junit.framework.*;
 
-import com.lucene.*;
-import com.lucene.queryParser.*;
-import com.lucene.search.*;
-import com.lucene.analysis.*;
-import com.lucene.analysis.Token;
+import org.apache.lucene.*;
+import org.apache.lucene.queryParser.*;
+import org.apache.lucene.search.*;
+import org.apache.lucene.analysis.*;
+import org.apache.lucene.analysis.Token;
 
 public class TestQueryParser extends TestCase {
 
diff --git a/xdocs/images/lucene_green_100.gif b/xdocs/images/lucene_green_100.gif
new file mode 100644
index 0000000..b7e06d9
--- /dev/null
+++ b/xdocs/images/lucene_green_100.gif
Binary files differ
diff --git a/xdocs/images/lucene_green_150.gif b/xdocs/images/lucene_green_150.gif
new file mode 100644
index 0000000..4948017
--- /dev/null
+++ b/xdocs/images/lucene_green_150.gif
Binary files differ
diff --git a/xdocs/images/lucene_green_200.gif b/xdocs/images/lucene_green_200.gif
new file mode 100644
index 0000000..e8ab18e
--- /dev/null
+++ b/xdocs/images/lucene_green_200.gif
Binary files differ
diff --git a/xdocs/images/lucene_green_250.gif b/xdocs/images/lucene_green_250.gif
new file mode 100644
index 0000000..a09bd95
--- /dev/null
+++ b/xdocs/images/lucene_green_250.gif
Binary files differ
diff --git a/xdocs/images/lucene_green_300.gif b/xdocs/images/lucene_green_300.gif
new file mode 100644
index 0000000..7c82298
--- /dev/null
+++ b/xdocs/images/lucene_green_300.gif
Binary files differ
diff --git a/xdocs/images/lucene_outline_100.gif b/xdocs/images/lucene_outline_100.gif
new file mode 100644
index 0000000..b64ea09
--- /dev/null
+++ b/xdocs/images/lucene_outline_100.gif
Binary files differ
diff --git a/xdocs/images/lucene_outline_150.gif b/xdocs/images/lucene_outline_150.gif
new file mode 100644
index 0000000..0100293
--- /dev/null
+++ b/xdocs/images/lucene_outline_150.gif
Binary files differ
diff --git a/xdocs/images/lucene_outline_200.gif b/xdocs/images/lucene_outline_200.gif
new file mode 100644
index 0000000..4e3a37e
--- /dev/null
+++ b/xdocs/images/lucene_outline_200.gif
Binary files differ
diff --git a/xdocs/images/lucene_outline_250.gif b/xdocs/images/lucene_outline_250.gif
new file mode 100644
index 0000000..d07b20d
--- /dev/null
+++ b/xdocs/images/lucene_outline_250.gif
Binary files differ
diff --git a/xdocs/images/lucene_outline_300.gif b/xdocs/images/lucene_outline_300.gif
new file mode 100644
index 0000000..10f7dcf
--- /dev/null
+++ b/xdocs/images/lucene_outline_300.gif
Binary files differ
diff --git a/xdocs/index.xml b/xdocs/index.xml
new file mode 100644
index 0000000..e3ffa17
--- /dev/null
+++ b/xdocs/index.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<document>
+<properties>
+<author email="jon@latchkey.com">Jon S. Stevens</author>
+<author email="husted@apache.org">Ted Husted</author>
+<author email="cutting@apache.org">Doug Cutting</author>
+<title>Overview - Jakarta Lucene</title>
+</properties>
+<body>
+
+<section name="Jakarta Lucene">
+<p>
+Jakarta Lucene is a high-performance, full-featured text search engine
+written entirely in Java.  It is a technology suitable for nearly any
+application that requires full-text search, especially
+cross-platform. 
+</p>
+<p>
+Jakarta Lucene is an open source project available for 
+<a href="http://jakarta.apache.org/site/binindex.html">free download</a> from Apache Jakarta.  
+Please use the links on the left to access Lucene.
+</p>
+</section>
+
+<section name="Lucene News">
+<p>
+<b>Lucene v1.02 released</b> - This release repackages Lucene as product 
+of the Apache Software Foundation. Download it 
+<a href="http://jakarta.apache.org/site/binindex.html">here</a>.
+</p>
+<p>
+<b>Lucene Joins Jakarta</b> - The Lucene Team is happy to announce that 
+Lucene is now part of a member of the Apache Jakarta Project. This move will 
+help Lucene continue to grow, and enhance its position as the leading 
+server-side searching solution for Java.
+</p>
+</section>
+
+<section name="About Apache Jakarta">
+<p>
+The goal of the <a href="http://jakarta.apache.org/">Apache Jakarta Project</a> 
+is to provide commercial-quality server solutions based on the Java Platform that 
+are developed in an open and cooperative fashion.
+</p>
+</section>
+
+</body>
+</document>
+
diff --git a/xdocs/powered.xml b/xdocs/powered.xml
new file mode 100644
index 0000000..940dabc
--- /dev/null
+++ b/xdocs/powered.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<document>
+<properties>
+<author email="husted@apache.org">Ted Husted</author>
+<author email="cutting@apache.org">Doug Cutting</author>
+<title>Powered by Lucene - Jakarta Lucene</title>
+</properties>
+<body>
+
+<section name="Powered by Lucene">
+
+<p>Applications using Lucene include:
+<ul>
+<li><a href="http://www.bobdylan.com/">Bob Dylan</a></li>
+<li><a href="http://eyebrowse.tigris.org/">Eyebrowse</a></li>
+<li><a href="http://www.jivesoftware.com/">Jive Forums</a></li>
+<li><a href="http://www.i2a.com/websearch/"> Web Search</a></li>
+</ul>
+</p>
+
+<p>If you wish to have your site listed on this page, send <a
+href="mailto:lucene-dev@jakarta.apache.org">us</a> a note.</p>
+
+<p>Please include something like the following with your search results:</p>
+
+<center><font size="-1"><i>search powered by</i></font> <a
+href="http://jakarta.apache.org/lucene"><img
+src="images/lucene_green_100.gif" alt="Lucene" border="0"
+/></a></center>
+
+</section>
+
+</body>
+</document>
+
diff --git a/xdocs/resources.xml b/xdocs/resources.xml
new file mode 100644
index 0000000..d483074
--- /dev/null
+++ b/xdocs/resources.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<document>
+<properties>
+<author email="husted@apache.org">Ted Husted</author>
+<author email="cutting@apache.org">Doug Cutting</author>
+<title>Resources - Jakarta Lucene</title>
+</properties>
+<body>
+
+<section name="Articles">
+<p>Articles about Lucene:</p>
+<ul>
+<li><a href="http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-lucene.html">The Lucene search engine Powerful flexible and free</a><br/> - JavaWorld September 2000</li> 
+<li><a href="http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-cooltools.html">Build your own languages with JavaCC</a><br/> - JavaWorld December 2000</li>
+</ul>
+</section>
+
+</body>
+</document>
+
diff --git a/xdocs/stylesheets/project.xml b/xdocs/stylesheets/project.xml
new file mode 100644
index 0000000..d30bcae
--- /dev/null
+++ b/xdocs/stylesheets/project.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project name="Jakarta Lucene" href="http://jakarta.apache.org/lucene/">
+
+    <title>Jakarta Lucene</title>
+    <logo href="/images/lucene_green_300.gif">Jakarta Lucene</logo>
+    
+    <body>
+    <menu name="About">
+        <item name="Overview"           href="/index.html"/>
+        <item name="Powered by Lucene"  href="/powered.html"/>
+        <item name="Who We Are"         href="/whoweare.html"/>
+        <item name="Mailing Lists"      href="/site/mail.html"/>
+        <item name="Bugs"               href="/site/bugs.html"/>
+    </menu>
+
+    <menu name="Documentation">
+        <item name="FAQ"               href="http://www.lucene.com/cgi-bin/faq/faqmanager.cgi" target="_blank"/>
+        <item name="Articles"          href="/resources.html"/>
+        <item name="Javadoc"            href="/api/index.html"/>
+    </menu>
+
+    <menu name="Download">
+        <item name="Binaries"           href="/site/binindex.html"/>
+        <item name="Source Code"        href="/site/sourceindex.html"/>
+        <item name="CVS Repositories"   href="/site/cvsindex.html"/>
+    </menu>
+
+    <menu name="Jakarta">
+        <item name="Get Involved"          href="/site/getinvolved.html"/>
+        <item name="Acknowledgements"      href="/site/acknowledgements.html"/>
+        <item name="Contact"               href="/site/contact.html"/>
+        <item name="Legal"                 href="/site/legal.html"/>
+    </menu>
+    </body>
+</project>
diff --git a/xdocs/whoweare.xml b/xdocs/whoweare.xml
new file mode 100644
index 0000000..b124401
--- /dev/null
+++ b/xdocs/whoweare.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<document>
+<properties>
+<author email="husted@apache.org">Ted Husted</author>
+<author email="cutting@apache.org">Doug Cutting</author>
+<title>Who We Are - Jakarta Lucene</title>
+</properties>
+<body>
+
+<section name="Who We Are">
+<p>Lucene is maintained by a team of volunteer developers.</p>
+</section>
+
+<section name="Committers">
+<ul>
+<li><b>Doug Cutting</b> (cutting at apache.org)
+
+<p>Lucene was originally written in Doug's spare time during late 1997
+and early 1998.  Doug had previously written search engines at Xerox's
+Palo Alto Research Center (PARC), Apple, and Excite@Home, and authored
+several information retrieval <a
+href="http://www.lucene.com/publications.html">papers and
+patents</a>.</p>
+
+<p>Doug currently works for <a href="http://www.grandcentral.com/">Grand
+Central</a>.</p>
+
+<p>Please do not email Doug directly about Lucene. Instead use
+the <a href="http://jakarta.apache.org/site/mail.html">Jakarta-Lucene mailing lists</a>.</p>
+
+</li>
+<li><b>Otis Gospodnetic</b> (otis at apache.org)</li>
+<li><b>Brian Goetz</b> (briangoetz at apache.org)</li>
+<li><b>Scott Ganyo</b> (scottganyo at apache.org)</li>
+<li><b>Eugene Gluzberg</b> (drag0n at apache.org)</li>
+<li><b>Matt Tucker</b> (mtucker at apache.org)</li>
+<li><b>Cory Hubert</b> (clhubert at apache.org)</li>
+<li><b>Dave Kor</b> (davekor at apache.org)</li>
+<li><b>Jon Stevens</b> (jon at latchkey.com)</li>
+<li><b>Tal Dayan</b> (zapta at apache.org)</li>
+</ul>
+</section>
+
+<section name="Other Contributors">
+<ul>
+<li>Josh Bloch</li>
+<li>Ted Husted</li>
+</ul>
+</section>
+
+</body>
+</document>
+