Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 17737 invoked from network); 27 Nov 2006 00:04:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2006 00:04:00 -0000 Received: (qmail 16743 invoked by uid 500); 27 Nov 2006 00:04:09 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 16715 invoked by uid 500); 27 Nov 2006 00:04:09 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 16611 invoked by uid 99); 27 Nov 2006 00:04:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 16:04:08 -0800 X-ASF-Spam-Status: No, hits=-7.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,OBSCURED_EMAIL X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 16:03:53 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8ED041A984F; Sun, 26 Nov 2006 16:03:16 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r479466 [2/8] - /lucene/java/trunk/docs/ Date: Mon, 27 Nov 2006 00:03:14 -0000 To: java-commits@lucene.apache.org From: gsingers@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061127000316.8ED041A984F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: lucene/java/trunk/docs/demo.html URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo.html?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo.html (added) +++ lucene/java/trunk/docs/demo.html Sun Nov 26 16:03:13 2006 @@ -0,0 +1,278 @@ + + + + + + + + + Apache Lucene - Building and Installing the Basic Demo + + + + + + + + + + +
+ +
+ + + + +
+
+
+
+
+ +
+
+ +   +
+ +
+ +

+ Apache Lucene - Building and Installing the Basic Demo +

+ + + + +

About this Document

+
+

+This document is intended as a "getting started" guide to using and running the Lucene demos. +It walks you through some basic installation and configuration. +

+
+ + + + +

About the Demos

+
+

+The Lucene command-line demo code consists of two applications that demonstrate various +functionalities of Lucene and how one should go about adding Lucene to their applications. +

+
+ + + +

Setting your CLASSPATH

+
+

+First, you should download the +latest Lucene distribution and then extract it to a working directory. Alternatively, you can check out the sources from +Subversion, and then run ant war-demo to generate the JARs and WARs. +

+

+You should see the Lucene JAR file in the directory you created when you extracted the archive. It +should be named something like lucene-core-{version}.jar. You should also see a file +called lucene-demos-{version}.jar. If you checked out the sources from Subversion then +the JARs are located under the build subdirectory (after running ant +successfully). Put both of these files in your Java CLASSPATH. +

+
+ + + +

Indexing Files

+
+

+Once you've gotten this far you're probably itching to go. Let's build an index! Assuming +you've set your CLASSPATH correctly, just type: + +

+    java org.apache.lucene.demo.IndexFiles {full-path-to-lucene}/src
+
+ +This will produce a subdirectory called index which will contain an index of all of the +Lucene source code. +

+

+To search the index type: + +

+    java org.apache.lucene.demo.SearchFiles
+
+ +You'll be prompted for a query. Type in a swear word and press the enter key. You'll see that the +Lucene developers are very well mannered and get no results. Now try entering the word "vector". +That should return a whole bunch of documents. The results will page at every tenth result and ask +you whether you want more results. +

+
+ + + +

About the code...

+
+

+ +read on>>> + +

+
+ + +
+
 
