lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r534192 [12/19] - in /incubator/lucene.net/trunk/C#: ./ src/ src/Demo/ src/Demo/DeleteFiles/ src/Demo/DemoLib/ src/Demo/DemoLib/HTML/ src/Demo/IndexFiles/ src/Demo/IndexHtml/ src/Demo/SearchFiles/ src/Lucene.Net/ src/Lucene.Net/Analysis/ sr...
Date Tue, 01 May 2007 18:45:35 GMT
Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Overview.html
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Overview.html?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Overview.html (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Overview.html Tue May  1 11:45:26 2007
@@ -1,186 +1,188 @@
-<html>
-<head>
-   <title>Apache Lucene API</title>
-</head>
-<body>
-
-<p>Apache Lucene is a high-performance, full-featured text search engine library.
-Here's a simple example how to use Lucene for indexing and searching (using JUnit
-to check if the results are what we expect):</p>
-
-<!-- ======================================================== -->
-<!-- = Java Sourcecode to HTML automatically converted code = -->
-<!-- =   Java2Html Converter V4.1 2004 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">
-   <tr>
-  <!-- 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">directory.close</font><font color="#000000">()</font><font color="#000000">;</font></code>
-    
-   </td>
-  <!-- end source code -->
-   </tr>
-</table>
-</div>
-<!-- =       END of automatically generated HTML code       = -->
-<!-- ======================================================== -->
-
-<p>The Lucene API is divided into several packages:</p>
-
-<ul>
-<li>
-<b><a href = "org/apache/lucene/analysis/package-summary.html">org.apache.lucene.analysis</a></b>
-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//jsp/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
-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>
-
-<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,
-whose values may be strings or instances of <a href = "http://java.sun.com//jsp/products/jdk/1.2/docs/api/java/io/Reader.html">java.io.Reader</a>.</li>
-
-<li>
-<b><a href = "org/apache/lucene/index/package-summary.html">org.apache.lucene.index</a></b>
-provides two primary classes: <a href = "org/apache/lucene/index/IndexWriter.html">IndexWriter</a>,
-which creates and adds documents to indices; and <a href = "org/apache/lucene/index/IndexReader.html">IndexReader</a>,
-which accesses the data in the index.</li>
-
-<li>
-<b><a href = "org/apache/lucene/search/package-summary.html">org.apache.lucene.search</a></b>
-provides data structures to represent queries (<a href = "org/apache/lucene/search/TermQuery.html">TermQuery</a>
-for individual words, <a href = "org/apache/lucene/search/PhraseQuery.html">PhraseQuery</a>
-for phrases, and <a href = "org/apache/lucene/search/BooleanQuery.html">BooleanQuery</a>
-for boolean combinations of queries) and the abstract <a href = "org/apache/lucene/search/Searcher.html">Searcher</a>
-which turns queries into <a href = "org/apache/lucene/search/Hits.html">Hits</a>.
-<a href = "org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>
-implements search over a single IndexReader.</li>
-
-<li>
-<b><a href = "org/apache/lucene/queryParser/package-summary.html">org.apache.lucene.queryParser</a></b>
-uses <a href = "http://javacc.dev.java.net">JavaCC</a> to implement a
-<a href = "org/apache/lucene/queryParser/QueryParser.html">QueryParser</a>.</li>
-
-<li>
-<b><a href = "org/apache/lucene/store/package-summary.html">org.apache.lucene.store</a></b>
-defines an abstract class for storing persistent data, the <a href = "org/apache/lucene/store/Directory.html">Directory</a>,
-a collection of named files written by an <a href = "org/apache/lucene/store/IndexOutput.html">IndexOutput</a>
-and read by an <a href = "org/apache/lucene/store/IndexInput.html">IndexInput</a>.&nbsp;
-Two implementations are provided, <a href = "org/apache/lucene/store/FSDirectory.html">FSDirectory</a>,
-which uses a file system directory to store files, and <a href = "org/apache/lucene/store/RAMDirectory.html">RAMDirectory</a>
-which implements files as memory-resident data structures.</li>
-
-<li>
-<b><a href = "org/apache/lucene/util/package-summary.html">org.apache.lucene.util</a></b>
-contains a few handy data structures, e.g., <a href = "org/apache/lucene/util/BitVector.html">BitVector</a>
-and <a href = "org/apache/lucene/util/PriorityQueue.html">PriorityQueue</a>.</li>
-</ul>
-To use Lucene, an application should:
-<ol>
-<li>
-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>
-
-<li>
-Create an <a href = "org/apache/lucene/index/IndexWriter.html">IndexWriter</a>
-and add documents to it with <a href = "org/apache/lucene/index/IndexWriter.html#addDocument(org.apache.lucene.document.Document)">addDocument()</a>;</li>
-
-<li>
-Call <a href = "org/apache/lucene/queryParser/QueryParser.html#parse(java.lang.String)">QueryParser.parse()</a>
-to build a query from a string; and</li>
-
-<li>
-Create an <a href = "org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>
-and pass the query to its <a href = "org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query)">search()</a>
-method.</li>
-</ol>
-Some simple examples of code which does this are:
-<ul>
-<li>
-&nbsp;<a href = "http://svn.apache.org//jsp/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/FileDocument.java">FileDocument.java</a> contains
-code to create a Document for a file.</li>
-
-<li>
-&nbsp;<a href = "http://svn.apache.org//jsp/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexFiles.java">IndexFiles.java</a> creates an
-index for all the files contained in a directory.</li>
-
-<li>
-&nbsp;<a href = "http://svn.apache.org//jsp/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/DeleteFiles.java">DeleteFiles.java</a> deletes some
-of these files from the index.</li>
-
-<li>
-&nbsp;<a href = "http://svn.apache.org//jsp/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/SearchFiles.java">SearchFiles.java</a> prompts for
-queries and searches an index.</li>
-</ul>
-To demonstrate these, try something like:
-<blockquote><tt>> <b>java -cp lucene.jar:lucene-demo.jar org.apache.lucene.demo.IndexFiles rec.food.recipes/soups</b></tt>
-<br><tt>adding rec.food.recipes/soups/abalone-chowder</tt>
-<br><tt>&nbsp; </tt>[ ... ]
-
-<p><tt>> <b>java -cp lucene.jar:lucene-demo.jar org.apache.lucene.demo.SearchFiles</b></tt>
-<br><tt>Query: <b>chowder</b></tt>
-<br><tt>Searching for: chowder</tt>
-<br><tt>34 total matching documents</tt>
-<br><tt>1. rec.food.recipes/soups/spam-chowder</tt>
-<br><tt>&nbsp; </tt>[ ... thirty-four documents contain the word "chowder" ... ]
-
-<p><tt>Query: <b>"clam chowder" AND Manhattan</b></tt>
-<br><tt>Searching for: +"clam chowder" +manhattan</tt>
-<br><tt>2 total matching documents</tt>
-<br><tt>1. rec.food.recipes/soups/clam-chowder</tt>
-<br><tt>&nbsp; </tt>[ ... two documents contain the phrase "clam chowder"
-and the word "manhattan" ... ]
-<br>&nbsp;&nbsp;&nbsp; [ Note: "+" and "-" are canonical, but "AND", "OR"
-and "NOT" may be used. ]</blockquote>
-
-The <a href = "http://svn.apache.org//jsp/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.
-<blockquote><tt>> <b>java -cp lucene.jar:lucene-demo.jar org.apache.lucene.demo.IndexHTML -create java/jdk1.1.6/docs/relnotes</b></tt>
-<br><tt>adding java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt>
-<br><tt>&nbsp; </tt>[ ... create an index containing all the relnotes ]
-<p><tt>> <b>rm java/jdk1.1.6/docs/relnotes/smicopyright.html</b></tt>
-<p><tt>> <b>java -cp lucene.jar:lucene-demo.jar org.apache.lucene.demo.IndexHTML java/jdk1.1.6/docs/relnotes</b></tt>
-<br><tt>deleting java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt></blockquote>
-
-</body>
-</html>
+<html>
+<head>
+   <title>Apache Lucene API</title>
+</head>
+<body>
+
+<p>Apache Lucene is a high-performance, full-featured text search engine library.
+Here's a simple example how to use Lucene for indexing and searching (using JUnit
+to check if the results are what we expect):</p>
+
+<!-- ======================================================== -->
+<!-- = Java Sourcecode to HTML automatically converted code = -->
+<!-- =   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">
+   <tr>
+  <!-- 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">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>
+  <!-- end source code -->
+   </tr>
+</table>
+</div>
+<!-- =       END of automatically generated HTML code       = -->
+<!-- ======================================================== -->
+
+
+<p>The Lucene API is divided into several packages:</p>
+
+<ul>
+<li>
+<b><a href="org/apache/lucene/analysis/package-summary.html">Lucene.Net.Analysis</a></b>
+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 <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>
+
+<li>
+<b><a href="org/apache/lucene/document/package-summary.html">Lucene.Net.Documents</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,
+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>
+<b><a href="org/apache/lucene/index/package-summary.html">Lucene.Net.Index</a></b>
+provides two primary classes: <a href="org/apache/lucene/index/IndexWriter.html">IndexWriter</a>,
+which creates and adds documents to indices; and <a href="org/apache/lucene/index/IndexReader.html">IndexReader</a>,
+which accesses the data in the index.</li>
+
+<li>
+<b><a href="org/apache/lucene/search/package-summary.html">Lucene.Net.Search</a></b>
+provides data structures to represent queries (<a href="org/apache/lucene/search/TermQuery.html">TermQuery</a>
+for individual words, <a href="org/apache/lucene/search/PhraseQuery.html">PhraseQuery</a>
+for phrases, and <a href="org/apache/lucene/search/BooleanQuery.html">BooleanQuery</a>
+for boolean combinations of queries) and the abstract <a href="org/apache/lucene/search/Searcher.html">Searcher</a>
+which turns queries into <a href="org/apache/lucene/search/Hits.html">Hits</a>.
+<a href="org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>
+implements search over a single IndexReader.</li>
+
+<li>
+<b><a href="org/apache/lucene/queryParser/package-summary.html">Lucene.Net.QueryParsers</a></b>
+uses <a href="http://javacc.dev.java.net">JavaCC</a> to implement a
+<a href="org/apache/lucene/queryParser/QueryParser.html">QueryParser</a>.</li>
+
+<li>
+<b><a href="org/apache/lucene/store/package-summary.html">Lucene.Net.Store</a></b>
+defines an abstract class for storing persistent data, the <a href="org/apache/lucene/store/Directory.html">Directory</a>,
+a collection of named files written by an <a href="org/apache/lucene/store/IndexOutput.html">IndexOutput</a>
+and read by an <a href="org/apache/lucene/store/IndexInput.html">IndexInput</a>.&nbsp;
+Two implementations are provided, <a href="org/apache/lucene/store/FSDirectory.html">FSDirectory</a>,
+which uses a file system directory to store files, and <a href="org/apache/lucene/store/RAMDirectory.html">RAMDirectory</a>
+which implements files as memory-resident data structures.</li>
+
+<li>
+<b><a href="org/apache/lucene/util/package-summary.html">Lucene.Net.Util</a></b>
+contains a few handy data structures, e.g., <a href="org/apache/lucene/util/BitVector.html">BitVector</a>
+and <a href="org/apache/lucene/util/PriorityQueue.html">PriorityQueue</a>.</li>
+</ul>
+To use Lucene, an application should:
+<ol>
+<li>
+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>
+
+<li>
+Create an <a href="org/apache/lucene/index/IndexWriter.html">IndexWriter</a>
+and add documents to it with <a href="org/apache/lucene/index/IndexWriter.html#addDocument(Lucene.Net.Documents.Document)">addDocument()</a>;</li>
+
+<li>
+Call <a href="org/apache/lucene/queryParser/QueryParser.html#parse(java.lang.String)">QueryParser.parse()</a>
+to build a query from a string; and</li>
+
+<li>
+Create an <a href="org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>
+and pass the query to its <a href="org/apache/lucene/search/Searcher.html#search(Lucene.Net.Search.Query)">search()</a>
+method.</li>
+</ol>
+Some simple examples of code which does this are:
+<ul>
+<li>
+&nbsp;<a href="http://svn.apache.org/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/FileDocument.java">FileDocument.java</a> contains
+code to create a Document for a file.</li>
+
+<li>
+&nbsp;<a href="http://svn.apache.org/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexFiles.java">IndexFiles.java</a> creates an
+index for all the files contained in a directory.</li>
+
+<li>
+&nbsp;<a href="http://svn.apache.org/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/DeleteFiles.java">DeleteFiles.java</a> deletes some
+of these files from the index.</li>
+
+<li>
+&nbsp;<a href="http://svn.apache.org/repos/asf/lucene/java/trunk/src/demo/org/apache/lucene/demo/SearchFiles.java">SearchFiles.java</a> prompts for
+queries and searches an index.</li>
+</ul>
+To demonstrate these, try something like:
+<blockquote><tt>> <b>java -cp lucene.jar:lucene-demo.jar Lucene.Net.demo.IndexFiles rec.food.recipes/soups</b></tt>
+<br><tt>adding rec.food.recipes/soups/abalone-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... ]
+
+<p><tt>> <b>java -cp lucene.jar:lucene-demo.jar Lucene.Net.demo.SearchFiles</b></tt>
+<br><tt>Query: <b>chowder</b></tt>
+<br><tt>Searching for: chowder</tt>
+<br><tt>34 total matching documents</tt>
+<br><tt>1. rec.food.recipes/soups/spam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... thirty-four documents contain the word "chowder" ... ]
+
+<p><tt>Query: <b>"clam chowder" AND Manhattan</b></tt>
+<br><tt>Searching for: +"clam chowder" +manhattan</tt>
+<br><tt>2 total matching documents</tt>
+<br><tt>1. rec.food.recipes/soups/clam-chowder</tt>
+<br><tt>&nbsp; </tt>[ ... two documents contain the phrase "clam chowder"
+and the word "manhattan" ... ]
+<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;
+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.
+<blockquote><tt>> <b>java -cp lucene.jar:lucene-demo.jar Lucene.Net.demo.IndexHTML -create java/jdk1.1.6/docs/relnotes</b></tt>
+<br><tt>adding java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt>
+<br><tt>&nbsp; </tt>[ ... create an index containing all the relnotes ]
+<p><tt>> <b>rm java/jdk1.1.6/docs/relnotes/smicopyright.html</b></tt>
+<p><tt>> <b>java -cp lucene.jar:lucene-demo.jar Lucene.Net.demo.IndexHTML java/jdk1.1.6/docs/relnotes</b></tt>
+<br><tt>deleting java/jdk1.1.6/docs/relnotes/SMICopyright.html</tt></blockquote>
+
+</body>
+</html>

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Package.html
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Package.html?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Package.html (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Package.html Tue May  1 11:45:26 2007
@@ -1 +1 @@
-<html><body>Top-level package.</body></html>
+<html><body>Top-level package.</body></html>

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/CharStream.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/QueryParser/CharStream.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/CharStream.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/CharStream.cs Tue May  1 11:45:26 2007
@@ -44,7 +44,21 @@
 		/// implementing this interface.  Can throw any java.io.IOException.
 		/// </summary>
 		char ReadChar();
-  		
+		
+		/// <summary> Returns the column position of the character last read.</summary>
+		/// <deprecated> 
+		/// </deprecated>
+		/// <seealso cref="#getEndColumn">
+		/// </seealso>
+		int GetColumn();
+		
+		/// <summary> Returns the line number of the character last read.</summary>
+		/// <deprecated> 
+		/// </deprecated>
+		/// <seealso cref="#getEndLine">
+		/// </seealso>
+		int GetLine();
+		
 		/// <summary> Returns the column number of the last character for current token (being
 		/// matched after the last call to BeginTOken).
 		/// </summary>

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/FastCharStream.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/QueryParser/FastCharStream.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/FastCharStream.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/FastCharStream.cs Tue May  1 11:45:26 2007
@@ -23,7 +23,7 @@
 	/// <summary>An efficient implementation of JavaCC's CharStream interface.  <p>Note that
 	/// this does not do line-number counting, but instead keeps track of the
 	/// character position of the token in the input, as required by Lucene's {@link
-	/// Lucene.Net.analysis.Token} API. 
+	/// Lucene.Net.Analysis.Token} API. 
 	/// </summary>
 	public sealed class FastCharStream : CharStream
 	{
@@ -80,17 +80,17 @@
 			bufferPosition = newPosition;
 			bufferStart += tokenStart;
 			tokenStart = 0;
-			
-			int charsRead = 0;
-            
-            try
-            {
-                charsRead = input.Read(buffer, newPosition, buffer.Length - newPosition);
-            }
-            catch
-            {
-            }
 
+			int charsRead = 0;
+			
+			try
+			{
+				charsRead = input.Read(buffer, newPosition, buffer.Length - newPosition);
+			}
+			catch
+			{
+			}
+			
 			if (charsRead <= 0)
 				throw new System.IO.IOException("read past eof");
 			else

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/MultiFieldQueryParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/QueryParser/MultiFieldQueryParser.cs?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/MultiFieldQueryParser.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/MultiFieldQueryParser.cs Tue May  1 11:45:26 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using Analyzer = Lucene.Net.Analysis.Analyzer;
 using BooleanClause = Lucene.Net.Search.BooleanClause;
 using BooleanQuery = Lucene.Net.Search.BooleanQuery;
@@ -31,12 +32,44 @@
 	/// </summary>
 	/// <author>  <a href="mailto:kelvin@relevanz.com">Kelvin Tan</a>, Daniel Naber
 	/// </author>
-	/// <version>  $Revision: 295117 $
+	/// <version>  $Revision: 472959 $
 	/// </version>
 	public class MultiFieldQueryParser : QueryParser
 	{
 		
 		private System.String[] fields;
+		private System.Collections.IDictionary boosts;
+		
+		/// <summary> Creates a MultiFieldQueryParser. 
+		/// Allows passing of a map with term to Boost, and the boost to apply to each term.
+		/// 
+		/// <p>It will, when parse(String query)
+		/// is called, construct a query like this (assuming the query consists of
+		/// two terms and you specify the two fields <code>title</code> and <code>body</code>):</p>
+		/// 
+		/// <code>
+		/// (title:term1 body:term1) (title:term2 body:term2)
+		/// </code>
+		/// 
+		/// <p>When setDefaultOperator(AND_OPERATOR) is set, the result will be:</p>
+		/// 
+		/// <code>
+		/// +(title:term1 body:term1) +(title:term2 body:term2)
+		/// </code>
+		/// 
+		/// <p>When you pass a boost (title=>5 body=>10) you can get </p>
+		/// 
+		/// <code>
+		/// +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0)
+		/// </code>
+		/// 
+		/// <p>In other words, all the query's terms must appear, but it doesn't matter in
+		/// what fields they appear.</p>
+		/// </summary>
+		public MultiFieldQueryParser(System.String[] fields, Analyzer analyzer, System.Collections.IDictionary boosts):this(fields, analyzer)
+		{
+			this.boosts = boosts;
+		}
 		
 		/// <summary> Creates a MultiFieldQueryParser.
 		/// 
@@ -57,7 +90,7 @@
 		/// <p>In other words, all the query's terms must appear, but it doesn't matter in
 		/// what fields they appear.</p>
 		/// </summary>
-		public MultiFieldQueryParser(System.String[] fields, Analyzer analyzer) : base(null, analyzer)
+		public MultiFieldQueryParser(System.String[] fields, Analyzer analyzer):base(null, analyzer)
 		{
 			this.fields = fields;
 		}
@@ -72,6 +105,17 @@
 					Query q = base.GetFieldQuery(fields[i], queryText);
 					if (q != null)
 					{
+						//If the user passes a map of boosts
+						if (boosts != null)
+						{
+							//Get the boost from the map and apply them
+							System.Single boost = (System.Single) boosts[fields[i]];
+							//if (boost != null)      // {{Aroush-2.1 there is no null for 'boost'
+                            if (boosts[fields[i]] != null)      // {{Aroush-2.1 will this line do?
+							{
+								q.SetBoost((float) boost);
+							}
+						}
 						if (q is PhraseQuery)
 						{
 							((PhraseQuery) q).SetSlop(slop);
@@ -141,7 +185,7 @@
 		}
 		
 		
-        protected internal override Query GetRangeQuery(System.String field, System.String part1, System.String part2, bool inclusive)
+		protected internal override Query GetRangeQuery(System.String field, System.String part1, System.String part2, bool inclusive)
 		{
 			if (field == null)
 			{
@@ -158,7 +202,7 @@
 		
 		
 		
-        /// <summary> Parses a query which searches on the fields specified.
+		/// <summary> Parses a query which searches on the fields specified.
 		/// <p>
 		/// If x fields are specified, this effectively constructs:
 		/// <pre>
@@ -241,7 +285,7 @@
 		}
 		
 		
-        /// <summary> Parses a query, searching on the fields specified.
+		/// <summary> Parses a query, searching on the fields specified.
 		/// Use this if you need to specify certain fields as required,
 		/// and others as prohibited.
 		/// <p><pre>

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/Package.html
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/QueryParser/Package.html?view=diff&rev=534192&r1=534191&r2=534192
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/Package.html (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/Package.html Tue May  1 11:45:26 2007
@@ -1,15 +1,15 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-   <meta name="Author" content="Doug Cutting">
-</head>
-<body>
-A simple query parser implemented with JavaCC.
-<p>Note that JavaCC defines lots of public classes, methods and fields
-that do not need to be public.&nbsp; These clutter the documentation.&nbsp;
-Sorry.
-<p>Note that because JavaCC defines a class named <tt>Token</tt>, <tt>org.apache.lucene.analysis.Token</tt>
-must always be fully qualified in source code in this package.
-</body>
-</html>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+   <meta name="Author" content="Doug Cutting">
+</head>
+<body>
+A simple query parser implemented with JavaCC.
+<p>Note that JavaCC defines lots of public classes, methods and fields
+that do not need to be public.&nbsp; These clutter the documentation.&nbsp;
+Sorry.
+<p>Note that because JavaCC defines a class named <tt>Token</tt>, <tt>Lucene.Net.Analysis.Token</tt>
+must always be fully qualified in source code in this package.
+</body>
+</html>



Mime
View raw message