lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r428479 - /lucene/java/trunk/src/java/overview.html
Date Thu, 03 Aug 2006 19:07:32 GMT
Author: dnaber
Date: Thu Aug  3 12:07:32 2006
New Revision: 428479

URL: http://svn.apache.org/viewvc?rev=428479&view=rev
Log:
fix the code example (still used the old API); fix a few spelling mistakes

Modified:
    lucene/java/trunk/src/java/overview.html

Modified: lucene/java/trunk/src/java/overview.html
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/overview.html?rev=428479&r1=428478&r2=428479&view=diff
==============================================================================
--- lucene/java/trunk/src/java/overview.html (original)
+++ lucene/java/trunk/src/java/overview.html Thu Aug  3 12:07:32 2006
@@ -10,7 +10,7 @@
 
 <!-- ======================================================== -->
 <!-- = Java Sourcecode to HTML automatically converted code = -->
-<!-- =   Java2Html Converter V4.1 2004 by Markus Gebhard  markus@jave.de   = -->
+<!-- =   Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard  markus@jave.de   = -->
 <!-- =     Further information: http://www.java2html.de     = -->
 <div align="left" class="java">
 <table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
@@ -18,35 +18,36 @@
   <!-- start source code -->
    <td nowrap="nowrap" valign="top" align="left">
     <code>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Analyzer&nbsp;analyzer&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">StandardAnalyzer</font><font color="#000000">()</font><font
