LUCENE-3732: fix broken links and outdated stuff for overview.html

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1328736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-04-21 20:51:20 +00:00
parent eb1c6d2fc7
commit 921ba028cc
4 changed files with 62 additions and 72 deletions

View File

@ -1274,6 +1274,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
<attribute name="destdir"/> <attribute name="destdir"/>
<attribute name="title" default="${Name} ${version} API"/> <attribute name="title" default="${Name} ${version} API"/>
<attribute name="overview" default="${src.dir}/overview.html"/> <attribute name="overview" default="${src.dir}/overview.html"/>
<attribute name="linksource" default="no"/>
<sequential> <sequential>
<antcall target="download-java6-javadoc-packagelist"/> <antcall target="download-java6-javadoc-packagelist"/>
<delete file="@{destdir}/stylesheet.css" failonerror="false"/> <delete file="@{destdir}/stylesheet.css" failonerror="false"/>
@ -1291,6 +1292,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
noindex="true" noindex="true"
author="true" author="true"
version="true" version="true"
linksource="@{linksource}"
use="true" use="true"
failonerror="true" failonerror="true"
source="${ant.java.version}" source="${ant.java.version}"

View File

@ -15,22 +15,6 @@
limitations under the License. limitations under the License.
--> -->
<html> <html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head> <head>
<title>Apache Lucene API</title> <title>Apache Lucene API</title>
</head> </head>
@ -52,19 +36,19 @@ to check if the results are what we expect):</p>
Directory directory = new RAMDirectory(); Directory directory = new RAMDirectory();
// To store an index on disk, use this instead: // To store an index on disk, use this instead:
//Directory directory = FSDirectory.open("/tmp/testindex"); //Directory directory = FSDirectory.open("/tmp/testindex");
IndexWriter iwriter = new IndexWriter(directory, analyzer, true, IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_CURRENT, analyzer);
new IndexWriter.MaxFieldLength(25000)); IndexWriter iwriter = new IndexWriter(directory, config);
Document doc = new Document(); Document doc = new Document();
String text = "This is the text to be indexed."; String text = "This is the text to be indexed.";
doc.add(new Field("fieldname", TextField.TYPE_STORED, text)); doc.add(new Field("fieldname", text, TextField.TYPE_STORED));
iwriter.addDocument(doc); iwriter.addDocument(doc);
iwriter.close(); iwriter.close();
// Now search the index: // Now search the index:
DirectoryReader ireader = DirectoryReader.open(directory); // read-only=true DirectoryReader ireader = DirectoryReader.open(directory);
IndexSearcher isearcher = new IndexSearcher(ireader); IndexSearcher isearcher = new IndexSearcher(ireader);
// Parse a simple query that searches for "text": // Parse a simple query that searches for "text":
QueryParser parser = new QueryParser("fieldname", analyzer); QueryParser parser = new QueryParser(Version.LUCENE_CURRENT, "fieldname", analyzer);
Query query = parser.parse("text"); Query query = parser.parse("text");
ScoreDoc[] hits = isearcher.search(query, null, 1000).scoreDocs; ScoreDoc[] hits = isearcher.search(query, null, 1000).scoreDocs;
assertEquals(1, hits.length); assertEquals(1, hits.length);
@ -73,7 +57,6 @@ to check if the results are what we expect):</p>
Document hitDoc = isearcher.doc(hits[i].doc); Document hitDoc = isearcher.doc(hits[i].doc);
assertEquals("This is the text to be indexed.", hitDoc.get("fieldname")); assertEquals("This is the text to be indexed.", hitDoc.get("fieldname"));
} }
isearcher.close();
ireader.close(); ireader.close();
directory.close();</pre> directory.close();</pre>
<!-- = END of automatically generated HTML code = --> <!-- = END of automatically generated HTML code = -->
@ -85,86 +68,87 @@ to check if the results are what we expect):</p>
<ul> <ul>
<li> <li>
<b><a href="org/apache/lucene/analysis/package-summary.html">org.apache.lucene.analysis</a></b> <b>{@link org.apache.lucene.analysis}</b>
defines an abstract <a href="org/apache/lucene/analysis/Analyzer.html">Analyzer</a> defines an abstract {@link org.apache.lucene.analysis.Analyzer Analyzer}
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> API for converting text from a {@link java.io.Reader}
into a <a href="org/apache/lucene/analysis/TokenStream.html">TokenStream</a>, into a {@link org.apache.lucene.analysis.TokenStream TokenStream},
an enumeration of token <a href="org/apache/lucene/util/Attribute.html">Attribute</a>s.&nbsp; an enumeration of token {@link org.apache.lucene.util.Attribute Attribute}s.&nbsp;
A TokenStream can be composed by applying <a href="org/apache/lucene/analysis/TokenFilter.html">TokenFilter</a>s A TokenStream can be composed by applying {@link org.apache.lucene.analysis.TokenFilter TokenFilter}s
to the output of a <a href="org/apache/lucene/analysis/Tokenizer.html">Tokenizer</a>.&nbsp; to the output of a {@link org.apache.lucene.analysis.Tokenizer Tokenizer}.&nbsp;
Tokenizers and TokenFilters are strung together and applied with an <a href="org/apache/lucene/analysis/Analyzer.html">Analyzer</a>.&nbsp; Tokenizers and TokenFilters are strung together and applied with an {@link org.apache.lucene.analysis.Analyzer Analyzer}.&nbsp;
A handful of Analyzer implementations are provided, including <a href="org/apache/lucene/analysis/StopAnalyzer.html">StopAnalyzer</a> <a href="../analyzers-common/overview-summary.html">analyzers-common</a> provides a number of Analyzer implementations, including
and the grammar-based <a href="org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>.</li> <a href="../analyzers-common/org/apache/lucene/analysis/core/StopAnalyzer.html">StopAnalyzer</a>
and the grammar-based <a href="../analyzers-common/org/apache/lucene/analysis/standard/StandardAnalyzer.html">StandardAnalyzer</a>.</li>
<li> <li>
<b><a href="org/apache/lucene/document/package-summary.html">org.apache.lucene.document</a></b> <b>{@link org.apache.lucene.codecs}</b>
provides a simple <a href="org/apache/lucene/document/Document.html">Document</a> provides an abstraction over the encoding and decoding of the inverted index structure,
class.&nbsp; A Document is simply a set of named <a href="org/apache/lucene/document/Field.html">Field</a>s, as well as different implementations that can be chosen depending upon application needs.
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> <li>
<b><a href="org/apache/lucene/index/package-summary.html">org.apache.lucene.index</a></b> <b>{@link org.apache.lucene.document}</b>
provides two primary classes: <a href="org/apache/lucene/index/IndexWriter.html">IndexWriter</a>, provides a simple {@link org.apache.lucene.document.Document Document}
which creates and adds documents to indices; and <a href="org/apache/lucene/index/IndexReader.html">IndexReader</a>, class.&nbsp; A Document is simply a set of named {@link org.apache.lucene.document.Field Field}s,
whose values may be strings or instances of {@link java.io.Reader}.</li>
<li>
<b>{@link org.apache.lucene.index}</b>
provides two primary classes: {@link org.apache.lucene.index.IndexWriter IndexWriter},
which creates and adds documents to indices; and {@link org.apache.lucene.index.IndexReader},
which accesses the data in the index.</li> which accesses the data in the index.</li>
<li> <li>
<b><a href="org/apache/lucene/search/package-summary.html">org.apache.lucene.search</a></b> <b>{@link org.apache.lucene.search}</b>
provides data structures to represent queries (ie <a href="org/apache/lucene/search/TermQuery.html">TermQuery</a> provides data structures to represent queries (ie {@link org.apache.lucene.search.TermQuery TermQuery}
for individual words, <a href="org/apache/lucene/search/PhraseQuery.html">PhraseQuery</a> for individual words, {@link org.apache.lucene.search.PhraseQuery PhraseQuery}
for phrases, and <a href="org/apache/lucene/search/BooleanQuery.html">BooleanQuery</a> for phrases, and {@link org.apache.lucene.search.BooleanQuery BooleanQuery}
for boolean combinations of queries) and the abstract <a href="org/apache/lucene/search/Searcher.html">Searcher</a> for boolean combinations of queries) and the {@link org.apache.lucene.search.IndexSearcher IndexSearcher}
which turns queries into <a href="org/apache/lucene/search/TopDocs.html">TopDocs</a>. which turns queries into {@link org.apache.lucene.search.TopDocs TopDocs}.
<a href="org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> A number of <a href="../queryparser/overview-summary.html">QueryParser</a>s are provided for producing
implements search over a single IndexReader.</li> query structures from strings or xml.
<li> <li>
<b><a href="org/apache/lucene/queryParser/package-summary.html">org.apache.lucene.queryParser</a></b> <b>{@link org.apache.lucene.store}</b>
uses <a href="http://javacc.dev.java.net">JavaCC</a> to implement a defines an abstract class for storing persistent data, the {@link org.apache.lucene.store.Directory Directory},
<a href="org/apache/lucene/queryParser/QueryParser.html">QueryParser</a>.</li> which is a collection of named files written by an {@link org.apache.lucene.store.IndexOutput IndexOutput}
and read by an {@link org.apache.lucene.store.IndexInput IndexInput}.&nbsp;
<li> Multiple implementations are provided, including {@link org.apache.lucene.store.FSDirectory FSDirectory},
<b><a href="org/apache/lucene/store/package-summary.html">org.apache.lucene.store</a></b> which uses a file system directory to store files, and {@link org.apache.lucene.store.RAMDirectory RAMDirectory}
defines an abstract class for storing persistent data, the <a href="org/apache/lucene/store/Directory.html">Directory</a>,
which is 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;
Multiple implementations are provided, including <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> which implements files as memory-resident data structures.</li>
<li> <li>
<b><a href="org/apache/lucene/util/package-summary.html">org.apache.lucene.util</a></b> <b>{@link org.apache.lucene.util}</b>
contains a few handy data structures and util classes, ie <a href="org/apache/lucene/util/BitVector.html">BitVector</a> contains a few handy data structures and util classes, ie {@link org.apache.lucene.util.OpenBitSet OpenBitSet}
and <a href="org/apache/lucene/util/PriorityQueue.html">PriorityQueue</a>.</li> and {@link org.apache.lucene.util.PriorityQueue PriorityQueue}.</li>
</ul> </ul>
To use Lucene, an application should: To use Lucene, an application should:
<ol> <ol>
<li> <li>
Create <a href="org/apache/lucene/document/Document.html">Document</a>s by Create {@link org.apache.lucene.document.Document Document}s by
adding adding
<a href="org/apache/lucene/document/Field.html">Field</a>s;</li> {@link org.apache.lucene.document.Field Field}s;</li>
<li> <li>
Create an <a href="org/apache/lucene/index/IndexWriter.html">IndexWriter</a> Create an {@link org.apache.lucene.index.IndexWriter IndexWriter}
and add documents to it with <a href="org/apache/lucene/index/IndexWriter.html#addDocument(org.apache.lucene.document.Document)">addDocument()</a>;</li> and add documents to it with {@link org.apache.lucene.index.IndexWriter#addDocument(Iterable) addDocument()};</li>
<li> <li>
Call <a href="org/apache/lucene/queryParser/QueryParser.html#parse(java.lang.String)">QueryParser.parse()</a> Call <a href="../queryparser/org/apache/lucene/queryparser/classic/QueryParserBase.html#parse(java.lang.String)">QueryParser.parse()</a>
to build a query from a string; and</li> to build a query from a string; and</li>
<li> <li>
Create an <a href="org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a> Create an {@link org.apache.lucene.search.IndexSearcher IndexSearcher}
and pass the query to its <a href="org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query)">search()</a> and pass the query to its {@link org.apache.lucene.search.IndexSearcher#search(org.apache.lucene.search.Query, int) search()}
method.</li> method.</li>
</ol> </ol>
Some simple examples of code which does this are: Some simple examples of code which does this are:
<ul> <ul>
<li> <li>
&nbsp;<a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/demo/src/java/org/apache/lucene/demo/IndexFiles.java">IndexFiles.java</a> creates an &nbsp;<a href="../demo/src-html/org/apache/lucene/demo/IndexFiles.html">IndexFiles.java</a> creates an
index for all the files contained in a directory.</li> index for all the files contained in a directory.</li>
<li> <li>
&nbsp;<a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/demo/src/java/org/apache/lucene/demo/SearchFiles.java">SearchFiles.java</a> prompts for &nbsp;<a href="../demo/src-html/org/apache/lucene/demo/SearchFiles.html">SearchFiles.java</a> prompts for
queries and searches an index.</li> queries and searches an index.</li>
</ul> </ul>
To demonstrate these, try something like: To demonstrate these, try something like:

View File

@ -37,7 +37,8 @@
</path> </path>
<target name="javadocs" depends="javadocs-analyzers-common,javadocs-queryparser,compile-core"> <target name="javadocs" depends="javadocs-analyzers-common,javadocs-queryparser,compile-core">
<invoke-module-javadoc> <!-- we link the example source in the javadocs, as its ref'ed elsewhere -->
<invoke-module-javadoc linksource="yes">
<links> <links>
<link href="../analyzers-common"/> <link href="../analyzers-common"/>
<link href="../queryparser"/> <link href="../queryparser"/>

View File

@ -71,11 +71,14 @@
<macrodef name="invoke-module-javadoc"> <macrodef name="invoke-module-javadoc">
<!-- additional links for dependencies to other modules --> <!-- additional links for dependencies to other modules -->
<element name="links" optional="yes"/> <element name="links" optional="yes"/>
<!-- link source (don't do this unless its example code) -->
<attribute name="linksource" default="no"/>
<sequential> <sequential>
<mkdir dir="${javadoc.dir}/${name}"/> <mkdir dir="${javadoc.dir}/${name}"/>
<invoke-javadoc <invoke-javadoc
destdir="${javadoc.dir}/${name}" destdir="${javadoc.dir}/${name}"
title="${Name} ${version} ${name} API"> title="${Name} ${version} ${name} API"
linksource="@{linksource}">
<sources> <sources>
<link href="../core/"/> <link href="../core/"/>
<links/> <links/>