mirror of
https://github.com/apache/lucene.git
synced 2025-02-07 18:49:03 +00:00
Added demo files to distribution. Fixed calls to demo in overview.html.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149601 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c5e43fb7b1
commit
d3c9282362
11
build.xml
11
build.xml
@ -288,10 +288,13 @@
|
|||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
<target name="package" depends="jar, javadocs">
|
<target name="package" depends="jar, javadocs, demo">
|
||||||
<mkdir dir="${dist.dir}"/>
|
<mkdir dir="${dist.dir}"/>
|
||||||
<mkdir dir="${dist.dir}/docs"/>
|
<mkdir dir="${dist.dir}/docs"/>
|
||||||
<mkdir dir="${dist.dir}/docs/api"/>
|
<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">
|
<copy todir="${dist.dir}/docs">
|
||||||
<fileset dir="${docs.dir}"/>
|
<fileset dir="${docs.dir}"/>
|
||||||
@ -299,6 +302,12 @@
|
|||||||
<copy todir="${dist.dir}/docs/api">
|
<copy todir="${dist.dir}/docs/api">
|
||||||
<fileset dir="${build.javadocs}"/>
|
<fileset dir="${build.javadocs}"/>
|
||||||
</copy>
|
</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}"/>
|
<copy file="${build.dir}/${final.name}.jar" todir="${dist.dir}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
@ -82,64 +82,64 @@ method.</li>
|
|||||||
Some simple examples of code which does this are:
|
Some simple examples of code which does this are:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="../demo/FileDocument.java">FileDocument.java</a> contains
|
<a href="../../demo/src/org/apache/lucene/FileDocument.java">FileDocument.java</a> contains
|
||||||
code to create a Document for a file.</li>
|
code to create a Document for a file.</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="../demo/IndexFiles.java">IndexFiles.java</a> creates an
|
<a href="../../demo/src/org/apache/lucene/IndexFiles.java">IndexFiles.java</a> creates an
|
||||||
index for all the files contained in a directory.</li>
|
index for all the files contained in a directory.</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="../demo/DeleteFiles.java">DeleteFiles.java</a> deletes some
|
<a href="../../demo/src/org/apache/lucene/DeleteFiles.java">DeleteFiles.java</a> deletes some
|
||||||
of these files from the index.</li>
|
of these files from the index.</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="../demo/SearchFiles.java">SearchFiles.java</a> prompts for
|
<a href="../../demo/src/org/apache/lucene/SearchFiles.java">SearchFiles.java</a> prompts for
|
||||||
queries and searches an index.</li>
|
queries and searches an index.</li>
|
||||||
</ul>
|
</ul>
|
||||||
To demonstrate these, try:
|
To demonstrate these, try something like:
|
||||||
<blockquote><tt>F:\> <b>java demo.IndexFiles rec.food.recipes\soups</b></tt>
|
<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>adding rec.food.recipes/soups/abalone-chowder</tt>
|
||||||
<br><tt> </tt>[ ... ]
|
<br><tt> </tt>[ ... ]
|
||||||
<p><tt>F:\> <b>java demo.SearchFiles</b></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>Query: <b>chowder</b></tt>
|
||||||
<br><tt>Searching for: chowder</tt>
|
<br><tt>Searching for: chowder</tt>
|
||||||
<br><tt>34 total matching documents</tt>
|
<br><tt>34 total matching documents</tt>
|
||||||
<br><tt>0. rec.food.recipes\soups\spam-chowder</tt>
|
<br><tt>0. rec.food.recipes/soups/spam-chowder</tt>
|
||||||
<br><tt> </tt>[ ... thirty-four documents contain the word "chowder",
|
<br><tt> </tt>[ ... thirty-four documents contain the word "chowder",
|
||||||
"spam-chowder" with the greatest density.]
|
"spam-chowder" with the greatest density.]
|
||||||
<p><tt>Query: <b>path:chowder</b></tt>
|
<p><tt>Query: <b>path:chowder</b></tt>
|
||||||
<br><tt>Searching for: path:chowder</tt>
|
<br><tt>Searching for: path:chowder</tt>
|
||||||
<br><tt>31 total matching documents</tt>
|
<br><tt>31 total matching documents</tt>
|
||||||
<br><tt>0. rec.food.recipes\soups\abalone-chowder</tt>
|
<br><tt>0. rec.food.recipes/soups/abalone-chowder</tt>
|
||||||
<br><tt> </tt>[ ... only thrity-one have "chowder" in the "path"
|
<br><tt> </tt>[ ... only thrity-one have "chowder" in the "path"
|
||||||
field. ]
|
field. ]
|
||||||
<p><tt>Query: <b>path:"clam chowder"</b></tt>
|
<p><tt>Query: <b>path:"clam chowder"</b></tt>
|
||||||
<br><tt>Searching for: path:"clam chowder"</tt>
|
<br><tt>Searching for: path:"clam chowder"</tt>
|
||||||
<br><tt>10 total matching documents</tt>
|
<br><tt>10 total matching documents</tt>
|
||||||
<br><tt>0. rec.food.recipes\soups\clam-chowder</tt>
|
<br><tt>0. rec.food.recipes/soups/clam-chowder</tt>
|
||||||
<br><tt> </tt>[ ... only ten have "clam chowder" in the "path" field.
|
<br><tt> </tt>[ ... only ten have "clam chowder" in the "path" field.
|
||||||
]
|
]
|
||||||
<p><tt>Query: <b>path:"clam chowder" AND manhattan</b></tt>
|
<p><tt>Query: <b>path:"clam chowder" AND manhattan</b></tt>
|
||||||
<br><tt>Searching for: +path:"clam chowder" +manhattan</tt>
|
<br><tt>Searching for: +path:"clam chowder" +manhattan</tt>
|
||||||
<br><tt>2 total matching documents</tt>
|
<br><tt>2 total matching documents</tt>
|
||||||
<br><tt>0. rec.food.recipes\soups\clam-chowder</tt>
|
<br><tt>0. rec.food.recipes/soups/clam-chowder</tt>
|
||||||
<br><tt> </tt>[ ... only two also have "manhattan" in the contents.
|
<br><tt> </tt>[ ... only two also have "manhattan" in the contents.
|
||||||
]
|
]
|
||||||
<br> [ Note: "+" and "-" are canonical, but "AND", "OR"
|
<br> [ Note: "+" and "-" are canonical, but "AND", "OR"
|
||||||
and "NOT" may be used. ]</blockquote>
|
and "NOT" may be used. ]</blockquote>
|
||||||
The <a href="../demo/IndexHTML.java">IndexHtml</a> demo is more sophisticated.
|
The <a href="../../demo/src/org/apache/lucene/IndexHTML.java">IndexHtml</a> demo is more sophisticated.
|
||||||
It incrementally maintains an index of HTML files, adding new files as
|
It incrementally maintains an index of HTML files, adding new files as
|
||||||
they appear, deleting old files as they disappear and re-indexing files
|
they appear, deleting old files as they disappear and re-indexing files
|
||||||
as they change.
|
as they change.
|
||||||
<blockquote><tt>F:\><b>java demo.IndexHTML -create java\jdk1.1.6\docs\relnotes</b></tt>
|
<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>adding java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt>
|
||||||
<br><tt> </tt>[ ... create an index containing all the relnotes ]
|
<br><tt> </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>> <b>rm 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>
|
<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>
|
<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>
|
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>. To use
|
(JWS) and <a href="../../demo/src/org/apache/lucene/Search.jhtml">Search.jhtml</a>. To use
|
||||||
this:
|
this:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@ -158,7 +158,7 @@ launch JWS, with the <tt>demo</tt> directory on CLASSPATH (only one class
|
|||||||
is actually needed);</li>
|
is actually needed);</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
visit <a href="../demo/Search.html">Search.html</a>.</li>
|
visit <a href="../../demo/src/org/apache/lucene/Search.html">Search.html</a>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
Note that indexes can be updated while searches are going on. <tt>Search.jhtml</tt>
|
Note that indexes can be updated while searches are going on. <tt>Search.jhtml</tt>
|
||||||
will re-open the index when it is updated so that the latest version is
|
will re-open the index when it is updated so that the latest version is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user