+
+ + + Added: lucene/java/trunk/docs/demo.pdf URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo.pdf?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo.pdf (added) +++ lucene/java/trunk/docs/demo.pdf Sun Nov 26 16:03:13 2006 @@ -0,0 +1,271 @@ +%PDF-1.3 +%ª«¬­ +4 0 obj +<< /Type /Info +/Producer (FOP 0.20.5) >> +endobj +5 0 obj +<< /Length 615 /Filter [ /ASCII85Decode /FlateDecode ] + >> +stream +Gaua<9lHd\&;KZO$6PI!?%6qk[>h\QrZS[;SS9*tq%RUKg"Z-=iJi,V6e@1\!3'-R1n!sH%5#,o-gM!\Hg&>W_;dQP+4,u7[XPB1\/7+Ao>h6sjnT"]0]79`e]WO?[k;oKaS!U7po!1:=t2l\T84$?#Bp5qGZ?qA1f]/4l9qWt_?2:EL'cF#E*R:c*3!Ck-/0XCNFDE8ON6or?.h2[V=Slf,qoS;K]fqX$ud%MC+h7cPP?[U:^fU"'&U0IL[V?uh&+DIdDl;"6G?7r_&sh]k]?hfla8Q]3%>0u=5DG&/T6jGqH&jZ3)^jab#@g6E8GGq!JO7#He(-UOT1?^=(N\mBt[#]19e)\_:&\L!JaIgHe/5Op:2edT?ObYU-JMC2SaGRr9aARs80`*5f((_ZiWP15qTo"p`1o%59aUF&<)EQghTEIEu9ZP`,n*A9E"KdQeS'N5OeuqYu:e!d&GO`,cA=lXZ,AgX1apdDH2ge;CeqB,ZWqo+1q'MCh3Jq$g>sp!2=LlrV~> +endstream +endobj +6 0 obj +<< /Type /Page +/Parent 1 0 R +/MediaBox [ 0 0 612 792 ] +/Resources 3 0 R +/Contents 5 0 R +/Annots 7 0 R +>> +endobj +7 0 obj +[ +8 0 R +10 0 R +12 0 R +14 0 R +16 0 R +] +endobj +8 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 519.166 213.332 507.166 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 9 0 R +/H /I +>> +endobj +10 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 500.966 194.66 488.966 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 11 0 R +/H /I +>> +endobj +12 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 482.766 240.68 470.766 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 13 0 R +/H /I +>> +endobj +14 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 464.566 179.0 452.566 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 15 0 R +/H /I +>> +endobj +16 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 446.366 192.32 434.366 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 17 0 R +/H /I +>> +endobj +18 0 obj +<< /Length 2208 /Filter [ /ASCII85Decode /FlateDecode ] + >> +stream +Gatm=gQ(#H&:O:SW;D_\L`)&\\dngbPAZg38COYkU1jBg9=1h&/34KQNY1@041Yr6d<3n\_!Y)5adFqtL1cmCjm8>qm.8FJd3>l%X8;3D:A*AN(Qi:NNFdS7iKZ9)fYk3"hh.Pm?i<-3I,_Z--+UFPrB@hrcCWjHQ;`49>gI5%1P6G#T49`W4Vp9mXQ@b(l`igK=E@Y!oD!VX8i7%-2D'[29+dLPT#:H?XlZ%l#H(o)dPn:[LED#!U:_j*jcc1%N*9IcW=%8SlnRW.>u)#c,qD(a#ZNj?lMmB,*:8<;!#BGQT\GP#[.V%mpu^[)%Tj,:[a3AVI%EUjfNjY"SdF8U]JDM_8S,;aDI$h!G*mH'[Hf'.=E]P2M;\0n\AZbb$p6d^.1cI\[F-^\6>G7WCj_;Up8)]MmhVqB&V'nXXH!tjT[fD#F$NkQ<*#dEIL7D;`P<7%j`s,^]=3O,d%Cf6k-j_,4XL!/4"S,7p`jA^:S`A^&6F)A_SLS(tk;[Kf$;mbT?]S]!T%CAYG\6C)F=E6b.O$Z2e:(?A&`W4KXCbDAO[/p2,jUe^Y[PrRn<*&cc^ZD[oIdRp+@FI7bXf$jcK.3"d0d\6aM=(uAMI-k$Ub!O'S?Ki"J;DQc:Nn[%/NIE,:i4&@?R%)#8S_\t[J9Z3#4*(T-2[#f"Z[`mmo<1<M ,_rW7=n+dhrdD^\g_EbRXX'qR>6Lss(QGDD!-RR.Na9s@266=YhT"r/KL8m-)P\#P&d"%PD*.o<4+>J4:4VE#9`i[.dBY3&0a!&iD+WSA,M,72l_,39G0,$=]WR0i+`DsrXB?hg,`2-hZ3ql:ok&SVs.AYc*jH\om[]dh19?s4@OMKIYiKb9bB=?A1R8h-Ep4*dMf,-_M.Cl-H*$e00<_BN%BlgHYaMS;c>l(2FWnYO#K.q=o#:,Yf>>R2SQO"hfKmoe\C;8jbf2-keJArP%Pb'842dJ5=:W9<=QX[p7)5:cD@_EIk#HC$[]]JDjg8@Z-iAedj!6fmYd\\G8SO"(&O@`dApXmrH.he>46lh^6=_45&Sj&EA'WU2bs,:9!KG8GofUbCf,>G!\1fjF:es6a9bG8$OjpgO"-2n<]0%L2Cd[LRZ<+'M)pidg=]bG*5cqEHbY>.GP1gAHG'I'nHf$(daN?Jf8d;IO;^>1]F3MgOF/[kemp>JlKM3+\TZo@L-S\4j`uIFK6+t](XEg[K^\`!R%5:TB4gF>::`Irh3-ECNgPJ$53cpA-5f'oTJS]KCs.k#cphu#02+b/T1PN[HE/AgZ6AL5bH@em+[gi0)kKj%CL0@Gc0iHmc,/+^nU#Q c@/t*NXldAq<&Va;t7WIG^O650[VNN0@7eI9rP4[edbt[j*1H!nQVRsV2T=c03-(9VlArYts84()1b9k`Bi*(>D3Fd8]E79eOCB:FhCqY8SAjjBO7;t81"#mH=L7XJ*42n2%K`g4i493Z@Q?j_J8""8'FnESM_Z(kRSRFp'3uCG(hDPH=H9JtUCNX +endstream +endobj +19 0 obj +<< /Type /Page +/Parent 1 0 R +/MediaBox [ 0 0 612 792 ] +/Resources 3 0 R +/Contents 18 0 R +>> +endobj +21 0 obj +<< + /Title (\376\377\0\61\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\151\0\163\0\40\0\104\0\157\0\143\0\165\0\155\0\145\0\156\0\164) + /Parent 20 0 R + /Next 22 0 R + /A 9 0 R +>> endobj +22 0 obj +<< + /Title (\376\377\0\62\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\145\0\40\0\104\0\145\0\155\0\157\0\163) + /Parent 20 0 R + /Prev 21 0 R + /Next 23 0 R + /A 11 0 R +>> endobj +23 0 obj +<< + /Title (\376\377\0\63\0\40\0\123\0\145\0\164\0\164\0\151\0\156\0\147\0\40\0\171\0\157\0\165\0\162\0\40\0\103\0\114\0\101\0\123\0\123\0\120\0\101\0\124\0\110) + /Parent 20 0 R + /Prev 22 0 R + /Next 24 0 R + /A 13 0 R +>> endobj +24 0 obj +<< + /Title (\376\377\0\64\0\40\0\111\0\156\0\144\0\145\0\170\0\151\0\156\0\147\0\40\0\106\0\151\0\154\0\145\0\163) + /Parent 20 0 R + /Prev 23 0 R + /Next 25 0 R + /A 15 0 R +>> endobj +25 0 obj +<< + /Title (\376\377\0\65\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\145\0\40\0\143\0\157\0\144\0\145\0\56\0\56\0\56) + /Parent 20 0 R + /Prev 24 0 R + /A 17 0 R +>> endobj +26 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F3 +/BaseFont /Helvetica-Bold +/Encoding /WinAnsiEncoding >> +endobj +27 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F5 +/BaseFont /Times-Roman +/Encoding /WinAnsiEncoding >> +endobj +28 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F1 +/BaseFont /Helvetica +/Encoding /WinAnsiEncoding >> +endobj +29 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F9 +/BaseFont /Courier +/Encoding /WinAnsiEncoding >> +endobj +30 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F2 +/BaseFont /Helvetica-Oblique +/Encoding /WinAnsiEncoding >> +endobj +31 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F7 +/BaseFont /Times-Bold +/Encoding /WinAnsiEncoding >> +endobj +1 0 obj +<< /Type /Pages +/Count 2 +/Kids [6 0 R 19 0 R ] >> +endobj +2 0 obj +<< /Type /Catalog +/Pages 1 0 R + /Outlines 20 0 R + /PageMode /UseOutlines + >> +endobj +3 0 obj +<< +/Font << /F3 26 0 R /F5 27 0 R /F1 28 0 R /F9 29 0 R /F2 30 0 R /F7 31 0 R >> +/ProcSet [ /PDF /ImageC /Text ] >> +endobj +9 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 659.0 null] +>> +endobj +11 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 593.466 null] +>> +endobj +13 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 527.932 null] +>> +endobj +15 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 375.198 null] +>> +endobj +17 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 209.264 null] +>> +endobj +20 0 obj +<< + /First 21 0 R + /Last 25 0 R +>> endobj +xref +0 32 +0000000000 65535 f +0000005710 00000 n +0000005775 00000 n +0000005867 00000 n +0000000015 00000 n +0000000071 00000 n +0000000777 00000 n +0000000897 00000 n +0000000950 00000 n +0000006001 00000 n +0000001085 00000 n +0000006064 00000 n +0000001221 00000 n +0000006130 00000 n +0000001357 00000 n +0000006196 00000 n +0000001492 00000 n +0000006262 00000 n +0000001628 00000 n +0000003929 00000 n +0000006328 00000 n +0000004037 00000 n +0000004240 00000 n +0000004434 00000 n +0000004670 00000 n +0000004859 00000 n +0000005048 00000 n +0000005161 00000 n +0000005271 00000 n +0000005379 00000 n +0000005485 00000 n +0000005601 00000 n +trailer +<< +/Size 32 +/Root 2 0 R +/Info 4 0 R +>> +startxref +6379 +%%EOF Added: lucene/java/trunk/docs/demo2.html URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo2.html?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo2.html (added) +++ lucene/java/trunk/docs/demo2.html Sun Nov 26 16:03:13 2006 @@ -0,0 +1,306 @@ + + + + + + + + + Apache Lucene - Basic Demo Sources Walk-through + + + + + + + + + + +
+ +
+ + + + +
+
+
+
+
+ +
+
+ +   +
+ +
+ +

+ Apache Lucene - Basic Demo Sources Walk-through +

+ + + + +

About the Code

+
+

+In this section we walk through the sources behind the command-line Lucene demo: where to find them, +their parts and their function. This section is intended for Java developers wishing to understand +how to use Lucene in their applications. +

+
+ + + + +

Location of the source

+
+

+Relative to the directory created when you extracted Lucene or retrieved it from Subversion, you +should see a directory called src which in turn contains a directory called +demo. This is the root for all of the Lucene demos. Under this directory is +org/apache/lucene/demo. This is where all the Java sources for the demos live. +

+

+Within this directory you should see the IndexFiles.java class we executed earlier. +Bring it up in vi or your editor of choice and let's take a look at it. +

+
+ + + +

IndexFiles

+
+

+As we discussed in the previous walk-through, the IndexFiles class creates a Lucene +Index. Let's take a look at how it does this. +

+

+The first substantial thing the main function does is instantiate IndexWriter. It passes the string +"index" and a new instance of a class called StandardAnalyzer. +The "index" string is the name of the filesystem directory where all index information +should be stored. Because we're not passing a full path, this will be created as a subdirectory of +the current working directory (if it does not already exist). On some platforms, it may be created +in other directories (such as the user's home directory). +

+

+The IndexWriter is the main +class responsible for creating indices. To use it you must instantiate it with a path that it can +write the index into. If this path does not exist it will first create it. Otherwise it will +refresh the index at that path. You can also create an index using one of the subclasses of Directory. In any case, you must also pass an +instance of org.apache.lucene.analysis.Analyzer. +

+

+The particular Analyzer we +are using, StandardAnalyzer, is +little more than a standard Java Tokenizer, converting all strings to lowercase and filtering out +useless words and characters from the index. By useless words and characters I mean common language +words such as articles (a, an, the, etc.) and other strings that would be useless for searching +(e.g. 's) . It should be noted that there are different rules for every language, and you +should use the proper analyzer for each. Lucene currently provides Analyzers for a number of +different languages (see the *Analyzer.java sources under contrib/analyzers/src/java/org/apache/lucene/analysis). +

+

+Looking further down in the file, you should see the indexDocs() code. This recursive +function simply crawls the directories and uses FileDocument to create Document objects. The Document is simply a data object to +represent the content in the file as well as its creation time and location. These instances are +added to the indexWriter. Take a look inside FileDocument. It's not particularly +complicated. It just adds fields to the Document. +

+

+As you can see there isn't much to creating an index. The devil is in the details. You may also +wish to examine the other samples in this directory, particularly the IndexHTML class. It is a bit more +complex but builds upon this example. +

+
+ + + +

Searching Files

+
+

+The SearchFiles class is +quite simple. It primarily collaborates with an IndexSearcher, StandardAnalyzer +(which is used in the IndexFiles class as well) and a +QueryParser. The +query parser is constructed with an analyzer used to interpret your query text in the same way the +documents are interpreted: finding the end of words and removing useless words like 'a', 'an' and +'the'. The Query object contains +the results from the QueryParser which is passed to +the searcher. Note that it's also possible to programmatically construct a rich Query object without using the query +parser. The query parser just enables decoding the Lucene query +syntax into the corresponding Query object. The searcher results are +returned in a collection of Documents called Hits which is then iterated through and +displayed to the user. +

+
+ + + +

The Web example...

+
+

+ +read on>>> + +

+
+ + +
+
 
+
+ + + Added: lucene/java/trunk/docs/demo2.pdf URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo2.pdf?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo2.pdf (added) +++ lucene/java/trunk/docs/demo2.pdf Sun Nov 26 16:03:13 2006 @@ -0,0 +1,288 @@ +%PDF-1.3 +%ª«¬­ +4 0 obj +<< /Type /Info +/Producer (FOP 0.20.5) >> +endobj +5 0 obj +<< /Length 615 /Filter [ /ASCII85Decode /FlateDecode ] + >> +stream +Gau`Q9okbt&A@ZcI*44-[e.;KFgg#JKGcQBKRKDR5(KL#b#6\,#?)B`u-0L4HL6.Cr%L*.3SLelrCYrX7HY3s)gaKV.<4LD)f4M5dlF]'$TK4!,"41*J=8QC0DIY7FmUWM)ZZTbP]'rr76BD^,+W9>c2`e-qBDnsTeEaOkqqL^6gO?u-&$3a*=E=N-aFhaDp8iHf0kjrn8%6g:X?i1D813hISi[B)*ng%.m[eRfTC,4WG<@7H?4u:XCirrnp5/;h`MtI0Yd%sSX'1p(PsIq=5FMA&K)~> +endstream +endobj +6 0 obj +<< /Type /Page +/Parent 1 0 R +/MediaBox [ 0 0 612 792 ] +/Resources 3 0 R +/Contents 5 0 R +/Annots 7 0 R +>> +endobj +7 0 obj +[ +8 0 R +10 0 R +12 0 R +14 0 R +16 0 R +] +endobj +8 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 519.166 185.996 507.166 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 9 0 R +/H /I +>> +endobj +10 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 500.966 217.64 488.966 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 11 0 R +/H /I +>> +endobj +12 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 482.766 160.664 470.766 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 13 0 R +/H /I +>> +endobj +14 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 464.566 184.328 452.566 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 15 0 R +/H /I +>> +endobj +16 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 446.366 206.972 434.366 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 17 0 R +/H /I +>> +endobj +18 0 obj +<< /Length 2722 /Filter [ /ASCII85Decode /FlateDecode ] + >> +stream +Gatm>D3*F0')q<++ll:Z@[F.iQ[[,dQQekL]5)d"%_)C%bI#NP/@q'Va7nn<,h^`W9mU*P#`r?G,!#8=bVLp+kP=I_o@`RgTB/N07pc3O%YF[miYT/gl*]^Ro%0MH=lD0o99U4lO-BS;`uneV'RO#.MqL=-ch#i=a34qf#Ni(Tn#^5A!rNG=EGHQ1j/FupHN/7,YkR!a3#qPX_a8M5Ztq[1>5Y%ZYklV6s#c/\%&a)H&giK=Su-.?if'^%R)BBL;&CcR(pGt=jnMg8Me+]H)H!q@Ts"ttX95Z?if.,al]"8c7Wl9Vki@HMaEm)q\l@E9YEt<8XO3r\FJZe=V:_g:OZ4;RdC65=5t9DuEu(@s?C:k2+37@FBt<987FH6e-[p0feH9L+\F\IJi\+m!ML$_unLK;'s-`=97URl![1aH!E0(MO]='/\'FFA,b4kCq[rcS_DH`da7NEnCQ\V%L-BY\L(;AO'ZK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Wo.)]H-f=tR!gUFZP5-aR6BR98!Eg\9]ch.T-8)knVdj.$h*4UC/c([%6]q^*lbKM(ag.8J/BPHN3IUmTH@c9MhEtMFGrF@WObuMtY>1*Al%ifkK["Xg[k]SFMB9XS.V3%'ZU\[MA/TPZiuf0oB?=T,lft?1pm.'\i#Jg!*W-Q`D>gN6Y5!Z$[0s&j^jTh#fk7V2,GjkY,S*0nu,BDQ[_;SX?07p]>/i+;`']isr'<*iO>*elK,Io1[F@a/A(mh5%d]!82pl9&QSG+NgL3[",lr4`.cH7K@:9RIjr0Vs.$RFirpX(.:GaorG>Oa':RE@uH.oJnn@]2$XPZ?5.eVB$QKWp\XnLj-r:m4&<`sgm,_^J?AY"]NU_X.AUiD&=K3sn6S,4+5H;:d_,Ea9%Fr^2P[mpd//D8/n1B_c%Q+6a9VjnlL?MK1BIWM*bd29VipX%?_>Y8XueXa">CD*!U8*bM2kgrEKCm76T=Tbc>[&Bhn46`qk#j)9@(Od5ChTG4hdt1?I>5O+EPsj+unKW9[4sUFi+k``>/d8GHML,Qn+(Bo)am_[f*nNC!m4EhE-o<^4e+6&EjpU!5POd,'u55HTb)7AnZj$JGZ8Zru;.L[+-F)XWeo=i6o\^W&Bn[I6rH7<>n,CCZd%fXrs)JGTjPq@Um~> +endstream +endobj +21 0 obj +<< /Type /Page +/Parent 1 0 R +/MediaBox [ 0 0 612 792 ] +/Resources 3 0 R +/Contents 20 0 R +>> +endobj +23 0 obj +<< + /Title (\376\377\0\61\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\145\0\40\0\103\0\157\0\144\0\145) + /Parent 22 0 R + /Next 24 0 R + /A 9 0 R +>> endobj +24 0 obj +<< + /Title (\376\377\0\62\0\40\0\114\0\157\0\143\0\141\0\164\0\151\0\157\0\156\0\40\0\157\0\146\0\40\0\164\0\150\0\145\0\40\0\163\0\157\0\165\0\162\0\143\0\145) + /Parent 22 0 R + /Prev 23 0 R + /Next 25 0 R + /A 11 0 R +>> endobj +25 0 obj +<< + /Title (\376\377\0\63\0\40\0\111\0\156\0\144\0\145\0\170\0\106\0\151\0\154\0\145\0\163) + /Parent 22 0 R + /Prev 24 0 R + /Next 26 0 R + /A 13 0 R +>> endobj +26 0 obj +<< + /Title (\376\377\0\64\0\40\0\123\0\145\0\141\0\162\0\143\0\150\0\151\0\156\0\147\0\40\0\106\0\151\0\154\0\145\0\163) + /Parent 22 0 R + /Prev 25 0 R + /Next 27 0 R + /A 15 0 R +>> endobj +27 0 obj +<< + /Title (\376\377\0\65\0\40\0\124\0\150\0\145\0\40\0\127\0\145\0\142\0\40\0\145\0\170\0\141\0\155\0\160\0\154\0\145\0\56\0\56\0\56) + /Parent 22 0 R + /Prev 26 0 R + /A 17 0 R +>> endobj +28 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F3 +/BaseFont /Helvetica-Bold +/Encoding /WinAnsiEncoding >> +endobj +29 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F5 +/BaseFont /Times-Roman +/Encoding /WinAnsiEncoding >> +endobj +30 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F1 +/BaseFont /Helvetica +/Encoding /WinAnsiEncoding >> +endobj +31 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F9 +/BaseFont /Courier +/Encoding /WinAnsiEncoding >> +endobj +32 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F2 +/BaseFont /Helvetica-Oblique +/Encoding /WinAnsiEncoding >> +endobj +33 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F7 +/BaseFont /Times-Bold +/Encoding /WinAnsiEncoding >> +endobj +1 0 obj +<< /Type /Pages +/Count 3 +/Kids [6 0 R 19 0 R 21 0 R ] >> +endobj +2 0 obj +<< /Type /Catalog +/Pages 1 0 R + /Outlines 22 0 R + /PageMode /UseOutlines + >> +endobj +3 0 obj +<< +/Font << /F3 28 0 R /F5 29 0 R /F1 30 0 R /F9 31 0 R /F2 32 0 R /F7 33 0 R >> +/ProcSet [ /PDF /ImageC /Text ] >> +endobj +9 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 659.0 null] +>> +endobj +11 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 580.266 null] +>> +endobj +13 0 obj +<< +/S /GoTo +/D [19 0 R /XYZ 85.0 453.932 null] +>> +endobj +15 0 obj +<< +/S /GoTo +/D [21 0 R /XYZ 85.0 507.0 null] +>> +endobj +17 0 obj +<< +/S /GoTo +/D [21 0 R /XYZ 85.0 335.866 null] +>> +endobj +22 0 obj +<< + /First 23 0 R + /Last 27 0 R +>> endobj +xref +0 34 +0000000000 65535 f +0000008534 00000 n +0000008606 00000 n +0000008698 00000 n +0000000015 00000 n +0000000071 00000 n +0000000777 00000 n +0000000897 00000 n +0000000950 00000 n +0000008832 00000 n +0000001085 00000 n +0000008895 00000 n +0000001221 00000 n +0000008961 00000 n +0000001358 00000 n +0000009027 00000 n +0000001495 00000 n +0000009091 00000 n +0000001632 00000 n +0000004447 00000 n +0000004555 00000 n +0000006800 00000 n +0000009157 00000 n +0000006908 00000 n +0000007081 00000 n +0000007316 00000 n +0000007482 00000 n +0000007677 00000 n +0000007872 00000 n +0000007985 00000 n +0000008095 00000 n +0000008203 00000 n +0000008309 00000 n +0000008425 00000 n +trailer +<< +/Size 34 +/Root 2 0 R +/Info 4 0 R +>> +startxref +9208 +%%EOF Added: lucene/java/trunk/docs/demo3.html URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo3.html?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo3.html (added) +++ lucene/java/trunk/docs/demo3.html Sun Nov 26 16:03:13 2006 @@ -0,0 +1,301 @@ + + + + + + + + + Apache Lucene - Building and Installing the Basic Demo + + + + + + + + + + +
+ +
+ + + + +
+
+
+
+
+ +
+
+ +   +
+ +
+ +

