lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r929210 - in /lucene/java/branches/flex_1458: ./ src/java/org/apache/lucene/index/ src/java/org/apache/lucene/index/codecs/sep/ src/java/org/apache/lucene/index/codecs/standard/ src/java/org/apache/lucene/search/ src/java/org/apache/lucene/...
Date Tue, 30 Mar 2010 18:15:39 GMT
Author: mikemccand
Date: Tue Mar 30 18:15:38 2010
New Revision: 929210

URL: http://svn.apache.org/viewvc?rev=929210&view=rev
Log:
LUCENE-2111 (flex branch): fix all jdoc warnings, update CHANGES w/ back compat breaks; throw
exception if SpanTermQuery is used on a field that did not index positions

Modified:
    lucene/java/branches/flex_1458/CHANGES.txt
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiFields.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermPositions.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Terms.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/TermState.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/AutomatonTermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ReaderUtil.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/packed/package.html

Modified: lucene/java/branches/flex_1458/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/CHANGES.txt?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/CHANGES.txt Tue Mar 30 18:15:38 2010
@@ -5,6 +5,7 @@ Lucene Change Log
 Changes in backwards compatibility policy
 
 * LUCENE-1458, LUCENE-2111: Changes from flexible indexing:
+
   - MultiReader ctor now throws IOException
 
   - Directory.copy/Directory.copyTo now copies all files (not just
@@ -12,9 +13,21 @@ Changes in backwards compatibility polic
     dependent on the codecs used. (Mike McCandless)
 
   - UnicodeUtil now uses BytesRef for UTF-8 output, and some method
-    signatures have changed to CharSequence.  These are advanced APIs
+    signatures have changed to CharSequence.  These are internal APIs
     and subject to change suddenly.  (Robert Muir, Mike McCandless)
 
+  - Positional queries (PhraseQuery, *SpanQuery) will now throw an
+    exception if use them on a field that omits positions during
+    indexing (previously they silently returned no results).
+
+  - FieldCache.(Byte,Short,Int,Long,Float,Double}Parser's API has
+    changed -- each parse method now takes a BytesRef instead of a
+    String.  If you have an existing Parser, a simple way to fix it is
+    invoke BytesRef.utf8ToString, and pass that String to your
+    existing parser.  This will work, but performance would be better
+    if you could fix your parser to instead operate directly on the
+    byte[] in the BytesRef.
+
 Bug Fixes
 
 * LUCENE-2222: FixedIntBlockIndexInput incorrectly read one block of

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsAndPositionsEnum.java
Tue Mar 30 18:15:38 2010
@@ -25,7 +25,7 @@ import org.apache.lucene.util.BytesRef;
 public abstract class DocsAndPositionsEnum extends DocsEnum {
 
   /** Returns the next position.  You should only call this
-   *  up to {@link FormatPostingsDocsEnum#freq()} times else
+   *  up to {@link DocsEnum#freq()} times else
    *  the behavior is not defined. */
   public abstract int nextPosition() throws IOException;
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocsEnum.java Tue Mar
30 18:15:38 2010
@@ -24,7 +24,7 @@ import org.apache.lucene.util.AttributeS
 import org.apache.lucene.util.IntsRef;
 
 /** Iterates through the documents, term freq and positions.
- *  NOTE: you must first call {@link #next}.
+ *  NOTE: you must first call {@link #nextDoc}.
  *
  *  @lucene.experimental */
 public abstract class DocsEnum extends DocIdSetIterator {
@@ -32,8 +32,8 @@ public abstract class DocsEnum extends D
   private AttributeSource atts = null;
 
   /** Returns term frequency in the current document.  Do
-   *  not call this before {@link #next} is first called,
-   *  nor after {@link #next} returns NO_MORE_DOCS. */
+   *  not call this before {@link #nextDoc} is first called,
+   *  nor after {@link #nextDoc} returns NO_MORE_DOCS. */
   public abstract int freq();
   
   /** Returns the related attributes. */
@@ -66,7 +66,7 @@ public abstract class DocsEnum extends D
   }
   
   /** Bulk read (docs and freqs).  After this is called,
-   * {@link #doc} and {@link #freq} are undefined.  This
+   * {@link #docID()} and {@link #freq} are undefined.  This
    * returns the count read, or 0 if the end is reached.
    * The IntsRef for docs and freqs will not have their
    * length set.

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java Tue
Mar 30 18:15:38 2010
@@ -1075,7 +1075,7 @@ final class DocumentsWriter {
           
           termRef.copy(term.text());
           
-          if (termsEnum.seek(termRef) == TermsEnum.SeekStatus.FOUND) {
+          if (termsEnum.seek(termRef, false) == TermsEnum.SeekStatus.FOUND) {
             DocsEnum docsEnum = termsEnum.docs(reader.getDeletedDocs(), docs);
             
             if (docsEnum != null) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java Tue Mar
30 18:15:38 2010
@@ -24,6 +24,7 @@ import org.apache.lucene.index.codecs.Co
 import org.apache.lucene.store.*;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.ReaderUtil;         // for javadocs
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -941,7 +942,7 @@ public abstract class IndexReader implem
    * </ul>
    * <p>The enumeration is ordered by document number.  Each document number
    * is greater than all that precede it in the enumeration.
-   * @deprecated Use the new flex API ({@link #termDocsEnum()}) instead.
+   * @deprecated Use the new flex API ({@link #termDocsEnum}) instead.
    * @throws IOException if there is a low-level IO error
    */
   @Deprecated
@@ -1021,7 +1022,7 @@ public abstract class IndexReader implem
    * <p>The enumeration is ordered by document number.  Each document number is
    * greater than all that precede it in the enumeration.
    * @deprecated Please switch the flex API ({@link
-   * #termDocsEnum()}) instead
+   * #termDocsEnum}) instead
    * @throws IOException if there is a low-level IO error
    */
   @Deprecated
@@ -1034,7 +1035,7 @@ public abstract class IndexReader implem
 
   /** Returns an unpositioned {@link TermPositions} enumerator.
    * @deprecated Please switch the flex API ({@link
-   * #termDocsEnum()}) instead
+   * #termDocsEnum}) instead
    * @throws IOException if there is a low-level IO error
    */
   @Deprecated

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiFields.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiFields.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiFields.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiFields.java Tue Mar
30 18:15:38 2010
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.ArrayList;
 import org.apache.lucene.util.ReaderUtil;
+import org.apache.lucene.util.ReaderUtil.Gather;  // for javadocs
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.MultiBits;
@@ -31,7 +32,7 @@ import org.apache.lucene.util.MultiBits;
  * Exposes flex API, merged from flex API of sub-segments.
  * This is useful when you're interacting with an {@link
  * IndexReader} implementation that consists of sequential
- * sub-readers (eg {@link DirectoryReade} or {@link
+ * sub-readers (eg {@link DirectoryReader} or {@link
  * MultiReader}).
  *
  * <p><b>NOTE</b>: for multi readers, you'll get better
@@ -53,7 +54,7 @@ public final class MultiFields extends F
    *
    *  <p><bNOTE</b>: this is a slow way to access postings.
    *  It's better to get the sub-readers (using {@link
-   *  ReaderUtil#Gather}) and iterate through them
+   *  Gather}) and iterate through them
    *  yourself. */
   public static Fields getFields(IndexReader r) throws IOException {
     final IndexReader[] subs = r.getSequentialSubReaders();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermPositions.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermPositions.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermPositions.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermPositions.java Tue
Mar 30 18:15:38 2010
@@ -26,7 +26,7 @@ import java.io.IOException;
  * positions of each occurrence of a term in a document.
  *
  * @see IndexReader#termPositions()
- * @deprecated Use {@link PositionsEnum} instead 
+ * @deprecated Use {@link DocsAndPositionsEnum} instead 
  */
 @Deprecated
 public interface TermPositions

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Terms.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Terms.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Terms.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Terms.java Tue Mar 30
18:15:38 2010
@@ -24,7 +24,7 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CloseableThreadLocal;
 
 /**
- * Access to the terms in a specific field.  See {@link #Fields}.
+ * Access to the terms in a specific field.  See {@link Fields}.
  * @lucene.experimental
  */
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsEnum.java Tue Mar
30 18:15:38 2010
@@ -26,11 +26,12 @@ import org.apache.lucene.util.BytesRef;
 
 /** Iterator to seek ({@link #seek}) or step through ({@link
  * #next} terms, obtain frequency information ({@link
- * #docFreq}), and obtain a {@link DocsEnum} for the current
- * term ({@link #docs)}.
+ * #docFreq}), and obtain a {@link DocsEnum} or {@link
+ * DocsAndPositionsEnum} for the current term ({@link
+ * #docs}.
  * 
  * <p>Term enumerations are always ordered by
- * {@link #getTermComparator}.  Each term in the enumeration is
+ * {@link #getComparator}.  Each term in the enumeration is
  * greater than all that precede it.</p>
  *
  * <p>On obtaining a TermsEnum, you must first call
@@ -47,7 +48,7 @@ public abstract class TermsEnum {
     return atts;
   }
   
-  /** Represents returned result from {@link TermsEnum.seek}.
+  /** Represents returned result from {@link #seek}.
    *  If status is FOUND, then the precise term was found.
    *  If status is NOT_FOUND, then a different term was
    *  found.  If the status is END, the end of the iteration
@@ -70,7 +71,7 @@ public abstract class TermsEnum {
   /** Seeks to the specified term by ordinal (position) as
    *  previously returned by {@link #ord}.  The target ord
    *  may be befor or after the current ord.  See {@link
-   *  #seek(BytesRef). */
+   *  #seek(BytesRef)}. */
   public abstract SeekStatus seek(long ord) throws IOException;
   
   /** Increments the enumeration to the next element.

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/sep/SingleIntIndexInput.java
Tue Mar 30 18:15:38 2010
@@ -24,7 +24,7 @@ import org.apache.lucene.store.IndexInpu
 import org.apache.lucene.util.CodecUtil;
 
 /** Reads IndexInputs written with {@link
- *  SingleIntIndexoutput}.  NOTE: this class is just for
+ *  SingleIntIndexOutput}.  NOTE: this class is just for
  *  demonstration puprposes (it is a very slow way to read a
  *  block of ints).
  *

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/TermState.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/TermState.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/TermState.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/standard/TermState.java
Tue Mar 30 18:15:38 2010
@@ -17,8 +17,10 @@ package org.apache.lucene.index.codecs.s
  * limitations under the License.
  */
 
+import org.apache.lucene.index.DocsEnum;          // for javadocs
+
 /**
- * Holds all state required for {@link StandardDocsProducer}
+ * Holds all state required for {@link StandardPostingsReader}
  * to produce a {@link DocsEnum} without re-seeking the
  * terms dict.
  * @lucene.experimental

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/AutomatonTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/AutomatonTermsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/AutomatonTermsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/AutomatonTermsEnum.java
Tue Mar 30 18:15:38 2010
@@ -132,7 +132,8 @@ public class AutomatonTermsEnum extends 
   }
  
   /**
-   * Returns true if the term matches the automaton. 
+   * Returns true if the term matches the automaton. Also stashes away the term
+   * to assist with smart enumeration.
    */
   @Override
   protected AcceptStatus accept(final BytesRef term) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermsEnum.java
Tue Mar 30 18:15:38 2010
@@ -34,7 +34,7 @@ import org.apache.lucene.util.Bits;
  * Abstract class for enumerating a subset of all terms. 
  * 
  * <p>Term enumerations are always ordered by
- * {@link #getTermComparator}.  Each term in the enumeration is
+ * {@link #getComparator}.  Each term in the enumeration is
  * greater than all that precede it.</p>
  * <p><em>Please note:</em> Consumers of this enum cannot
  * call {@code seek()}, it is forward only; it throws
@@ -52,7 +52,7 @@ public abstract class FilteredTermsEnum 
 
   /** Return value, if term should be accepted or the iteration should
    * {@code END}. The {@code *_SEEK} values denote, that after handling the current term
-   * the enum should call {@link nextSeekTerm()} and step forward.
+   * the enum should call {@link #nextSeekTerm} and step forward.
    * @see #accept(BytesRef)
    */
   protected static enum AcceptStatus {YES, YES_AND_SEEK, NO, NO_AND_SEEK, END};

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermsEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermsEnum.java Tue
Mar 30 18:15:38 2010
@@ -40,7 +40,7 @@ import java.util.List;
  * to the specified filter term.
  *
  * <p>Term enumerations are always ordered by
- * {@link #getTermComparator}.  Each term in the enumeration is
+ * {@link #getComparator}.  Each term in the enumeration is
  * greater than all that precede it.</p>
  */
 public final class FuzzyTermsEnum extends TermsEnum {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java Tue
Mar 30 18:15:38 2010
@@ -86,7 +86,7 @@ public abstract class MultiTermQuery ext
   /** Add this {@link Attribute} to a {@link TermsEnum} returned by {@link #getTermsEnum}
    * and update the boost on each returned term. This enables to control the boost factor
    * for each matching term in {@link #SCORING_BOOLEAN_QUERY_REWRITE} or
-   * {@link TOP_TERMS_SCORING_BOOLEAN_QUERY_REWRITE} mode.
+   * {@link TopTermsBooleanQueryRewrite} mode.
    * {@link FuzzyQuery} is using this to take the edit distance into account.
    */
   public static interface BoostAttribute extends Attribute {
@@ -95,7 +95,7 @@ public abstract class MultiTermQuery ext
     /** Retrieves the boost, default is {@code 1.0f}. */
     public float getBoost();
     /** Sets the maximum boost for terms that would never get
-     * into the priority queue of {@link MultiTermQuery#TOP_TERMS_SCORING_BOOLEAN_REWRITE}.
+     * into the priority queue of {@link MultiTermQuery.TopTermsBooleanQueryRewrite}.
      * This value is not changed by {@link AttributeImpl#clear}
      * and not used in {@code equals()} and {@code hashCode()}.
      * Do not change the value in the {@link TermsEnum}!
@@ -262,7 +262,6 @@ public abstract class MultiTermQuery ext
         if (boostAtt != null) boostAtt.setMaxNonCompetitiveBoost(maxNonCompetitiveBoost);
       }
     }
-    
   }
   
   private static class ScoringBooleanQueryRewrite extends BooleanQueryRewrite {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermsEnum.java
Tue Mar 30 18:15:38 2010
@@ -27,7 +27,7 @@ import org.apache.lucene.util.BytesRef;
  * Subclass of FilteredTermEnum for enumerating all terms that match the
  * specified prefix filter term.
  * <p>Term enumerations are always ordered by
- * {@link #getTermComparator}.  Each term in the enumeration is
+ * {@link #getComparator}.  Each term in the enumeration is
  * greater than all that precede it.</p>
  */
 public class PrefixTermsEnum extends FilteredTermsEnum {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java Tue Mar 30
18:15:38 2010
@@ -36,8 +36,6 @@ import java.io.IOException;
  * not valid scores.  Certain collectors (eg {@link
  * TopScoreDocCollector}) will not properly collect hits
  * with these scores.
- *
- * @see BooleanQuery#setAllowDocsOutOfOrder
  */
 public abstract class Scorer extends DocIdSetIterator {
   private final Similarity similarity;
@@ -90,7 +88,7 @@ public abstract class Scorer extends Doc
   }
   
   /** Returns the score of the current document matching the query.
-   * Initially invalid, until {@link #next()} or {@link #skipTo(int)}
+   * Initially invalid, until {@link #nextDoc()} or {@link #advance(int)}
    * is called the first time, or when called from within
    * {@link Collector#collect}.
    */

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
Tue Mar 30 18:15:38 2010
@@ -28,7 +28,7 @@ import org.apache.lucene.util.BytesRef;
  * Subclass of FilteredTermEnum for enumerating all terms that match the
  * specified range parameters.
  * <p>Term enumerations are always ordered by
- * {@link #getTermComparator}.  Each term in the enumeration is
+ * {@link #getComparator}.  Each term in the enumeration is
  * greater than all that precede it.</p>
  */
 public class TermRangeTermsEnum extends FilteredTermsEnum {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanTermQuery.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
Tue Mar 30 18:15:38 2010
@@ -85,15 +85,22 @@ public class SpanTermQuery extends SpanQ
   public Spans getSpans(final IndexReader reader) throws IOException {
     // NOTE: debateably, the caller should never pass in a
     // multi reader...
+    final BytesRef textBytes = new BytesRef(term.text());
     final DocsAndPositionsEnum postings = MultiFields.getTermPositionsEnum(reader,
                                                                            MultiFields.getDeletedDocs(reader),
                                                                            term.field(),
-                                                                           new BytesRef(term.text()));
+                                                                           textBytes);
 
     if (postings != null) {
       return new TermSpans(postings, term);
     } else {
-      return TermSpans.EMPTY_TERM_SPANS;
+      if (MultiFields.getTermDocsEnum(reader, MultiFields.getDeletedDocs(reader), term.field(),
textBytes) != null) {
+        // term does exist, but has no positions
+        throw new IllegalStateException("field \"" + term.field() + "\" was indexed with
Field.omitTermFreqAndPositions=true; cannot run SpanTermQuery (term=" + term.text() + ")");
+      } else {
+        // term does not exist
+        return TermSpans.EMPTY_TERM_SPANS;
+      }
     }
   }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ReaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ReaderUtil.java?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ReaderUtil.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/ReaderUtil.java Tue Mar
30 18:15:38 2010
@@ -48,7 +48,11 @@ public class ReaderUtil {
   }
 
   /**
-   * Gathers sub-readers from reader into a List.
+   * Gathers sub-readers from reader into a List.  See
+   * {@link Gather} for are more general way to gather
+   * whatever you need to, per reader.
+   *
+   * @lucene.experimental
    * 
    * @param allSubReaders
    * @param reader
@@ -68,6 +72,11 @@ public class ReaderUtil {
     }
   }
 
+  /** Recursively visits all sub-readers of a reader.  You
+   *  should subclass this and override the add method to
+   *  gather what you need.
+   *
+   * @lucene.experimental */
   public static abstract class Gather {
     private final IndexReader topReader;
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/packed/package.html
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/packed/package.html?rev=929210&r1=929209&r2=929210&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/packed/package.html (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/packed/package.html Tue
Mar 30 18:15:38 2010
@@ -9,7 +9,7 @@
     access speed. The standard usage scenario is replacing large int or long
     arrays in order to reduce the memory footprint.
 </p><p>
-    The main access point is the {@link PackedInts} factory.
+    The main access point is the {@link org.apache.lucene.util.packed.PackedInts} factory.
 </p>
 
 </body>



Mime
View raw message