further demo site updates - mostly making the Demo links work again

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@808115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-08-26 16:39:32 +00:00
parent 6cf489113c
commit 533831e584
6 changed files with 165 additions and 165 deletions

View File

@ -302,27 +302,27 @@ Bring it up in <span class="codefrag">vi</span> or your editor of choice and let
<h2 class="boxed">IndexFiles</h2>
<div class="section">
<p>
As we discussed in the previous walk-through, the <span class="codefrag">IndexFiles</span> class creates a Lucene
As we discussed in the previous walk-through, the <a href="api/demo/org/apache/lucene/demo/IndexFiles.html">IndexFiles</a> class creates a Lucene
Index. Let's take a look at how it does this.
</p>
<p>
The first substantial thing the <span class="codefrag">main</span> function does is instantiate <span class="codefrag">IndexWriter</span>. It passes the string
"<span class="codefrag">index</span>" and a new instance of a class called <span class="codefrag">StandardAnalyzer</span>.
The first substantial thing the <span class="codefrag">main</span> function does is instantiate <a href="api/core/org/apache/lucene/index/IndexWriter.html">IndexWriter</a>. It passes the string
"<span class="codefrag">index</span>" and a new instance of a class called <a href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>.
The "<span class="codefrag">index</span>" 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).
</p>
<p>
The <span class="codefrag">IndexWriter</span> is the main
The <a href="api/core/org/apache/lucene/index/IndexWriter.html">IndexWriter</a> 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 <span class="codefrag">Directory</span>. In any case, you must also pass an
instance of <span class="codefrag">org.apache.lucene.analysis.Analyzer</span>.
refresh the index at that path. You can also create an index using one of the subclasses of <a href="api/core/org/apache/lucene/store/Directory.html">Directory</a>. In any case, you must also pass an
instance of <a href="api/core/org/apache/lucene/analysis/Analyzer.html">org.apache.lucene.analysis.Analyzer</a>.
</p>
<p>
The particular <span class="codefrag">Analyzer</span> we
are using, <span class="codefrag">StandardAnalyzer</span>, is
The particular <a href="api/core/org/apache/lucene/analysis/Analyzer.html">Analyzer</a> we
are using, <a href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>, is
little more than a standard Java Tokenizer, converting all strings to lowercase and filtering out
stop words and characters from the index. By stop words and characters I mean common language
words such as articles (a, an, the, etc.) and other strings that may have less value for searching
@ -332,42 +332,42 @@ different languages (see the <span class="codefrag">*Analyzer.java</span> source
</p>
<p>
Looking further down in the file, you should see the <span class="codefrag">indexDocs()</span> code. This recursive
function simply crawls the directories and uses <span class="codefrag">FileDocument</span> to create <span class="codefrag">Document</span> objects. The <span class="codefrag">Document</span> is simply a data object to
function simply crawls the directories and uses <a href="api/demo/org/apache/lucene/demo/FileDocument.html">FileDocument</a> to create <a href="api/core/org/apache/lucene/document/Document.html">Document</a> objects. The <a href="api/core/org/apache/lucene/document/Document.html">Document</a> 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 <span class="codefrag">indexWriter</span>. Take a look inside <span class="codefrag">FileDocument</span>. It's not particularly
complicated. It just adds fields to the <span class="codefrag">Document</span>.
added to the <span class="codefrag">indexWriter</span>. Take a look inside <a href="api/demo/org/apache/lucene/demo/FileDocument.html">FileDocument</a>. It's not particularly
complicated. It just adds fields to the <a href="api/core/org/apache/lucene/document/Document.html">Document</a>.
</p>
<p>
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 <span class="codefrag">IndexHTML</span> class. It is a bit more
wish to examine the other samples in this directory, particularly the <a href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a> class. It is a bit more
complex but builds upon this example.
</p>
</div>
<a name="N100AE"></a><a name="Searching Files"></a>
<a name="N100A0"></a><a name="Searching Files"></a>
<h2 class="boxed">Searching Files</h2>
<div class="section">
<p>
The <span class="codefrag">SearchFiles</span> class is
quite simple. It primarily collaborates with an <span class="codefrag">IndexSearcher</span>, <span class="codefrag">StandardAnalyzer</span>
(which is used in the <span class="codefrag">IndexFiles</span> class as well) and a
<span class="codefrag">QueryParser</span>. The
The <a href="api/demo/org/apache/lucene/demo/SearchFiles.html">SearchFiles</a> class is
quite simple. It primarily collaborates with an <a href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>, <a href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>
(which is used in the <a href="api/core/org/apache/lucene/demo/IndexFiles.html">IndexFiles</a> class as well) and a
<a href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a>. 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 <span class="codefrag">Query</span> object contains
the results from the <span class="codefrag">QueryParser</span> which is passed to
the searcher. Note that it's also possible to programmatically construct a rich <span class="codefrag">Query</span> object without using the query
'the'. The <a href="api/core/org/apache/lucene/search/Query.html">Query</a> object contains
the results from the <a href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a> which is passed to
the searcher. Note that it's also possible to programmatically construct a rich <a href="api/core/org/apache/lucene/search/Query.html">Query</a> object without using the query
parser. The query parser just enables decoding the <a href="queryparsersyntax.html">Lucene query
syntax</a> into the corresponding <span class="codefrag">Query</span> object. Search can be executed in
syntax</a> into the corresponding <a href="api/core/org/apache/lucene/search/Query.html">Query</a> object. Search can be executed in
two different ways:
<ul>
<li>Streaming: A <span class="codefrag">HitCollector</span> subclass
<li>Streaming: A <a href="api/core/org/apache/lucene/search/Collector.html">Collector</a> subclass
simply prints out the document ID and score for each matching document.</li>
<li>Paging: Using a <span class="codefrag">TopDocCollector</span>
the search results are printed in pages, sorted by score (i. e. relevance).</li>
<li>Paging: Using a <a href="api/core/org/apache/lucene/search/TopScoreDocCollector.html">TopScoreDocCollector</a>
the search results are printed in pages, sorted by score (i. e. relevance).</li>
</ul>
@ -375,7 +375,7 @@ the search results are printed in pages, sorted by score (i. e. relevance).</li>
</div>
<a name="N100FB"></a><a name="The Web example..."></a>
<a name="N100E2"></a><a name="The Web example..."></a>
<h2 class="boxed">The Web example...</h2>
<div class="section">
<p>

View File

@ -80,10 +80,10 @@ endobj
>>
endobj
18 0 obj
<< /Length 2732 /Filter [ /ASCII85Decode /FlateDecode ]
<< /Length 2590 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gatm>D3*F0')oV[6HGK=`@b5dhYSnZ?A]F#m]Q('38F30=/Kh@AC75!42,'OUDI,j1?ir/,!^<co4@'PR:h8lI9PG)D/o=IS^4T(o0]_Y)$N>#1\UFao?>p0J,/D+hHfP*hb2r7rf?(,pP0l'5o=l:H7sLB]R*i;4ap)<TUW/fh>,q(%X*APJN#->6C=?hMll`GG6*'Z4n*oiG9:.5gJ#Ls,H&?gH3pA(]Z&3Lpd)[\:STUP`3LXKM%c^:+i;0(^^";H+?X%/3lpij_?[,f)V)-,PX]"%OB;`bI`2\SDV#h_$FObG+jnRgEhfY2@s4QT>>Zso8l_Q\Iq]:Ia%Ntnh]m,!d\(Lt4[MWgp+s]Y[9%DM[eF=2bV\)]didnoCaG[aC9&C4ADG.H;"9mPC1O`:B`"&aS,Y&5![Fq9V;=dr2E7WROBpV*O7Sb7U[fEfV^3o7B^1=#[F#5:j`tlp`?_I(_BO08;AGqT]Oofcs(!h'C!?A5s&[+#U6.hpo(`7j8(RN*%q8;+kg`\BG/e,6-Qij_aTh8+>@KCK3(m$mnZ+3,R_?(4K1N=J#$afj,Dm`k7>&8[U')ogeEo)Sh\m^H14*nGm#"7j7Y(Z9kmB/tb384LqV8gO_8cQ+H`LfMSAck8M,<k7[j=)0Q:N!8?$B/3STOgMO!!s$Ye,/eR"q2<S)V*AdQY>8[eZ*(7MQk4&@;Y$$=,MU<V9^r6'MR)jr"o3j2EMu`4jR7q&1V`Fh_/I'dP=mXX-/E[)Pjk*<qb=+f&p*?R,+?eWH+I?Wf'F.q$85:rZ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d*o!2UfH/9$,aD+Y6+<f2Ok?'O=sDL4YjTr@,LB#)3?7o%NSBAa.3q!Xs.3\/00W9LM"MiXG8V>(8\CRk8l.<^jq%\Q@5>3\4/'V)GhV&$UQ*t/1^_+8]cnI"%h)eDfN,?*7Ci[;+-91r=5NCJ^-K<qH2PE4O6rR#)8@h%AbRHW-&A0OnS:q\d3RL9FY$)0]Z_$KS+5)d]n2V_[Q\;.tBD/C(:jB'1,>L9nT#R<2`?5fS5P**h'I6W<4Si=/[KAm&C\3i[WHM[CP)JUYg;#3,?=^.=:=J7Hbgo)N^O[r=cHtVCVQ"rEuMd9f!79>E%F43&:3#HoLb%RZ+MPj2l!PB)81&FXg3adI&`IUX$/WMclj)EX*5\ZmV-Q#Zq0ce9B6oi[9;b2s"+glMQo9pNC$BgMOAoQX6E0S[NO\+aqGO<4n\f1H1Ui>7;,XtDufjZp[_3jQ_;+*;XqT:_+l?XaPLfG;hR89PbeE4IM3rKr-fMAg@!haT=$4XK>lIDq:j5#:TUnG*Xdh=AWSt?Iii9iq;2#u0s-*`NqDL?Q&NS[LNF7%(2:^l'1)c0JNXi^A).kSMCeU&a6h-Si7J>@81Eta^)!uetN;%(D;%#/C'-4?L]LKL4$FLM@*K]i&"_ERff(njT-08`:97nss(/7*8[XZ/L8^>!iOP,)BhqN3^rI+O@Ud?"P1!(#=uDoB(J%;"*T\J>WFrpf,bR+>Vkon..!KuOPtfj/fEEX(qrKlMO.~>
endstream
endobj
21 0 obj
@ -227,13 +227,13 @@ endobj
15 0 obj
<<
/S /GoTo
/D [21 0 R /XYZ 85.0 507.0 null]
/D [21 0 R /XYZ 85.0 520.2 null]
>>
endobj
17 0 obj
<<
/S /GoTo
/D [21 0 R /XYZ 85.0 290.266 null]
/D [21 0 R /XYZ 85.0 316.666 null]
>>
endobj
22 0 obj
@ -244,39 +244,39 @@ endobj
xref
0 34
0000000000 65535 f
0000008704 00000 n
0000008776 00000 n
0000008868 00000 n
0000008278 00000 n
0000008350 00000 n
0000008442 00000 n
0000000015 00000 n
0000000071 00000 n
0000000777 00000 n
0000000897 00000 n
0000000950 00000 n
0000009002 00000 n
0000008576 00000 n
0000001085 00000 n
0000009065 00000 n
0000008639 00000 n
0000001221 00000 n
0000009131 00000 n
0000008705 00000 n
0000001358 00000 n
0000009197 00000 n
0000008771 00000 n
0000001495 00000 n
0000009261 00000 n
0000008835 00000 n
0000001632 00000 n
0000004457 00000 n
0000004565 00000 n
0000006970 00000 n
0000009327 00000 n
0000007078 00000 n
0000007251 00000 n
0000007486 00000 n
0000007652 00000 n
0000007847 00000 n
0000008042 00000 n
0000008155 00000 n
0000008265 00000 n
0000008373 00000 n
0000008479 00000 n
0000008595 00000 n
0000004315 00000 n
0000004423 00000 n
0000006544 00000 n
0000008901 00000 n
0000006652 00000 n
0000006825 00000 n
0000007060 00000 n
0000007226 00000 n
0000007421 00000 n
0000007616 00000 n
0000007729 00000 n
0000007839 00000 n
0000007947 00000 n
0000008053 00000 n
0000008169 00000 n
trailer
<<
/Size 34
@ -284,5 +284,5 @@ trailer
/Info 4 0 R
>>
startxref
9378
8952
%%EOF