+ Apache Lucene - Building and Installing the Basic Demo +

+ + + + +

About this Document

+
+

+This document is intended as a "getting started" guide to installing and running the Lucene +web application demo. This guide assumes that you have read the information in the previous two +examples. We'll use Tomcat as our reference web container. These demos should work with nearly any +container, but you may have to adapt them appropriately. +

+
+ + + + +

About the Demos

+
+

+The Lucene Web Application demo is a template web application intended for deployment on Tomcat or a +similar web container. It's NOT designed as a "best practices" implementation by ANY means. It's +more of a "hello world" type Lucene Web App. The purpose of this application is to demonstrate +Lucene. With that being said, it should be relatively simple to create a small searchable website +in Tomcat or a similar application server. +

+
+ + + +

Indexing Files

+
+

Once you've gotten this far you're probably itching to go. Let's start by creating the index +you'll need for the web examples. Since you've already set your CLASSPATH in the previous examples, +all you need to do is type: + +

+    java org.apache.lucene.demo.IndexHTML -create -index {index-dir} ..
+
+ +You'll need to do this from a (any) subdirectory of your {tomcat}/webapps directory +(make sure you didn't leave off the .. or you'll get a null pointer exception). +{index-dir} should be a directory that Tomcat has permission to read and write, but is +outside of a web accessible context. By default the webapp is configured to look in +/opt/lucene/index for this index. +

