lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search Hits.java IndexSearcher.java MultiSearcher.java Searchable.java Sort.java
Date Thu, 25 Mar 2004 18:47:15 GMT
cutting     2004/03/25 10:47:15

  Modified:    src/java/org/apache/lucene/analysis
                        PerFieldAnalyzerWrapper.java StopFilter.java
               src/java/org/apache/lucene/document Document.java
               src/java/org/apache/lucene/index IndexWriter.java
               src/java/org/apache/lucene/search Hits.java
                        IndexSearcher.java MultiSearcher.java
                        Searchable.java Sort.java
  Log:
  javadoc cleanups and enhancements
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
  
  Index: PerFieldAnalyzerWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PerFieldAnalyzerWrapper.java	12 Feb 2004 18:38:50 -0000	1.2
  +++ PerFieldAnalyzerWrapper.java	25 Mar 2004 18:47:15 -0000	1.3
  @@ -62,7 +62,7 @@
    * This analyzer is used to facilitate scenarios where different
    * fields require different analysis techniques.  Use {@link #addAnalyzer}
    * to add a non-default analyzer on a field name basis.
  - * See {@link TestPerFieldAnalyzerWrapper} for example usage.
  + * See TestPerFieldAnalyzerWrapper.java for example usage.
    */
   public class PerFieldAnalyzerWrapper extends Analyzer {
     private Analyzer defaultAnalyzer;
  
  
  
  1.11      +2 -2      jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java
  
  Index: StopFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StopFilter.java	12 Mar 2004 09:43:48 -0000	1.10
  +++ StopFilter.java	25 Mar 2004 18:47:15 -0000	1.11
  @@ -80,7 +80,7 @@
      * Constructs a filter which removes words from the input
      * TokenStream that are named in the Hashtable.
      *
  -   * @deprecated Use {@link #StopFilter(TokenStream, Set)} StopFilter(TokenStream,Map)}
instead
  +   * @deprecated Use {@link #StopFilter(TokenStream, Set)} instead
      */
     public StopFilter(TokenStream in, Hashtable stopTable) {
       super(in);
  @@ -106,7 +106,7 @@
      * This permits this table construction to be cached once when
      * an Analyzer is constructed.
      *
  -   * @deprecated Use {@link #makeStopSet(String[] makeStopSet) instead.
  +   * @deprecated Use {@link #makeStopSet(String[])} instead.
      */
     public static final Hashtable makeStopTable(String[] stopWords) {
       Hashtable stopTable = new Hashtable(stopWords.length);
  
  
  
  1.15      +17 -9     jakarta-lucene/src/java/org/apache/lucene/document/Document.java
  
  Index: Document.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/document/Document.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Document.java	1 Mar 2004 17:32:50 -0000	1.14
  +++ Document.java	25 Mar 2004 18:47:15 -0000	1.15
  @@ -59,15 +59,22 @@
   import java.util.ArrayList;
   import java.util.Vector;
   import org.apache.lucene.index.IndexReader;       // for javadoc
  +import org.apache.lucene.search.Searcher;         // for javadoc
   import org.apache.lucene.search.Hits;             // for javadoc
   
   /** Documents are the unit of indexing and search.
    *
    * A Document is a set of fields.  Each field has a name and a textual value.
  - * A field may be stored with the document, in which case it is returned with
  - * search hits on the document.  Thus each document should typically contain
  - * stored fields which uniquely identify it.
  - * */
  + * A field may be {@link Field#isStored() stored} with the document, in which
  + * case it is returned with search hits on the document.  Thus each document
  + * should typically contain one or more stored fields which uniquely identify
  + * it.
  + *
  + * <p>Note that fields which are <i>not</i> {@link Field#isStored() stored}
are
  + * <i>not</i> available in documents retrieved from the index, e.g. with {@link
  + * Hits#doc(int)}, {@link Searcher#doc(int)} or {@link
  + * IndexReader#document(int)}.
  + */
   
   public final class Document implements java.io.Serializable {
     List fields = new Vector();
  @@ -113,8 +120,9 @@
     }
   
     /** Returns a field with the given name if any exist in this document, or
  -    null.  If multiple fields exists with this name, this method returns the
  -    last field value added. */
  +   * null.  If multiple fields exists with this name, this method returns the
  +   * first value added.
  +   */
     public final Field getField(String name) {
       for (int i = 0; i < fields.size(); i++) {
         Field field = (Field)fields.get(i);
  @@ -125,8 +133,9 @@
     }
   
     /** Returns the string value of the field with the given name if any exist in
  -    this document, or null.  If multiple fields exist with this name, this
  -    method returns the last value added. */
  +   * this document, or null.  If multiple fields exist with this name, this
  +   * method returns the first value added.
  +   */
     public final String get(String name) {
       Field field = getField(name);
       if (field != null)
  @@ -165,7 +174,6 @@
     /**
      * Returns an array of values of the field specified as the method parameter.
      * This method can return <code>null</code>.
  -   * UnStored fields' values cannot be returned by this method.
      *
      * @param name the name of the field
      * @return a <code>String[]</code> of field values
  
  
  
  1.27      +4 -4      jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java
  
  Index: IndexWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- IndexWriter.java	24 Mar 2004 18:10:59 -0000	1.26
  +++ IndexWriter.java	25 Mar 2004 18:47:15 -0000	1.27
  @@ -163,7 +163,7 @@
      * @param create <code>true</code> to create the index or overwrite
      *  the existing one; <code>false</code> to append to the existing
      *  index
  -   * @param IOException if the directory cannot be read/written to, or
  +   * @throws IOException if the directory cannot be read/written to, or
      *  if it does not exist, and <code>create</code> is
      *  <code>false</code>
      */
  @@ -183,7 +183,7 @@
      * @param create <code>true</code> to create the index or overwrite
      *  the existing one; <code>false</code> to append to the existing
      *  index
  -   * @param IOException if the directory cannot be read/written to, or
  +   * @throws IOException if the directory cannot be read/written to, or
      *  if it does not exist, and <code>create</code> is
      *  <code>false</code>
      */
  @@ -198,12 +198,12 @@
      * is true, then a new, empty index will be created in
      * <code>d</code>, replacing the index already there, if any.
      *
  -   * @param path the path to the index directory
  +   * @param d the index directory
      * @param a the analyzer to use
      * @param create <code>true</code> to create the index or overwrite
      *  the existing one; <code>false</code> to append to the existing
      *  index
  -   * @param IOException if the directory cannot be read/written to, or
  +   * @throws IOException if the directory cannot be read/written to, or
      *  if it does not exist, and <code>create</code> is
      *  <code>false</code>
      */
  
  
  
  1.11      +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/Hits.java
  
  Index: Hits.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Hits.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Hits.java	27 Feb 2004 12:29:31 -0000	1.10
  +++ Hits.java	25 Mar 2004 18:47:15 -0000	1.11
  @@ -120,7 +120,7 @@
       return length;
     }
   
  -  /** Returns the nth document in this set.
  +  /** Returns the stored fields of the n<sup>th</sup> document in this set.
      <p>Documents are cached, so that repeated requests for the same element may
      return the same Document object. */
     public final Document doc(int n) throws IOException {
  
  
  
  1.15      +7 -45     jakarta-lucene/src/java/org/apache/lucene/search/IndexSearcher.java
  
  Index: IndexSearcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/IndexSearcher.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- IndexSearcher.java	27 Feb 2004 12:29:31 -0000	1.14
  +++ IndexSearcher.java	25 Mar 2004 18:47:15 -0000	1.15
  @@ -86,44 +86,27 @@
       reader = r;
     }
   
  -  /**
  -   * Frees resources associated with this Searcher.
  -   * Be careful not to call this method while you are still using objects
  -   * like {@link Hits}.
  -   */
  +  // inherit javadoc
     public void close() throws IOException {
       reader.close();
     }
   
  -  /** Expert: Returns the number of documents containing <code>term</code>.
  -   * Called by search code to compute term weights.
  -   * @see IndexReader#docFreq(Term).
  -   */
  +  // inherit javadoc
     public int docFreq(Term term) throws IOException {
       return reader.docFreq(term);
     }
   
  -  /** For use by {@link HitCollector} implementations. */
  +  // inherit javadoc
     public Document doc(int i) throws IOException {
       return reader.document(i);
     }
   
  -  /** Expert: Returns one greater than the largest possible document number.
  -   * Called by search code to compute term weights.
  -   * @see IndexReader#maxDoc().
  -   */
  +  // inherit javadoc
     public int maxDoc() throws IOException {
       return reader.maxDoc();
     }
   
  -  /** Expert: Low-level search implementation.  Finds the top <code>n</code>
  -   * hits for <code>query</code>, applying <code>filter</code>
if non-null.
  -   *
  -   * <p>Called by {@link Hits}.
  -   *
  -   * <p>Applications should usually call {@link #search(Query)} or {@link
  -   * #search(Query,Filter)} instead.
  -   */
  +  // inherit javadoc
     public TopDocs search(Query query, Filter filter, final int nDocs)
          throws IOException {
       Scorer scorer = query.weight(this).scorer(reader);
  @@ -150,15 +133,7 @@
       return new TopDocs(totalHits[0], scoreDocs);
     }
   
  -  /** Expert: Low-level search implementation.  Finds the top <code>n</code>
  -   * hits for <code>query</code>, applying <code>filter</code>
if non-null.
  -   * Results are ordered as specified by <code>sort</code>.
  -   *
  -   * <p>Called by {@link Hits}.
  -   *
  -   * <p>Applications should usually call {@link #search(Query)} or {@link
  -   * #search(Query,Filter)} instead.
  -   */
  +  // inherit javadoc
     public TopFieldDocs search(Query query, Filter filter, final int nDocs,
                                Sort sort)
       throws IOException {
  @@ -188,20 +163,7 @@
     }
   
   
  -  /** Lower-level search API.
  -   *
  -   * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
  -   * scoring document.
  -   *
  -   * <p>Applications should only use this if they need <i>all</i> of
the
  -   * matching documents.  The high-level search API ({@link
  -   * Searcher#search(Query)}) is usually more efficient, as it skips
  -   * non-high-scoring hits.
  -   *
  -   * @param query to match documents
  -   * @param filter if non-null, a bitset used to eliminate some documents
  -   * @param results to receive hits
  -   */
  +  // inherit javadoc
     public void search(Query query, Filter filter,
                        final HitCollector results) throws IOException {
       HitCollector collector = results;
  
  
  
  1.16      +3 -16     jakarta-lucene/src/java/org/apache/lucene/search/MultiSearcher.java
  
  Index: MultiSearcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/MultiSearcher.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MultiSearcher.java	27 Feb 2004 12:29:31 -0000	1.15
  +++ MultiSearcher.java	25 Mar 2004 18:47:15 -0000	1.16
  @@ -85,7 +85,7 @@
     	return starts;
     }
   
  -  /** Frees resources associated with this <code>Searcher</code>. */
  +  // inherit javadoc
     public void close() throws IOException {
       for (int i = 0; i < searchables.length; i++)
         searchables[i].close();
  @@ -98,7 +98,7 @@
       return docFreq;
     }
   
  -  /** For use by {@link HitCollector} implementations. */
  +  // inherit javadoc
     public Document doc(int n) throws IOException {
       int i = subSearcher(n);			  // find searcher index
       return searchables[i].doc(n - starts[i]);	  // dispatch to searcher
  @@ -196,20 +196,7 @@
     }
   
   
  -  /** Lower-level search API.
  -   *
  -   * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
  -   * scoring document.
  -   *
  -   * <p>Applications should only use this if they need <i>all</i> of
the
  -   * matching documents.  The high-level search API ({@link
  -   * Searcher#search(Query)}) is usually more efficient, as it skips
  -   * non-high-scoring hits.
  -   *
  -   * @param query to match documents
  -   * @param filter if non-null, a bitset used to eliminate some documents
  -   * @param results to receive hits
  -   */
  +  // inherit javadoc
     public void search(Query query, Filter filter, final HitCollector results)
       throws IOException {
       for (int i = 0; i < searchables.length; i++) {
  
  
  
  1.10      +4 -1      jakarta-lucene/src/java/org/apache/lucene/search/Searchable.java
  
  Index: Searchable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Searchable.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Searchable.java	27 Feb 2004 12:29:31 -0000	1.9
  +++ Searchable.java	25 Mar 2004 18:47:15 -0000	1.10
  @@ -83,7 +83,10 @@
     void search(Query query, Filter filter, HitCollector results)
       throws IOException;
   
  -  /** Frees resources associated with this Searcher. */
  +  /** Frees resources associated with this Searcher.
  +   * Be careful not to call this method while you are still using objects
  +   * like {@link Hits}.
  +   */
     void close() throws IOException;
   
     /** Expert: Returns the number of documents containing <code>term</code>.
  
  
  
  1.5       +2 -2      jakarta-lucene/src/java/org/apache/lucene/search/Sort.java
  
  Index: Sort.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/Sort.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Sort.java	2 Mar 2004 14:54:55 -0000	1.4
  +++ Sort.java	25 Mar 2004 18:47:15 -0000	1.5
  @@ -58,7 +58,7 @@
    * not be tokenized.  The values are sorted according to their
    * {@link Comparable natural order}.  Note that using this type
    * of term value has higher memory requirements than the other
  - * two types - see {@link FieldSortedHitQueue FieldSortedHitQueue}.
  + * two types.
    *
    * <p><h3>Object Reuse</h3>
    *
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message