View File

@ -345,7 +345,7 @@ the jars included in the <span class="codefrag">WEB-INF/lib</span> directory in
</p>
<p>
You'll notice that this file includes the same header and footer as <span class="codefrag">index.jsp</span>. From
there it constructs an <span class="codefrag">IndexSearcher</span> with the
there it constructs an <a href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> with the
<span class="codefrag">indexLocation</span> that was specified in <span class="codefrag">configuration.jsp</span>. If there is an
error of any kind in opening the index, it is displayed to the user and the boolean flag
<span class="codefrag">error</span> is set to tell the rest of the sections of the jsp not to continue.
@ -358,42 +358,42 @@ default value. If the criteria isn't provided then a servlet error is thrown (i
this is the result of url tampering or some form of browser malfunction).
</p>
<p>
The jsp moves on to construct a <span class="codefrag">StandardAnalyzer</span> to
analyze the search text. This matches the analyzer used during indexing (<span class="codefrag">IndexHTML</span>), which is generally
recommended. This is passed to the <span class="codefrag">QueryParser</span> along with the
criteria to construct a <span class="codefrag">Query</span>
The jsp moves on to construct a <a href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a> to
analyze the search text. This matches the analyzer used during indexing (<a href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a>), which is generally
recommended. This is passed to the <a href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a> along with the
criteria to construct a <a href="api/core/org/apache/lucene/search/Query.html">Query</a>
object. You'll also notice the string literal <span class="codefrag">"contents"</span> included. This specifies
that the search should cover the <span class="codefrag">contents</span> field and not the <span class="codefrag">title</span>,
<span class="codefrag">url</span> or some other field in the indexed documents. If there is any error in
constructing a <span class="codefrag">Query</span> object an
constructing a <a href="api/org/apache/lucene/search/Query.html">Query</a> object an
error is displayed to the user.
</p>
<p>
In the next section of the jsp the <span class="codefrag">IndexSearcher</span> is asked to search
In the next section of the jsp the <a href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> is asked to search
given the query object. The results are returned in a collection called <span class="codefrag">hits</span>. If the
length property of the <span class="codefrag">hits</span> collection is 0 (meaning there were no results) then an
error is displayed to the user and the error flag is set.
</p>
<p>
Finally the jsp iterates through the <span class="codefrag">hits</span> collection, taking the current page into
account, and displays properties of the <span class="codefrag">Document</span> objects we talked about in
account, and displays properties of the <a href="api/core/org/apache/lucene/document/Document.html">Document</a> objects we talked about in
the first walkthrough. These objects contain "known" fields specific to their indexer (in this case
<span class="codefrag">IndexHTML</span> constructs a document
<a href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a> constructs a document
with "url", "title" and "contents").
</p>
<p>
Please note that in a real deployment of Lucene, it's best to instantiate <span class="codefrag">IndexSearcher</span> and <span class="codefrag">QueryParser</span> once, and then
Please note that in a real deployment of Lucene, it's best to instantiate <a href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> and <a href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a> once, and then
share them across search requests, instead of re-instantiating per search request.
</p>
</div>
<a name="N100CE"></a><a name="More sources (developers)"></a>
<a name="N100C3"></a><a name="More sources (developers)"></a>
<h2 class="boxed">More sources (developers)</h2>
<div class="section">
<p>
There are additional sources used by the web app that were not specifically covered by either
walkthrough. For example the HTML parser, the <span class="codefrag">IndexHTML</span> class and <span class="codefrag">HTMLDocument</span> class. These are very
walkthrough. For example the HTML parser, the <a href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a> class and <a href="api/demo/org/apache/lucene/demo/HTMLDocument.html">HTMLDocument</a> 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.
@ -401,7 +401,7 @@ started" with Lucene.
</div>
<a name="N100E1"></a><a name="Where to go from here? (everyone!)"></a>
<a name="N100D4"></a><a name="Where to go from here? (everyone!)"></a>
<h2 class="boxed">Where to go from here? (everyone!)</h2>
<div class="section">
<p>
@ -423,7 +423,7 @@ Users' or Developers' <a href="http://lucene.apache.org/java/docs/mailinglists.h
</div>
<a name="N100F1"></a><a name="When to contact the Author"></a>
<a name="N100E4"></a><a name="When to contact the Author"></a>
<h2 class="boxed">When to contact the Author</h2>
<div class="section">
<p>