+
+ + + +

Deploying the Demos

+
+

Located in your distribution directory you should see a war file called +luceneweb.war. If you're working with a Subversion checkout, this will be under the +build subdirectory. Copy this to your {tomcat-home}/webapps directory. +You may need to restart Tomcat.

+
+ + + +

Configuration

+
+

From your Tomcat directory look in the webapps/luceneweb subdirectory. If it's not +present, try browsing to http://localhost:8080/luceneweb (which causes Tomcat to deploy +the webapp), then look again. Edit a file called configuration.jsp. Ensure that the +indexLocation is equal to the location you used for your index. You may also customize +the appTitle and appFooter strings as you see fit. Once you have finished +altering the configuration you may need to restart Tomcat. You may also wish to update the war file +by typing jar -uf luceneweb.war configuration.jsp from the luceneweb +subdirectory. (The -u option is not available in all versions of jar. In this case recreate the +war file). +

+
+ + + +

Running the Demos

+
+

Now you're ready to roll. In your browser set the url to +http://localhost:8080/luceneweb enter test and the number of items per +page and press search.

+

You should now be looking either at a number of results (provided you didn't erase the Tomcat +examples) or nothing. If you get an error regarding opening the index, then you probably set the +path in configuration.jsp incorrectly or Tomcat doesn't have permissions to the index +(or you skipped the step of creating it). Try other search terms. Depending on the number of items +per page you set and results returned, there may be a link at the bottom that says More +Results>>; clicking it takes you to subsequent pages.

+
+ + + +

About the code...

+
+

+If you want to know more about how this web app works or how to customize it then read on>>>. +

+
+ + +
+
 
+
+ + + Added: lucene/java/trunk/docs/demo3.pdf URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo3.pdf?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo3.pdf (added) +++ lucene/java/trunk/docs/demo3.pdf Sun Nov 26 16:03:13 2006 @@ -0,0 +1,344 @@ +%PDF-1.3 +%ª«¬­ +4 0 obj +<< /Type /Info +/Producer (FOP 0.20.5) >> +endobj +5 0 obj +<< /Length 661 /Filter [ /ASCII85Decode /FlateDecode ] + >> +stream +Gb!$E966RV&:j6I$6AM$'Km$JrMXAWktJ!,\$QAA_UaYs\NH&;hj7E+lul!AM$jQq@bKRU[1^)HK%h:LKL#a(,!as/$P:qq(ngTB+R\AYL*-pMO;u+8@Wb;LK3X!I,,4eei_u%4j2j5t\8IPVQ.`d;eDs9l"!esA*+8%OgmP0;[6FJjp-#S-8nCcQb+fu:hX3)5A:Q[]^c@$,@O$HG9DRWWCnM_sf'6+uP;rXtqjTUg?qA2O>`q;75!%Q6>1g]O1M^`>l>!WF!Cl8G0^@ZZm;sl`He?raJAM3I^@pj.2RW-Y+&q?tXj*;E)o**Y,(-SpN<"_WUtl1iA/:fV"H!eIbi8NRJ)GZ(d1o.DhWRl>#U++WJ7+J"89@#rT(\_sjf`[-%+mYB"ginoUHFiTUU]oDG3R^CIp#k->N[.YZ7$J9\&EQQ1BDJtIH]dJl0\&lA(@%sJ),KS*0S,5;eP]2"#Qfg7A:JoRt+_48D&j<1>KdC6BYk>L[X[JPB%-QG4)+;?jcnU$)80'8WTlDM#]Ap1U;H,$Vsp0a`)'7/Q$-d,,JO"uJ#rAP_*n7h~> +endstream +endobj +6 0 obj +<< /Type /Page +/Parent 1 0 R +/MediaBox [ 0 0 612 792 ] +/Resources 3 0 R +/Contents 5 0 R +/Annots 7 0 R +>> +endobj +7 0 obj +[ +8 0 R +10 0 R +12 0 R +14 0 R +16 0 R +18 0 R +20 0 R +] +endobj +8 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 519.166 213.332 507.166 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 9 0 R +/H /I +>> +endobj +10 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 500.966 194.66 488.966 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 11 0 R +/H /I +>> +endobj +12 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 482.766 179.0 470.766 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 13 0 R +/H /I +>> +endobj +14 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 464.566 215.324 452.566 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 15 0 R +/H /I +>> +endobj +16 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 446.366 177.332 434.366 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 17 0 R +/H /I +>> +endobj +18 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 428.166 206.0 416.166 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 19 0 R +/H /I +>> +endobj +20 0 obj +<< /Type /Annot +/Subtype /Link +/Rect [ 102.0 409.966 192.32 397.966 ] +/C [ 0 0 0 ] +/Border [ 0 0 0 ] +/A 21 0 R +/H /I +>> +endobj +22 0 obj +<< /Length 2641 /Filter [ /ASCII85Decode /FlateDecode ] + >> +stream +Gatm=>Ar7U(4OT5&GjfjBPpFVdk1L4ND].pN<2Z"W?[*>R$C33&4*R'#j,KYhgO\)`hV[/B;Z:LSQpO/iUQWG8q=2/%O/5B[+F1T+MkM>%29k)/B[Z:=(Isg]i,qa800_"&1+*@Nio71i,G:MjYY5Wlm]=_>&71Scm=Dk9HB6se4^^kXDWP/V@LX'r/r9Ff)Dk1[k0D"=:_p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ZeV9X(FpKrJ'pqdJ/&ISh&;P_:l421KLt-[mT*VVV`>ZHg#A8%p!.0n,uSVD4cSN>nu0PCSa:2?t/PAVO-Cm@-!oou?Eh4E1o7JgNHAAof1a@I4o[\]C/9/5?,S\--^P5;8#e+Q@L?"0#hE0"%7_@lgDOpF?+S0jCT);!VBe47Z*UlbH[AtsSG_c59NCU!BLKpnJ,RZ<3$(#M3uu/p$VLK"CZkmKS1AY\>VWk.WaBN+IS=.$E`@H[M[j/Dn435,ba!&a,.88 ^2\'5h\8cOua.=Wa+A1+sGbOO8_MhY>k/ZZ[j"/1C3%88/U8mu.0c8*7kt5VnU6>So[Z.Kb>%9PIb3S=6klg1n,RqQad5/mk%QQJj69/QNIq,j"UtfEFO?I(Wc#'R/0AHoMNQrDs0l%pV.YZYR@KN'KTggqA'Ph8s1H>pUnPR2!aP:,:2XR40k3hYa'^\fZqba__CprM="uVpF0KL-OV1s0V!cJ"`Gq"=X%FC()lA6qsHl0JJ%bDD+o"2<0k?uS8_$M9k'2o#B6Gn8$K7PItc+k#G1Ql(A[orPk15mJJHLGspK+hVS]!K:%]BQhlhomhR[0eY);<^4b^%ImXA5ceRa@Ph3T1L6)75TYT<:5NE9]?F69&AC[Oe/]X0*?=::o4q]VdS36GZV/_$Qi421/.i=lK<>$F1,tVeU9$l$g[GSkPFZ!T-V&YQf\"0*@\U57c_ii1N5G/&)#Fch7U.lnMtUIr@;dVAol'53pGrCk4/*1l>L;^lSXA%.-c"J#NZVp;2kLr5i\4_PM"&&5`Kr]ISeQdMs[[, +endstream +endobj +25 0 obj +<< /Type /Page +/Parent 1 0 R +/MediaBox [ 0 0 612 792 ] +/Resources 3 0 R +/Contents 24 0 R +>> +endobj +27 0 obj +<< + /Title (\376\377\0\61\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\151\0\163\0\40\0\104\0\157\0\143\0\165\0\155\0\145\0\156\0\164) + /Parent 26 0 R + /Next 28 0 R + /A 9 0 R +>> endobj +28 0 obj +<< + /Title (\376\377\0\62\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\145\0\40\0\104\0\145\0\155\0\157\0\163) + /Parent 26 0 R + /Prev 27 0 R + /Next 29 0 R + /A 11 0 R +>> endobj +29 0 obj +<< + /Title (\376\377\0\63\0\40\0\111\0\156\0\144\0\145\0\170\0\151\0\156\0\147\0\40\0\106\0\151\0\154\0\145\0\163) + /Parent 26 0 R + /Prev 28 0 R + /Next 30 0 R + /A 13 0 R +>> endobj +30 0 obj +<< + /Title (\376\377\0\64\0\40\0\104\0\145\0\160\0\154\0\157\0\171\0\151\0\156\0\147\0\40\0\164\0\150\0\145\0\40\0\104\0\145\0\155\0\157\0\163) + /Parent 26 0 R + /Prev 29 0 R + /Next 31 0 R + /A 15 0 R +>> endobj +31 0 obj +<< + /Title (\376\377\0\65\0\40\0\103\0\157\0\156\0\146\0\151\0\147\0\165\0\162\0\141\0\164\0\151\0\157\0\156) + /Parent 26 0 R + /Prev 30 0 R + /Next 32 0 R + /A 17 0 R +>> endobj +32 0 obj +<< + /Title (\376\377\0\66\0\40\0\122\0\165\0\156\0\156\0\151\0\156\0\147\0\40\0\164\0\150\0\145\0\40\0\104\0\145\0\155\0\157\0\163) + /Parent 26 0 R + /Prev 31 0 R + /Next 33 0 R + /A 19 0 R +>> endobj +33 0 obj +<< + /Title (\376\377\0\67\0\40\0\101\0\142\0\157\0\165\0\164\0\40\0\164\0\150\0\145\0\40\0\143\0\157\0\144\0\145\0\56\0\56\0\56) + /Parent 26 0 R + /Prev 32 0 R + /A 21 0 R +>> endobj +34 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F3 +/BaseFont /Helvetica-Bold +/Encoding /WinAnsiEncoding >> +endobj +35 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F5 +/BaseFont /Times-Roman +/Encoding /WinAnsiEncoding >> +endobj +36 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F1 +/BaseFont /Helvetica +/Encoding /WinAnsiEncoding >> +endobj +37 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F9 +/BaseFont /Courier +/Encoding /WinAnsiEncoding >> +endobj +38 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F2 +/BaseFont /Helvetica-Oblique +/Encoding /WinAnsiEncoding >> +endobj +39 0 obj +<< /Type /Font +/Subtype /Type1 +/Name /F7 +/BaseFont /Times-Bold +/Encoding /WinAnsiEncoding >> +endobj +1 0 obj +<< /Type /Pages +/Count 3 +/Kids [6 0 R 23 0 R 25 0 R ] >> +endobj +2 0 obj +<< /Type /Catalog +/Pages 1 0 R + /Outlines 26 0 R + /PageMode /UseOutlines + >> +endobj +3 0 obj +<< +/Font << /F3 34 0 R /F5 35 0 R /F1 36 0 R /F9 37 0 R /F2 38 0 R /F7 39 0 R >> +/ProcSet [ /PDF /ImageC /Text ] >> +endobj +9 0 obj +<< +/S /GoTo +/D [23 0 R /XYZ 85.0 659.0 null] +>> +endobj +11 0 obj +<< +/S /GoTo +/D [23 0 R /XYZ 85.0 567.066 null] +>> +endobj +13 0 obj +<< +/S /GoTo +/D [23 0 R /XYZ 85.0 448.732 null] +>> +endobj +15 0 obj +<< +/S /GoTo +/D [23 0 R /XYZ 85.0 303.998 null] +>> +endobj +17 0 obj +<< +/S /GoTo +/D [23 0 R /XYZ 85.0 225.264 null] +>> +endobj +19 0 obj +<< +/S /GoTo +/D [25 0 R /XYZ 85.0 602.2 null] +>> +endobj +21 0 obj +<< +/S /GoTo +/D [25 0 R /XYZ 85.0 436.266 null] +>> +endobj +26 0 obj +<< + /First 27 0 R + /Last 33 0 R +>> endobj +xref +0 40 +0000000000 65535 f +0000008656 00000 n +0000008728 00000 n +0000008820 00000 n +0000000015 00000 n +0000000071 00000 n +0000000823 00000 n +0000000943 00000 n +0000001010 00000 n +0000008954 00000 n +0000001145 00000 n +0000009017 00000 n +0000001281 00000 n +0000009083 00000 n +0000001416 00000 n +0000009149 00000 n +0000001553 00000 n +0000009215 00000 n +0000001690 00000 n +0000009281 00000 n +0000001825 00000 n +0000009345 00000 n +0000001961 00000 n +0000004695 00000 n +0000004803 00000 n +0000006503 00000 n +0000009411 00000 n +0000006611 00000 n +0000006814 00000 n +0000007008 00000 n +0000007197 00000 n +0000007415 00000 n +0000007599 00000 n +0000007805 00000 n +0000007994 00000 n +0000008107 00000 n +0000008217 00000 n +0000008325 00000 n +0000008431 00000 n +0000008547 00000 n +trailer +<< +/Size 40 +/Root 2 0 R +/Info 4 0 R +>> +startxref +9462 +%%EOF Added: lucene/java/trunk/docs/demo4.html URL: http://svn.apache.org/viewvc/lucene/java/trunk/docs/demo4.html?view=auto&rev=479466 ============================================================================== --- lucene/java/trunk/docs/demo4.html (added) +++ lucene/java/trunk/docs/demo4.html Sun Nov 26 16:03:13 2006 @@ -0,0 +1,366 @@ + + + + + + + + + Apache Lucene - Basic Demo Sources Walkthrough + + + + + + + + + + +
+ +
+ + + + +
+
+
+
+
+ +
+
+ +   +
+ +
+ +

+ Apache Lucene - Basic Demo Sources Walkthrough +

+ + + + +

About the Code

+
+

+In this section we walk through the sources behind the basic Lucene Web Application demo: where to +find them, their parts and their function. This section is intended for Java developers wishing to +understand how to use Lucene in their applications or for those involved in deploying web +applications based on Lucene. +

+
+ + + + +

Location of the source (developers/deployers)

+
+

+Relative to the directory created when you extracted Lucene or retrieved it from Subversion, you +should see a directory called src which in turn contains a directory called +jsp. This is the root for all of the Lucene web demo. +

+

+Within this directory you should see index.jsp. Bring this up in vi or your editor of +choice. +

+
+ + + +

index.jsp (developers/deployers)

+
+

+This jsp page is pretty boring by itself. All it does is include a header, display a form and +include a footer. If you look at the form, it has two fields: query (where you enter +your search criteria) and maxresults where you specify the number of results per page. +By the structure of this JSP it should be easy to customize it without even editing this particular +file. You could simply change the header and footer. Let's look at the header.jsp +(located in the same directory) next. +

+
+ + + +

header.jsp (developers/deployers)

+
+

+The header is also very simple by itself. The only thing it does is include the +configuration.jsp (which you looked at in the last section of this guide) and set the +title and a brief header. This would be a good place to put your own custom HTML to "pretty" things +up a bit. We won't cover the footer because all it does is display the footer and close your tags. +Let's look at the results.jsp, the meat of this application, next. +

+
+ + + +

results.jsp (developers)

+
+

+Most of the functionality lies in results.jsp. Much of it is for paging the search +results, which we'll not cover here as it's commented well enough. The first thing in this page is +the actual imports for the Lucene classes and Lucene demo classes. These classes are loaded from +the jars included in the WEB-INF/lib directory in the luceneweb.war file. +

+

+You'll notice that this file includes the same header and footer as index.jsp. From +there it constructs an IndexSearcher with the +indexLocation that was specified in configuration.jsp. If there is an +error of any kind in opening the index, it is displayed to the user and the boolean flag +error is set to tell the rest of the sections of the jsp not to continue. +

+

+From there, this jsp attempts to get the search criteria, the start index (used for paging) and the +maximum number of results per page. If the maximum results per page is not set or not valid then it +and the start index are set to default values. If only the start index is invalid it is set to a +default value. If the criteria isn't provided then a servlet error is thrown (it is assumed that +this is the result of url tampering or some form of browser malfunction). +

+

+The jsp moves on to construct a StandardAnalyzer to +analyze the search text. This matches the analyzer used during indexing (IndexHTML), which is generally +recommended. This is passed to the QueryParser along with the +criteria to construct a Query +object. You'll also notice the string literal "contents" included. This specifies +that the search should cover the contents field and not the title, +url or some other field in the indexed documents. If there is any error in +constructing a Query object an +error is displayed to the user. +

+

+In the next section of the jsp the IndexSearcher is asked to search +given the query object. The results are returned in a collection called hits. If the +length property of the hits collection is 0 (meaning there were no results) then an +error is displayed to the user and the error flag is set. +

+

+Finally the jsp iterates through the hits collection, taking the current page into +account, and displays properties of the Document objects we talked about in +the first walkthrough. These objects contain "known" fields specific to their indexer (in this case +IndexHTML constructs a document +with "url", "title" and "contents"). +

+

+Please note that in a real deployment of Lucene, it's best to instantiate IndexSearcher and QueryParser once, and then +share them across search requests, instead of re-instantiating per search request. +

+
+ + + +

More sources (developers)

+
+

+There are additional sources used by the web app that were not specifically covered by either +walkthrough. For example the HTML parser, the IndexHTML class and HTMLDocument class. These are very +similar to the classes covered in the first example, with properties specific to parsing and +indexing HTML. This is beyond our scope; however, by now you should feel like you're "getting +started" with Lucene. +

+
+ + + +

Where to go from here? (everyone!)

+
+

+There are a number of things this demo doesn't do or doesn't do quite right. For instance, you may +have noticed that documents in the root context are unreachable (unless you reconfigure Tomcat to +support that context or redirect to it), anywhere where the directory doesn't quite match the +context mapping, you'll have a broken link in your results. If you want to index non-local files or +have some other needs this isn't supported, plus there may be security issues with running the +indexing application from your webapps directory. There are a number of things left for you the +developer to do. +

+

+In time some of these things may be added to Lucene as features (if you've got a good idea we'd love +to hear it!), but for now: this is where you begin and the search engine/indexer ends. Lastly, one +would assume you'd want to follow the above advice and customize the application to look a little +more fancy than black on white with "Lucene Template" at the top. We'll see you on the Lucene +Users' or Developers' mailing lists! +

+
+ + + +

When to contact the Author

+
+

+Please resist the urge to contact the authors of this document (without bribes of fame and fortune +attached). First contact the mailing lists, taking care to Ask Questions The Smart Way. +Certainly you'll get the most help that way as well. That being said, feedback, and modifications +to this document and samples are ever so greatly appreciated. They are just best sent to the lists +or posted as patches, so that +everyone can share in them. Thanks for understanding! +

+
+ + +
+
 
+
+ + +