--- /home/ck/Files/download/lucene/2.0/lucene-2.0.0/src/java/org/apache/lucene/index/ParallelReader.java	2006-05-26 18:54:19.000000000 +0200
+++ ParallelReader.java	2006-06-19 13:07:01.000000000 +0200
@@ -56,9 +56,39 @@
   private int maxDoc;
   private int numDocs;
   private boolean hasDeletions;
+  private final boolean allFields;
 
- /** Construct a ParallelReader. */
-  public ParallelReader() throws IOException { super(null); }
+ /** Constructs a ParallelReader, returning stored fields from all matching
+  * {@link IndexReader}s.
+  * 
+  * This is equivalent to calling <code>new ParallelReader(true)</code>.
+  *
+  * @deprecated Use {@link #ParallelReader(boolean)} instead. 
+  * @see #ParallelReader(boolean)
+  */
+  public ParallelReader() throws IOException { this(true); };
+
+  /**
+   * Constructs a ParallelReader, specifiying the way how document fields are
+   * returned by {@link #document(int)}.
+   * 
+   * If <code>allFields</code> is <code>false</code>,
+   * {@link Document#getFields(java.lang.String)} only returns the stored
+   * data from the first matching {@link IndexReader}
+   * which contains the corresponding field. 
+   * 
+   * If <code>allFields</code> is <code>true</code>,
+   * {@link Document#getFields(java.lang.String)} returns all stored data
+   * from every {@link IndexReader} which contains the field, in the order
+   * the IndexReaders were added to this <code>ParallelReader</code>.
+   * 
+   * @param allFields Whether to include stored data from all IndexReaders or not.
+   * @throws IOException
+   */
+  public ParallelReader(final boolean allFields) throws IOException {
+      super(null);
+      this.allFields = allFields;
+  }
     
  /** Add an IndexReader. */
   public void add(IndexReader reader) throws IOException {
@@ -138,7 +168,10 @@
       IndexReader reader = (IndexReader)storedFieldReaders.get(i);
       Enumeration fields = reader.document(n).fields();
       while (fields.hasMoreElements()) {
-        result.add((Field)fields.nextElement());
+          final Field f = (Field)fields.nextElement();
+          if(allFields || fieldToReader.get(f.name()) == reader) {
+              result.add(f);
+          }
       }
     }
     return result;