color="#000000">;</font><br/>
-<font color="#ffffff"></font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Store&nbsp;the&nbsp;index&nbsp;in&nbsp;memory:</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Directory&nbsp;directory&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">RAMDirectory</font><font
color="#000000">()</font><font color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;To&nbsp;store&nbsp;an&nbsp;index&nbsp;on&nbsp;disk,&nbsp;use&nbsp;this&nbsp;instead&nbsp;(note&nbsp;that&nbsp;the&nbsp;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;parameter&nbsp;true&nbsp;will&nbsp;overwrite&nbsp;the&nbsp;index&nbsp;in&nbsp;that&nbsp;directory</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;if&nbsp;one&nbsp;exists):</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//Directory&nbsp;directory&nbsp;=&nbsp;FSDirectory.getDirectory(&#34;/tmp/testindex&#34;,&nbsp;true);</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">IndexWriter&nbsp;iwriter&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">IndexWriter</font><font
color="#000000">(</font><font color="#000000">directory,&nbsp;analyzer,&nbsp;</font><font
color="#7f0055"><b>true</b></font><font color="#000000">)</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">iwriter.setMaxFieldLength</font><font color="#000000">(</font><font
color="#990000">25000</font><font color="#000000">)</font><font color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Document&nbsp;doc&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">Document</font><font color="#000000">()</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">String&nbsp;text&nbsp;=&nbsp;</font><font color="#2a00ff">&#34;This&nbsp;is&nbsp;the&nbsp;text&nbsp;to&nbsp;be&nbsp;indexed.&#34;</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">doc.add</font><font color="#000000">(</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">Field</font><font
color="#000000">(</font><font color="#2a00ff">&#34;fieldname&#34;</font><font
color="#000000">,&nbsp;text,&nbsp;Field.Store.YES,</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Field.Index.TOKENIZED</font><font color="#000000">))</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">iwriter.addDocument</font><font color="#000000">(</font><font
color="#000000">doc</font><font color="#000000">)</font><font color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">iwriter.close</font><font color="#000000">()</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Now&nbsp;search&nbsp;the&nbsp;index:</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">IndexSearcher&nbsp;isearcher&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">IndexSearcher</font><font
color="#000000">(</font><font color="#000000">directory</font><font
color="#000000">)</font><font color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Parse&nbsp;a&nbsp;simple&nbsp;query&nbsp;that&nbsp;searches&nbsp;for&nbsp;&#34;text&#34;:</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Query&nbsp;query&nbsp;=&nbsp;QueryParser.parse</font><font
color="#000000">(</font><font color="#2a00ff">&#34;text&#34;</font><font
color="#000000">,&nbsp;</font><font color="#2a00ff">&#34;fieldname&#34;</font><font
color="#000000">,&nbsp;analyzer</font><font color="#000000">)</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Hits&nbsp;hits&nbsp;=&nbsp;isearcher.search</font><font
color="#000000">(</font><font color="#000000">query</font><font color="#000000">)</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">assertEquals</font><font color="#000000">(</font><font
color="#990000">1</font><font color="#000000">,&nbsp;hits.length</font><font
color="#000000">())</font><font color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Iterate&nbsp;through&nbsp;the&nbsp;results:</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font
color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;</font><font
color="#990000">0</font><font color="#000000">;&nbsp;i&nbsp;&lt;&nbsp;hits.length</font><font
color="#000000">()</font><font color="#000000">;&nbsp;i++</font><font
color="#000000">)&nbsp;{</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Document&nbsp;hitDoc&nbsp;=&nbsp;hits.doc</font><font
color="#000000">(</font><font color="#000000">i</font><font color="#000000">)</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">assertEquals</font><font color="#000000">(</font><font
color="#2a00ff">&#34;This&nbsp;is&nbsp;the&nbsp;text&nbsp;to&nbsp;be&nbsp;indexed.&#34;</font><font
color="#000000">,&nbsp;hitDoc.get</font><font color="#000000">(</font><font
color="#2a00ff">&#34;fieldname&#34;</font><font color="#000000">))</font><font
color="#000000">;</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br/>
-<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">isearcher.close</font><font color="#000000">()</font><font
color="#000000">;</font><br/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Analyzer&nbsp;analyzer&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">StandardAnalyzer</font><font color="#000000">()</font><font
color="#000000">;</font><br />
+<font color="#ffffff"></font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Store&nbsp;the&nbsp;index&nbsp;in&nbsp;memory:</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Directory&nbsp;directory&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">RAMDirectory</font><font
color="#000000">()</font><font color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;To&nbsp;store&nbsp;an&nbsp;index&nbsp;on&nbsp;disk,&nbsp;use&nbsp;this&nbsp;instead&nbsp;(note&nbsp;that&nbsp;the&nbsp;</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;parameter&nbsp;true&nbsp;will&nbsp;overwrite&nbsp;the&nbsp;index&nbsp;in&nbsp;that&nbsp;directory</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;if&nbsp;one&nbsp;exists):</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//Directory&nbsp;directory&nbsp;=&nbsp;FSDirectory.getDirectory(&#34;/tmp/testindex&#34;,&nbsp;true);</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">IndexWriter&nbsp;iwriter&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">IndexWriter</font><font
color="#000000">(</font><font color="#000000">directory,&nbsp;analyzer,&nbsp;</font><font
color="#7f0055"><b>true</b></font><font color="#000000">)</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">iwriter.setMaxFieldLength</font><font color="#000000">(</font><font
color="#990000">25000</font><font color="#000000">)</font><font color="#000000">;</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Document&nbsp;doc&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">Document</font><font color="#000000">()</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">String&nbsp;text&nbsp;=&nbsp;</font><font color="#2a00ff">&#34;This&nbsp;is&nbsp;the&nbsp;text&nbsp;to&nbsp;be&nbsp;indexed.&#34;</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">doc.add</font><font color="#000000">(</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">Field</font><font
color="#000000">(</font><font color="#2a00ff">&#34;fieldname&#34;</font><font
color="#000000">,&nbsp;text,&nbsp;Field.Store.YES,</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Field.Index.TOKENIZED</font><font color="#000000">))</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">iwriter.addDocument</font><font color="#000000">(</font><font
color="#000000">doc</font><font color="#000000">)</font><font color="#000000">;</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">iwriter.close</font><font color="#000000">()</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Now&nbsp;search&nbsp;the&nbsp;index:</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">IndexSearcher&nbsp;isearcher&nbsp;=&nbsp;</font><font
color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">IndexSearcher</font><font
color="#000000">(</font><font color="#000000">directory</font><font
color="#000000">)</font><font color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Parse&nbsp;a&nbsp;simple&nbsp;query&nbsp;that&nbsp;searches&nbsp;for&nbsp;&#34;text&#34;:</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">QueryParser&nbsp;parser&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font
color="#000000">QueryParser</font><font color="#000000">(</font><font
color="#2a00ff">&#34;fieldname&#34;</font><font color="#000000">,&nbsp;analyzer</font><font
color="#000000">)</font><font color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Query&nbsp;query&nbsp;=&nbsp;parser.parse</font><font
color="#000000">(</font><font color="#2a00ff">&#34;text&#34;</font><font
color="#000000">)</font><font color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Hits&nbsp;hits&nbsp;=&nbsp;isearcher.search</font><font
color="#000000">(</font><font color="#000000">query</font><font color="#000000">)</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">assertEquals</font><font color="#000000">(</font><font
color="#990000">1</font><font color="#000000">,&nbsp;hits.length</font><font
color="#000000">())</font><font color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#3f7f5f">//&nbsp;Iterate&nbsp;through&nbsp;the&nbsp;results:</font><br
/>
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font
color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;</font><font
color="#990000">0</font><font color="#000000">;&nbsp;i&nbsp;&lt;&nbsp;hits.length</font><font
color="#000000">()</font><font color="#000000">;&nbsp;i++</font><font
color="#000000">)&nbsp;{</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">Document&nbsp;hitDoc&nbsp;=&nbsp;hits.doc</font><font
color="#000000">(</font><font color="#000000">i</font><font color="#000000">)</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">assertEquals</font><font color="#000000">(</font><font
color="#2a00ff">&#34;This&nbsp;is&nbsp;the&nbsp;text&nbsp;to&nbsp;be&nbsp;indexed.&#34;</font><font
color="#000000">,&nbsp;hitDoc.get</font><font color="#000000">(</font><font
color="#2a00ff">&#34;fieldname&#34;</font><font color="#000000">))</font><font
color="#000000">;</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">}</font><br />
+<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">isearcher.close</font><font color="#000000">()</font><font
color="#000000">;</font><br />
 <font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#000000">directory.close</font><font color="#000000">()</font><font
color="#000000">;</font></code>
     
    </td>
@@ -57,6 +58,7 @@
 <!-- =       END of automatically generated HTML code       = -->
 <!-- ======================================================== -->
 
+
 <p>The Lucene API is divided into several packages:</p>
 
 <ul>
@@ -65,8 +67,8 @@
 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
+an enumeration of <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>
@@ -74,7 +76,7 @@
 <li>
 <b><a href="org/apache/lucene/document/package-summary.html">org.apache.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,
+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>
@@ -115,9 +117,9 @@
 To use Lucene, an application should:
 <ol>
 <li>
-Create <a href="org/apache/lucene/document/Document.html">Document</a>'s by
+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>
+<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>
@@ -171,7 +173,7 @@
 <br>&nbsp;&nbsp;&nbsp; [ Note: "+" and "-" are canonical, but "AND", "OR"
 and "NOT" may be used. ]</blockquote>
 
-The <a href="http://svn.apache.org/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java">IndexHtml</a>
demo is more sophisticated.&nbsp;
+The <a href="http://svn.apache.org/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/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.



Mime
View raw message