View File

@ -128,10 +128,10 @@ endobj
>>
endobj
26 0 obj
<< /Length 2858 /Filter [ /ASCII85Decode /FlateDecode ]
<< /Length 2630 /Filter [ /ASCII85Decode /FlateDecode ]
>>
stream
Gatm>D3*Gk&cR6oK%1\7J2>+;(\C',2n_&%"$!]=+NX5n*jq.h7rjk@H*[;44!Z+mB!of\e&&>;Ubo]ioCC*]ZhJHfpUBhOmruLPK>6=$jdtcu8Wpm(;;D3L+n@`SEYN_hms_kF\A%k&0m<Hp5$;gm]Ks\m5JApG`eg10OgD3\?f)[*DHbR*D0,/n#_pmdZhiPSQa?Yr/<`lQ>aFm>fZga]Y4=rniEs?=VM[N<PAkmq*5mCIlbZ0>mcVjL4^Zi)aJ8&)7)/UH=g1rJH=?P%pK_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CNhoOhLM>^kULbp%Z'#ac3$9Tu08*B2oEI\T@`h2=pI6$oTpuFRp-cPkI&89dBDEJD`]c/fjrM@q]#^ZU?5Or;V49~>
endstream
endobj
27 0 obj
@ -311,13 +311,13 @@ endobj
19 0 obj
<<
/S /GoTo
/D [27 0 R /XYZ 85.0 258.6 null]
/D [27 0 R /XYZ 85.0 271.8 null]
>>
endobj
21 0 obj
<<
/S /GoTo
/D [27 0 R /XYZ 85.0 153.466 null]
/D [27 0 R /XYZ 85.0 166.666 null]
>>
endobj
23 0 obj
@ -334,50 +334,50 @@ endobj
xref
0 45
0000000000 65535 f
0000012795 00000 n
0000012874 00000 n
0000012966 00000 n
0000012567 00000 n
0000012646 00000 n
0000012738 00000 n
0000000015 00000 n
0000000071 00000 n
0000000917 00000 n
0000001037 00000 n
0000001111 00000 n
0000013100 00000 n
0000012872 00000 n
0000001246 00000 n
0000013163 00000 n
0000012935 00000 n
0000001383 00000 n
0000013229 00000 n
0000013001 00000 n
0000001520 00000 n
0000013295 00000 n
0000013067 00000 n
0000001657 00000 n
0000013361 00000 n
0000013133 00000 n
0000001794 00000 n
0000013427 00000 n
0000013199 00000 n
0000001931 00000 n
0000013491 00000 n
0000013263 00000 n
0000002068 00000 n
0000013557 00000 n
0000013329 00000 n
0000002205 00000 n
0000004808 00000 n
0000004916 00000 n
0000007867 00000 n
0000007975 00000 n
0000009848 00000 n
0000013621 00000 n
0000009956 00000 n
0000010129 00000 n
0000010498 00000 n
0000010791 00000 n
0000011090 00000 n
0000011336 00000 n
0000011588 00000 n
0000011889 00000 n
0000012133 00000 n
0000012246 00000 n
0000012356 00000 n
0000012464 00000 n
0000012570 00000 n
0000012686 00000 n
0000007639 00000 n
0000007747 00000 n
0000009620 00000 n
0000013393 00000 n
0000009728 00000 n
0000009901 00000 n
0000010270 00000 n
0000010563 00000 n
0000010862 00000 n
0000011108 00000 n
0000011360 00000 n
0000011661 00000 n
0000011905 00000 n
0000012018 00000 n
0000012128 00000 n
0000012236 00000 n
0000012342 00000 n
0000012458 00000 n
trailer
<<
/Size 45
@ -385,5 +385,5 @@ trailer
/Info 4 0 R
>>
startxref
13672
13444
%%EOF

View File

@ -38,16 +38,16 @@ Bring it up in <code>vi</code> or your editor of choice and let's take a look at
<section id="IndexFiles"><title>IndexFiles</title>
<p>
As we discussed in the previous walk-through, the <code><a
href="api/core/org/apache/lucene/demo/IndexFiles.html">IndexFiles</a></code> class creates a Lucene
As we discussed in the previous walk-through, the <a
href="api/demo/org/apache/lucene/demo/IndexFiles.html">IndexFiles</a> class creates a Lucene
Index. Let's take a look at how it does this.
</p>
<p>
The first substantial thing the <code>main</code> function does is instantiate <code><a
href="api/core/org/apache/lucene/index/IndexWriter.html">IndexWriter</a></code>. It passes the string
"<code>index</code>" and a new instance of a class called <code><a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a></code>.
The first substantial thing the <code>main</code> function does is instantiate <a
href="api/core/org/apache/lucene/index/IndexWriter.html">IndexWriter</a>. It passes the string
"<code>index</code>" and a new instance of a class called <a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>.
The "<code>index</code>" 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
@ -55,19 +55,19 @@ in other directories (such as the user's home directory).
</p>
<p>
The <code><a href="api/core/org/apache/lucene/index/IndexWriter.html">IndexWriter</a></code> is the main
The <a href="api/core/org/apache/lucene/index/IndexWriter.html">IndexWriter</a> 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 <code><a
href="api/core/org/apache/lucene/store/Directory.html">Directory</a></code>. In any case, you must also pass an
instance of <code><a
href="api/core/org/apache/lucene/analysis/Analyzer.html">org.apache.lucene.analysis.Analyzer</a></code>.
refresh the index at that path. You can also create an index using one of the subclasses of <a
href="api/core/org/apache/lucene/store/Directory.html">Directory</a>. In any case, you must also pass an
instance of <a
href="api/core/org/apache/lucene/analysis/Analyzer.html">org.apache.lucene.analysis.Analyzer</a>.
</p>
<p>
The particular <code><a href="api/core/org/apache/lucene/analysis/Analyzer.html">Analyzer</a></code> we
are using, <code><a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a></code>, is
The particular <a href="api/core/org/apache/lucene/analysis/Analyzer.html">Analyzer</a> we
are using, <a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>, is
little more than a standard Java Tokenizer, converting all strings to lowercase and filtering out
stop words and characters from the index. By stop words and characters I mean common language
words such as articles (a, an, the, etc.) and other strings that may have less value for searching
@ -79,21 +79,21 @@ href="http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/analyzers/common
<p>
Looking further down in the file, you should see the <code>indexDocs()</code> code. This recursive
function simply crawls the directories and uses <code><a
href="api/core/org/apache/lucene/demo/FileDocument.html">FileDocument</a></code> to create <code><a
href="api/core/org/apache/lucene/document/Document.html">Document</a></code> objects. The <code><a
href="api/core/org/apache/lucene/document/Document.html">Document</a></code> is simply a data object to
function simply crawls the directories and uses <a
href="api/demo/org/apache/lucene/demo/FileDocument.html">FileDocument</a> to create <a
href="api/core/org/apache/lucene/document/Document.html">Document</a> objects. The <a
href="api/core/org/apache/lucene/document/Document.html">Document</a> 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 <code>indexWriter</code>. Take a look inside <code><a
href="api/core/org/apache/lucene/demo/FileDocument.html">FileDocument</a></code>. It's not particularly
complicated. It just adds fields to the <code><a
href="api/core/org/apache/lucene/document/Document.html">Document</a></code>.
added to the <code>indexWriter</code>. Take a look inside <a
href="api/demo/org/apache/lucene/demo/FileDocument.html">FileDocument</a>. It's not particularly
complicated. It just adds fields to the <a
href="api/core/org/apache/lucene/document/Document.html">Document</a>.
</p>
<p>
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 <code><a
href="api/core/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a></code> class. It is a bit more
wish to examine the other samples in this directory, particularly the <a
href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a> class. It is a bit more
complex but builds upon this example.
</p>
@ -102,29 +102,29 @@ complex but builds upon this example.
<section id="Searching Files"><title>Searching Files</title>
<p>
The <code><a href="api/core/org/apache/lucene/demo/SearchFiles.html">SearchFiles</a></code> class is
quite simple. It primarily collaborates with an <code><a
href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a></code>, <code><a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a></code>
(which is used in the <code><a
href="api/core/org/apache/lucene/demo/IndexFiles.html">IndexFiles</a></code> class as well) and a
<code><a href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a></code>. The
The <a href="api/demo/org/apache/lucene/demo/SearchFiles.html">SearchFiles</a> class is
quite simple. It primarily collaborates with an <a
href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>, <a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>
(which is used in the <a
href="api/core/org/apache/lucene/demo/IndexFiles.html">IndexFiles</a> class as well) and a
<a href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a>. 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 <code><a href="api/core/org/apache/lucene/search/Query.html">Query</a></code> object contains
the results from the <code><a
href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a></code> which is passed to
the searcher. Note that it's also possible to programmatically construct a rich <code><a
href="api/core/org/apache/lucene/search/Query.html">Query</a></code> object without using the query
'the'. The <a href="api/core/org/apache/lucene/search/Query.html">Query</a> object contains
the results from the <a
href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a> which is passed to
the searcher. Note that it's also possible to programmatically construct a rich <a
href="api/core/org/apache/lucene/search/Query.html">Query</a> object without using the query
parser. The query parser just enables decoding the <a href="queryparsersyntax.html">Lucene query
syntax</a> into the corresponding <code><a
href="api/core/org/apache/lucene/search/Query.html">Query</a></code> object. Search can be executed in
syntax</a> into the corresponding <a
href="api/core/org/apache/lucene/search/Query.html">Query</a> object. Search can be executed in
two different ways:
<ul>
<li>Streaming: A <code><a href="api/core/org/apache/lucene/search/HitCollector.html">HitCollector</a></code> subclass
<li>Streaming: A <a href="api/core/org/apache/lucene/search/Collector.html">Collector</a> subclass
simply prints out the document ID and score for each matching document.</li>
<li>Paging: Using a <code><a href="api/core/org/apache/lucene/search/TopDocCollector.html">TopDocCollector</a></code>
the search results are printed in pages, sorted by score (i. e. relevance).</li>
<li>Paging: Using a <a href="api/core/org/apache/lucene/search/TopScoreDocCollector.html">TopScoreDocCollector</a>
the search results are printed in pages, sorted by score (i. e. relevance).</li>
</ul>
</p>

View File

@ -62,8 +62,8 @@ the jars included in the <code>WEB-INF/lib</code> directory in the <code>lucenew
</p>
<p>
You'll notice that this file includes the same header and footer as <code>index.jsp</code>. From
there it constructs an <code><a
href="api/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a></code> with the
there it constructs an <a
href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> with the
<code>indexLocation</code> that was specified in <code>configuration.jsp</code>. If there is an
error of any kind in opening the index, it is displayed to the user and the boolean flag
<code>error</code> is set to tell the rest of the sections of the jsp not to continue.
@ -76,38 +76,38 @@ default value. If the criteria isn't provided then a servlet error is thrown (i
this is the result of url tampering or some form of browser malfunction).
</p>
<p>
The jsp moves on to construct a <code><a
href="api/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a></code> to
analyze the search text. This matches the analyzer used during indexing (<code><a
href="api/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a></code>), which is generally
recommended. This is passed to the <code><a
href="api/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a></code> along with the
criteria to construct a <code><a href="api/org/apache/lucene/search/Query.html">Query</a></code>
The jsp moves on to construct a <a
href="api/core/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a> to
analyze the search text. This matches the analyzer used during indexing (<a
href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a>), which is generally
recommended. This is passed to the <a
href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a> along with the
criteria to construct a <a href="api/core/org/apache/lucene/search/Query.html">Query</a>
object. You'll also notice the string literal <code>"contents"</code> included. This specifies
that the search should cover the <code>contents</code> field and not the <code>title</code>,
<code>url</code> or some other field in the indexed documents. If there is any error in
constructing a <code><a href="api/org/apache/lucene/search/Query.html">Query</a></code> object an
constructing a <a href="api/org/apache/lucene/search/Query.html">Query</a> object an
error is displayed to the user.
</p>
<p>
In the next section of the jsp the <code><a
href="api/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a></code> is asked to search
In the next section of the jsp the <a
href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> is asked to search
given the query object. The results are returned in a collection called <code>hits</code>. If the
length property of the <code>hits</code> collection is 0 (meaning there were no results) then an
error is displayed to the user and the error flag is set.
</p>
<p>
Finally the jsp iterates through the <code>hits</code> collection, taking the current page into
account, and displays properties of the <code><a
href="api/org/apache/lucene/document/Document.html">Document</a></code> objects we talked about in
account, and displays properties of the <a
href="api/core/org/apache/lucene/document/Document.html">Document</a> objects we talked about in
the first walkthrough. These objects contain "known" fields specific to their indexer (in this case
<code><a href="api/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a></code> constructs a document
<a href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a> constructs a document
with "url", "title" and "contents").
</p>
<p>
Please note that in a real deployment of Lucene, it's best to instantiate <code><a
href="api/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a></code> and <code><a
href="api/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a></code> once, and then
Please note that in a real deployment of Lucene, it's best to instantiate <a
href="api/core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> and <a
href="api/core/org/apache/lucene/queryParser/QueryParser.html">QueryParser</a> once, and then
share them across search requests, instead of re-instantiating per search request.
</p>
</section>
@ -115,9 +115,9 @@ share them across search requests, instead of re-instantiating per search reques
<section id="More sources (developers)"><title>More sources (developers)</title>
<p>
There are additional sources used by the web app that were not specifically covered by either
walkthrough. For example the HTML parser, the <code><a
href="api/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a></code> class and <code><a
href="api/org/apache/lucene/demo/HTMLDocument.html">HTMLDocument</a></code> class. These are very
walkthrough. For example the HTML parser, the <a
href="api/demo/org/apache/lucene/demo/IndexHTML.html">IndexHTML</a> class and <a
href="api/demo/org/apache/lucene/demo/HTMLDocument.html">HTMLDocument</a> 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.