Scusate ancora.. tanto per conoscenza, vi dico quello che ho fatto di preciso, magari provando ad emulare le mie "gesta" potreste dirmi se a voi funziona o meno...(?)
Ho scaricato questo file: http://mirror.nohup.it/apache/jakart...-1.4-final.zip
(1.6 mb) scompattato in c:\lucene-1.4-final e poi ho provato a seguire i rimantenti passi di questa guida all'installazione e al test(in inglese):
codice:
Binary installation
To obtain the binary distribution of Lucene, follow these steps:
1 Download the latest binary Lucene release from the download area of the
Jakarta web site: http://jakarta.apache.org. At the time of this writing, the
latest version is 1.4.2; the subsequent steps assume this version. Download
either the .zip or .tar.gz file, whichever format is most convenient
for your environment.
2 Extract the binary file to the directory of your choice on your file system.
The archive contains a top-level directory named lucene-1.4.2, so it’s safe
to extract to c:\ on Windows or your home directory on UNIX. On Windows,
if you have WinZip handy, use it to open the .zip file and extract its contents
to c:\. If you’re on UNIX or using cygwin on Windows, unzip and untar (tar
zxvf lucene-1.4.2.tar.gz) the .tar.gz file in your home directory.
3 Under the created lucene-1.4.2 directory, you’ll find lucene-1.4.2.jar.
This is the only file required to introduce Lucene into your applications.
How you incorporate Lucene’s JAR file into your application depends on
your environment; there are numerous options. We recommend using
Ant to build your application’s code. Be sure your code is compiled
against the Lucene JAR using the classpath options of the <javac> task.
4 Include Lucene’s JAR file in your application’s distribution appropriately.
For example, a web application using Lucene would include lucene-
1.4.2.jar in the WEB-INF/lib directory. For command-line applications, be
sure Lucene is on the classpath when launching the JVM.
The binary distribution includes a substantial amount of documentation, including
Javadocs. The root of the documentation is docs/index.html, which you can
open in a web browser. Lucene’s distribution also ships two demonstration applications.
We apologize in advance for the crude state of these demos—they lack
Running the command-line demo 389
polish when it comes to ease of use—but the documentation (found in docs/
demo.html) describes how to use them step by step; we also cover the basics of
running them here.
A.2 Running the command-line demo
The command-line Lucene demo consists of two command-line programs: one
that indexes a directory tree of files and another that provides a simple search
interface. To run this demo, set your current working directory to the directory
where the binary distribution was expanded. Next, run the IndexFiles program
like this:
java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
➾ org.apache.lucene.demo.IndexFiles docs
.
.
.
adding docs/queryparsersyntax.html
adding docs/resources.html
adding docs/systemproperties.html
adding docs/whoweare.html
9454 total milliseconds
This command indexes the entire docs directory tree (339 files in our case) into
an index stored in the index subdirectory of the location where you executed
the command.
NOTE Literally every file in the docs directory tree is indexed, including .gif
and .jpg files. None of the files are parsed; instead, each file is indexed
by streaming its bytes into StandardAnalyzer.
To search the index just created, execute SearchFiles in this manner:
java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
org.apache.lucene.demo.SearchFiles
Query: IndexSearcher AND QueryParser
Searching for: +indexsearcher +queryparser
10 total matching documents
0. docs/api/index-all.html
1. docs/api/allclasses-frame.html
2. docs/api/allclasses-noframe.html
3. docs/api/org/apache/lucene/search/class-use/Query.html
4. docs/api/overview-summary.html
5. docs/api/overview-tree.html
6. docs/demo2.html
390 APPENDIX A
Installing Lucene
7. docs/demo4.html
8. docs/api/org/apache/lucene/search/package-summary.html
9. docs/api/org/apache/lucene/search/package-tree.html
SearchFiles prompts interactively with Query:. QueryParser is used with Standard-
Analyzer to create a Query. A maximum of 10 hits are shown at a time; if there are
more, you can page through them. Press Ctrl-C to exit the program.