lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1062798 [2/3] - in /lucene/dev/branches/bulkpostings: ./ dev-tools/eclipse/ dev-tools/maven/ dev-tools/maven/lucene/ dev-tools/maven/lucene/contrib/ dev-tools/maven/lucene/contrib/ant/ dev-tools/maven/lucene/contrib/db/ dev-tools/maven/luc...
Date Mon, 24 Jan 2011 14:32:04 GMT
Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanQuery.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanQuery.java Mon Jan 24 14:31:59 2011
@@ -19,7 +19,7 @@ package org.apache.lucene.search.spans;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Weight;
@@ -28,7 +28,7 @@ import org.apache.lucene.search.Weight;
 public abstract class SpanQuery extends Query {
   /** Expert: Returns the matches for this query in an index.  Used internally
    * to search for spans. */
-  public abstract Spans getSpans(IndexReader reader) throws IOException;
+  public abstract Spans getSpans(AtomicReaderContext context) throws IOException;
 
   /** Returns the name of the field matched by this query.*/
   public abstract String getField();

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanTermQuery.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanTermQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanTermQuery.java Mon Jan 24 14:31:59 2011
@@ -18,6 +18,7 @@ package org.apache.lucene.search.spans;
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.util.ToStringUtils;
@@ -80,7 +81,8 @@ public class SpanTermQuery extends SpanQ
   }
 
   @Override
-  public Spans getSpans(final IndexReader reader) throws IOException {
+  public Spans getSpans(final AtomicReaderContext context) throws IOException {
+    final IndexReader reader = context.reader;
     final DocsAndPositionsEnum postings = reader.termPositionsEnum(reader.getDeletedDocs(),
                                                                    term.field(),
                                                                    term.bytes());

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanWeight.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanWeight.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanWeight.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/SpanWeight.java Mon Jan 24 14:31:59 2011
@@ -73,7 +73,7 @@ public class SpanWeight extends Weight {
 
   @Override
   public Scorer scorer(AtomicReaderContext context, ScorerContext scorerContext) throws IOException {
-    return new SpanScorer(query.getSpans(context.reader), this, similarity, context.reader
+    return new SpanScorer(query.getSpans(context), this, similarity, context.reader
         .norms(query.getField()));
   }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/Spans.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/Spans.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/Spans.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/search/spans/Spans.java Mon Jan 24 14:31:59 2011
@@ -83,4 +83,5 @@ public abstract class Spans {
    * @return true if there is a payload available at this position that can be loaded
    */
   public abstract boolean isPayloadAvailable();
+  
 }

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/util/Constants.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/util/Constants.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/util/Constants.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/util/Constants.java Mon Jan 24 14:31:59 2011
@@ -70,6 +70,9 @@ public final class Constants {
     return s.toString();
   }
   
+  // NOTE: we track per-segment version as a String with the "X.Y" format, e.g.
+  // "4.0", "3.1", "3.0". Therefore when we change this constant, we should keep
+  // the format.
   public static final String LUCENE_MAIN_VERSION = ident("4.0");
 
   public static final String LUCENE_VERSION;

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Mon Jan 24 14:31:59 2011
@@ -171,15 +171,7 @@ public class TestBackwardsCompatibility 
 
       try {
         writer = new IndexWriter(dir, newIndexWriterConfig(
-          TEST_VERSION_CURRENT, new MockAnalyzer())
-          .setMergeScheduler(new SerialMergeScheduler()) // no threads!
-        );
-        // TODO: Make IndexWriter fail on open!
-        if (random.nextBoolean()) {
-          writer.optimize();
-        } else {
-          reader = writer.getReader();
-        }
+          TEST_VERSION_CURRENT, new MockAnalyzer()));
         fail("IndexWriter creation should not pass for "+unsupportedNames[i]);
       } catch (IndexFormatTooOldException e) {
         // pass
@@ -188,17 +180,13 @@ public class TestBackwardsCompatibility 
           e.printStackTrace(System.out);
         }
       } finally {
-        if (reader != null) reader.close();
-        reader = null;
+        // we should fail to open IW, and so it should be null when we get here.
+        // However, if the test fails (i.e., IW did not fail on open), we need
+        // to close IW. However, if merges are run, IW may throw
+        // IndexFormatTooOldException, and we don't want to mask the fail()
+        // above, so close without waiting for merges.
         if (writer != null) {
-          try {
-            writer.close();
-          } catch (IndexFormatTooOldException e) {
-            // OK -- since IW gives merge scheduler a chance
-            // to merge at close, it's possible and fine to
-            // hit this exc here
-            writer.close(false);
-          }
+          writer.close(false);
         }
         writer = null;
       }

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java Mon Jan 24 14:31:59 2011
@@ -39,6 +39,7 @@ import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.NamedThreadFactory;
@@ -132,6 +133,13 @@ public class TestNRTThreads extends Luce
                 if (doc == null) {
                   break;
                 }
+                final String addedField;
+                if (random.nextBoolean()) {
+                  addedField = "extra" + random.nextInt(10);
+                  doc.add(new Field(addedField, "a random field", Field.Store.NO, Field.Index.ANALYZED));
+                } else {
+                  addedField = null;
+                }
                 if (random.nextBoolean()) {
                   if (VERBOSE) {
                     //System.out.println(Thread.currentThread().getName() + ": add doc id:" + doc.get("id"));
@@ -166,6 +174,9 @@ public class TestNRTThreads extends Luce
                   toDeleteIDs.clear();
                 }
                 addCount.getAndIncrement();
+                if (addedField != null) {
+                  doc.removeField(addedField);
+                }
               } catch (Exception exc) {
                 System.out.println(Thread.currentThread().getName() + ": hit exc");
                 exc.printStackTrace();
@@ -347,7 +358,8 @@ public class TestNRTThreads extends Luce
 
     writer.commit();
     assertEquals("index=" + writer.segString() + " addCount=" + addCount + " delCount=" + delCount, addCount.get() - delCount.get(), writer.numDocs());
-      
+
+    assertFalse(writer.anyNonBulkMerges);
     writer.close(false);
     _TestUtil.checkIndex(dir);
     dir.close();

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/index.31.cfs.zip
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/index.31.cfs.zip?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
Binary files - no diff available.

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/index.31.nocfs.zip
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/index/index.31.nocfs.zip?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
Binary files - no diff available.

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/JustCompileSearch.java Mon Jan 24 14:31:59 2011
@@ -19,7 +19,6 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.index.FieldInvertState;
@@ -278,7 +277,7 @@ final class JustCompileSearch {
   static final class JustCompileSpanFilter extends SpanFilter {
 
     @Override
-    public SpanFilterResult bitSpans(IndexReader reader) throws IOException {
+    public SpanFilterResult bitSpans(AtomicReaderContext context) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
     

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java Mon Jan 24 14:31:59 2011
@@ -22,6 +22,7 @@ import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.MultiFields;
+import org.apache.lucene.search.Explanation.IDFExplanation;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.document.Document;
@@ -30,6 +31,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
+import java.util.Collection;
 import java.util.LinkedList;
 
 /**
@@ -285,4 +287,44 @@ public class TestMultiPhraseQuery extend
     new MultiPhraseQuery().toString();
   }
   
+  public void testCustomIDF() throws Exception {
+    Directory indexStore = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
+    add("This is a test", "object", writer);
+    add("a note", "note", writer);
+    
+    IndexReader reader = writer.getReader();
+    IndexSearcher searcher = new IndexSearcher(reader);
+    searcher.setSimilarity(new DefaultSimilarity() {
+      
+      @Override
+      public IDFExplanation idfExplain(Collection<Term> terms,
+          IndexSearcher searcher) throws IOException {
+        return new IDFExplanation() {
+
+          @Override
+          public float getIdf() {
+            return 10f;
+          }
+
+          @Override
+          public String explain() {
+            return "just a test";
+          }
+          
+        };
+      }   
+    });
+    
+    MultiPhraseQuery query = new MultiPhraseQuery();
+    query.add(new Term[] { new Term("body", "this"), new Term("body", "that") });
+    query.add(new Term("body", "is"));
+    Weight weight = query.createWeight(searcher);
+    assertEquals(10f * 10f, weight.sumOfSquaredWeights(), 0.001f);
+
+    writer.close();
+    searcher.close();
+    reader.close();
+    indexStore.close();
+  }
 }

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java Mon Jan 24 14:31:59 2011
@@ -40,6 +40,7 @@ import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.search.payloads.PayloadSpanUtil;
+import org.apache.lucene.search.spans.MultiSpansWrapper;
 import org.apache.lucene.search.spans.SpanNearQuery;
 import org.apache.lucene.search.spans.SpanQuery;
 import org.apache.lucene.search.spans.SpanTermQuery;
@@ -243,14 +244,15 @@ public class TestPositionIncrement exten
         "a a b c d e a f g h i j a b k k")));
     writer.addDocument(doc);
 
-    IndexReader r = new SlowMultiReaderWrapper(writer.getReader());
+    final IndexReader readerFromWriter = writer.getReader();
+    SlowMultiReaderWrapper r = new SlowMultiReaderWrapper(readerFromWriter);
 
     DocsAndPositionsEnum tp = r.termPositionsEnum(r.getDeletedDocs(),
                                                      "content",
                                                      new BytesRef("a"));
     
     int count = 0;
-    assertTrue(tp.nextDoc() != tp.NO_MORE_DOCS);
+    assertTrue(tp.nextDoc() != DocsAndPositionsEnum.NO_MORE_DOCS);
     // "a" occurs 4 times
     assertEquals(4, tp.freq());
     int expected = 0;
@@ -260,9 +262,9 @@ public class TestPositionIncrement exten
     assertEquals(6, tp.nextPosition());
 
     // only one doc has "a"
-    assertEquals(tp.NO_MORE_DOCS, tp.nextDoc());
+    assertEquals(DocsAndPositionsEnum.NO_MORE_DOCS, tp.nextDoc());
 
-    IndexSearcher is = new IndexSearcher(r);
+    IndexSearcher is = new IndexSearcher(readerFromWriter);
   
     SpanTermQuery stq1 = new SpanTermQuery(new Term("content", "a"));
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
@@ -274,7 +276,7 @@ public class TestPositionIncrement exten
     if (VERBOSE) {
       System.out.println("\ngetPayloadSpans test");
     }
-    Spans pspans = snq.getSpans(is.getIndexReader());
+    Spans pspans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
     while (pspans.next()) {
       if (VERBOSE) {
         System.out.println("doc " + pspans.doc() + ": span " + pspans.start()
@@ -289,11 +291,11 @@ public class TestPositionIncrement exten
         }
       }
     }
-    assertEquals(5, count);
     assertTrue(sawZero);
+    assertEquals(5, count);
 
     // System.out.println("\ngetSpans test");
-    Spans spans = snq.getSpans(is.getIndexReader());
+    Spans spans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
     count = 0;
     sawZero = false;
     while (spans.next()) {
@@ -308,7 +310,7 @@ public class TestPositionIncrement exten
     // System.out.println("\nPayloadSpanUtil test");
 
     sawZero = false;
-    PayloadSpanUtil psu = new PayloadSpanUtil(is.getIndexReader());
+    PayloadSpanUtil psu = new PayloadSpanUtil(is.getTopReaderContext());
     Collection<byte[]> pls = psu.getPayloadsForQuery(snq);
     count = pls.size();
     for (byte[] bytes : pls) {

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/TestSpanQueryFilter.java Mon Jan 24 14:31:59 2011
@@ -21,13 +21,14 @@ import java.util.List;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.spans.SpanTermQuery;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.English;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.ReaderUtil;
 
 public class TestSpanQueryFilter extends LuceneTestCase {
 
@@ -40,15 +41,18 @@ public class TestSpanQueryFilter extends
               Field.Store.NO, Field.Index.ANALYZED));
       writer.addDocument(document);
     }
-    IndexReader reader = writer.getReader();
+    final int number = 10;
+    IndexReader reader = writer.getReader(); 
     writer.close();
-
-    SpanTermQuery query = new SpanTermQuery(new Term("field", English.intToEnglish(10).trim()));
+    AtomicReaderContext[] leaves = ReaderUtil.leaves(reader.getTopReaderContext());
+    int subIndex = ReaderUtil.subIndex(number, leaves); // find the reader with this document in it
+    
+    SpanTermQuery query = new SpanTermQuery(new Term("field", English.intToEnglish(number).trim()));
     SpanQueryFilter filter = new SpanQueryFilter(query);
-    SpanFilterResult result = filter.bitSpans(new SlowMultiReaderWrapper(reader));
+    SpanFilterResult result = filter.bitSpans(leaves[subIndex]);
     DocIdSet docIdSet = result.getDocIdSet();
     assertTrue("docIdSet is null and it shouldn't be", docIdSet != null);
-    assertContainsDocId("docIdSet doesn't contain docId 10", docIdSet, 10);
+    assertContainsDocId("docIdSet doesn't contain docId 10", docIdSet, number);
     List<SpanFilterResult.PositionInfo> spans = result.getPositions();
     assertTrue("spans is null and it shouldn't be", spans != null);
     int size = getDocIdSetSize(docIdSet);
@@ -60,6 +64,7 @@ public class TestSpanQueryFilter extends
       //There should be two positions in each
       assertTrue("info.getPositions() Size: " + info.getPositions().size() + " is not: " + 2, info.getPositions().size() == 2);
     }
+    
     reader.close();
     dir.close();
   }

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/PayloadHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/PayloadHelper.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/PayloadHelper.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/PayloadHelper.java Mon Jan 24 14:31:59 2011
@@ -26,7 +26,6 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.util.English;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Similarity;
 import org.apache.lucene.store.Directory;
@@ -127,7 +126,7 @@ public class PayloadHelper {
       doc.add(new Field(NO_PAYLOAD_FIELD, English.intToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
       writer.addDocument(doc);
     }
-    reader = new SlowMultiReaderWrapper(IndexReader.open(writer));
+    reader = IndexReader.open(writer);
     writer.close();
 
     IndexSearcher searcher = new IndexSearcher(reader);

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java Mon Jan 24 14:31:59 2011
@@ -301,7 +301,7 @@ public class TestPayloadNearQuery extend
 
     @Override public float scorePayload(int docId, String fieldName, int start, int end, byte[] payload, int offset, int length) {
       //we know it is size 4 here, so ignore the offset/length
-      return payload[0];
+      return payload[offset];
     }
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     //Make everything else 1 so we see the effect of the payload

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java Mon Jan 24 14:31:59 2011
@@ -26,9 +26,9 @@ import org.apache.lucene.search.CheckHit
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.DefaultSimilarity;
+import org.apache.lucene.search.spans.MultiSpansWrapper;
 import org.apache.lucene.search.spans.SpanTermQuery;
 import org.apache.lucene.search.spans.Spans;
-import org.apache.lucene.search.spans.TermSpans;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.analysis.TokenStream;
@@ -39,7 +39,6 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.Payload;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -122,7 +121,7 @@ public class TestPayloadTermQuery extend
       doc.add(newField("multiField", English.intToEnglish(i) + "  " + English.intToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
       writer.addDocument(doc);
     }
-    reader = new SlowMultiReaderWrapper(writer.getReader());
+    reader = writer.getReader();
     writer.close();
 
     searcher = new IndexSearcher(reader);
@@ -153,9 +152,8 @@ public class TestPayloadTermQuery extend
       assertTrue(doc.score + " does not equal: " + 1, doc.score == 1);
     }
     CheckHits.checkExplanations(query, PayloadHelper.FIELD, searcher, true);
-    Spans spans = query.getSpans(searcher.getIndexReader());
+    Spans spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), query);
     assertTrue("spans is null and it shouldn't be", spans != null);
-    assertTrue("spans is not an instanceof " + TermSpans.class, spans instanceof TermSpans);
     /*float score = hits.score(0);
     for (int i =1; i < hits.length(); i++)
     {
@@ -205,9 +203,8 @@ public class TestPayloadTermQuery extend
     }
     assertTrue(numTens + " does not equal: " + 10, numTens == 10);
     CheckHits.checkExplanations(query, "field", searcher, true);
-    Spans spans = query.getSpans(searcher.getIndexReader());
+    Spans spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), query);
     assertTrue("spans is null and it shouldn't be", spans != null);
-    assertTrue("spans is not an instanceof " + TermSpans.class, spans instanceof TermSpans);
     //should be two matches per document
     int count = 0;
     //100 hits times 2 matches per hit, we should have 200 in count
@@ -247,9 +244,8 @@ public class TestPayloadTermQuery extend
     }
     assertTrue(numTens + " does not equal: " + 10, numTens == 10);
     CheckHits.checkExplanations(query, "field", searcher, true);
-    Spans spans = query.getSpans(searcher.getIndexReader());
+    Spans spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), query);
     assertTrue("spans is null and it shouldn't be", spans != null);
-    assertTrue("spans is not an instanceof " + TermSpans.class, spans instanceof TermSpans);
     //should be two matches per document
     int count = 0;
     //100 hits times 2 matches per hit, we should have 200 in count
@@ -293,7 +289,7 @@ public class TestPayloadTermQuery extend
     @Override
     public float scorePayload(int docId, String fieldName, int start, int end, byte[] payload, int offset, int length) {
       //we know it is size 4 here, so ignore the offset/length
-      return payload[0];
+      return payload[offset];
     }
 
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -333,7 +329,7 @@ public class TestPayloadTermQuery extend
   static class FullSimilarity extends DefaultSimilarity{
     public float scorePayload(int docId, String fieldName, byte[] payload, int offset, int length) {
       //we know it is size 4 here, so ignore the offset/length
-      return payload[0];
+      return payload[offset];
     }
   }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java Mon Jan 24 14:31:59 2011
@@ -20,7 +20,7 @@ package org.apache.lucene.search.spans;
 import java.io.IOException;
 import java.util.Collection;
 
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexReader.AtomicReaderContext;
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.search.Similarity;
 
@@ -82,7 +82,7 @@ final class JustCompileSearchSpans {
     }
 
     @Override
-    public Spans getSpans(IndexReader reader) throws IOException {
+    public Spans getSpans(AtomicReaderContext context) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestBasics.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestBasics.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestBasics.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestBasics.java Mon Jan 24 14:31:59 2011
@@ -30,7 +30,6 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Payload;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
@@ -176,6 +175,27 @@ public class TestBasics extends LuceneTe
     QueryUtils.check(term2);
     QueryUtils.checkUnequal(term1,term2);
   }
+  
+  public void testSpanTermQuery() throws Exception {
+    SpanTermQuery term1 = new SpanTermQuery(new Term("field", "seventy"));
+    checkHits(term1, new int[]
+                             { 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 170,
+        171, 172, 173, 174, 175, 176, 177, 178, 179, 270, 271, 272, 273, 274,
+        275, 276, 277, 278, 279, 370, 371, 372, 373, 374, 375, 376, 377, 378,
+        379, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 570, 571, 572,
+        573, 574, 575, 576, 577, 578, 579, 670, 671, 672, 673, 674, 675, 676,
+        677, 678, 679, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 870,
+        871, 872, 873, 874, 875, 876, 877, 878, 879, 970, 971, 972, 973, 974,
+        975, 976, 977, 978, 979, 1070, 1071, 1072, 1073, 1074, 1075, 1076,
+        1077, 1078, 1079, 1170, 1270, 1370, 1470, 1570, 1670, 1770, 1870, 1970,
+        1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1271, 1272, 1273,
+        1274, 1275, 1276, 1277, 1278, 1279, 1371, 1372, 1373, 1374, 1375, 1376,
+        1377, 1378, 1379, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479,
+        1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1671, 1672, 1673,
+        1674, 1675, 1676, 1677, 1678, 1679, 1771, 1772, 1773, 1774, 1775, 1776,
+        1777, 1778, 1779, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879,
+        1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979 });
+  }
 
   @Test
   public void testSpanNearUnordered() throws Exception {
@@ -522,8 +542,8 @@ public class TestBasics extends LuceneTe
   public void testSpansSkipTo() throws Exception {
 	  SpanTermQuery t1 = new SpanTermQuery(new Term("field", "seventy"));
 	  SpanTermQuery t2 = new SpanTermQuery(new Term("field", "seventy"));
-	  Spans s1 = t1.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
-	  Spans s2 = t2.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+	  Spans s1 = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), t1);
+	  Spans s2 = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), t2);
 	  
 	  assertTrue(s1.next());
 	  assertTrue(s2.next());

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java Mon Jan 24 14:31:59 2011
@@ -24,7 +24,6 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.CheckHits;
 import org.apache.lucene.search.IndexSearcher;
@@ -254,7 +253,7 @@ public class TestFieldMaskingSpanQuery e
     SpanQuery q  = new SpanOrQuery(q1, new FieldMaskingSpanQuery(q2, "gender"));
     check(q, new int[] { 0, 1, 2, 3, 4 });
   
-    Spans span = q.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    Spans span = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     
     assertEquals(true, span.next());
     assertEquals(s(0,0,1), s(span));
@@ -295,8 +294,8 @@ public class TestFieldMaskingSpanQuery e
     check(qA, new int[] { 0, 1, 2, 4 });
     check(qB, new int[] { 0, 1, 2, 4 });
   
-    Spans spanA = qA.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
-    Spans spanB = qB.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    Spans spanA = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), qA);
+    Spans spanB = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), qB);
     
     while (spanA.next()) {
       assertTrue("spanB not still going", spanB.next());
@@ -316,7 +315,7 @@ public class TestFieldMaskingSpanQuery e
         new FieldMaskingSpanQuery(qB, "id") }, -1, false );
     check(q, new int[] { 0, 1, 2, 3 });
   
-    Spans span = q.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    Spans span = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     
     assertEquals(true, span.next());
     assertEquals(s(0,0,1), s(span));

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java Mon Jan 24 14:31:59 2011
@@ -22,7 +22,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.queryParser.QueryParser;
@@ -34,6 +34,7 @@ import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Weight.ScorerContext;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.ReaderUtil;
 
 public class TestNearSpansOrdered extends LuceneTestCase {
   protected IndexSearcher searcher;
@@ -62,7 +63,7 @@ public class TestNearSpansOrdered extend
       doc.add(newField(FIELD, docFields[i], Field.Store.NO, Field.Index.ANALYZED));
       writer.addDocument(doc);
     }
-    reader = new SlowMultiReaderWrapper(writer.getReader());
+    reader = writer.getReader();
     writer.close();
     searcher = new IndexSearcher(reader);
   }
@@ -102,7 +103,7 @@ public class TestNearSpansOrdered extend
   
   public void testNearSpansNext() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(true, span.next());
     assertEquals(s(0,0,3), s(span));
     assertEquals(true, span.next());
@@ -117,7 +118,7 @@ public class TestNearSpansOrdered extend
    */
   public void testNearSpansSkipToLikeNext() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(true, span.skipTo(0));
     assertEquals(s(0,0,3), s(span));
     assertEquals(true, span.skipTo(1));
@@ -127,7 +128,7 @@ public class TestNearSpansOrdered extend
   
   public void testNearSpansNextThenSkipTo() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(true, span.next());
     assertEquals(s(0,0,3), s(span));
     assertEquals(true, span.skipTo(1));
@@ -137,7 +138,7 @@ public class TestNearSpansOrdered extend
   
   public void testNearSpansNextThenSkipPast() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(true, span.next());
     assertEquals(s(0,0,3), s(span));
     assertEquals(false, span.skipTo(2));
@@ -145,20 +146,20 @@ public class TestNearSpansOrdered extend
   
   public void testNearSpansSkipPast() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(false, span.skipTo(2));
   }
   
   public void testNearSpansSkipTo0() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(true, span.skipTo(0));
     assertEquals(s(0,0,3), s(span));
   }
 
   public void testNearSpansSkipTo1() throws Exception {
     SpanNearQuery q = makeQuery();
-    Spans span = q.getSpans(searcher.getIndexReader());
+    Spans span =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), q);
     assertEquals(true, span.skipTo(1));
     assertEquals(s(1,0,4), s(span));
   }
@@ -170,8 +171,9 @@ public class TestNearSpansOrdered extend
   public void testSpanNearScorerSkipTo1() throws Exception {
     SpanNearQuery q = makeQuery();
     Weight w = q.weight(searcher);
-    assertTrue(searcher.getTopReaderContext().isAtomic);
-    Scorer s = w.scorer((AtomicReaderContext) searcher.getTopReaderContext(), ScorerContext.def());
+    ReaderContext topReaderContext = searcher.getTopReaderContext();
+    AtomicReaderContext[] leaves = ReaderUtil.leaves(topReaderContext);
+    Scorer s = w.scorer(leaves[0], ScorerContext.def());
     assertEquals(1, s.advance(1));
   }
   /**
@@ -180,8 +182,10 @@ public class TestNearSpansOrdered extend
    */
   public void testSpanNearScorerExplain() throws Exception {
     SpanNearQuery q = makeQuery();
-    assertTrue(searcher.getTopReaderContext().isAtomic);
-    Explanation e = q.weight(searcher).explain((AtomicReaderContext) searcher.getTopReaderContext(), 1);
+    ReaderContext topReaderContext = searcher.getTopReaderContext();
+    AtomicReaderContext[] leaves = ReaderUtil.leaves(topReaderContext);
+
+    Explanation e = q.weight(searcher).explain(leaves[0], 1);
     assertTrue("Scorer explanation value for doc#1 isn't positive: "
                + e.toString(),
                0.0f < e.getValue());

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java Mon Jan 24 14:31:59 2011
@@ -35,7 +35,6 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.index.CorruptIndexException;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.index.Payload;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.DefaultSimilarity;
@@ -68,12 +67,12 @@ public class TestPayloadSpans extends Lu
     SpanTermQuery stq;
     Spans spans;
     stq = new SpanTermQuery(new Term(PayloadHelper.FIELD, "seventy"));
-    spans = stq.getSpans(indexReader);
+    spans = MultiSpansWrapper.wrap(indexReader.getTopReaderContext(), stq);
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 100, 1, 1, 1);
 
     stq = new SpanTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "seventy"));  
-    spans = stq.getSpans(indexReader);
+    spans = MultiSpansWrapper.wrap(indexReader.getTopReaderContext(), stq);
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 100, 0, 0, 0);
   }
@@ -84,7 +83,7 @@ public class TestPayloadSpans extends Lu
     SpanFirstQuery sfq;
     match = new SpanTermQuery(new Term(PayloadHelper.FIELD, "one"));
     sfq = new SpanFirstQuery(match, 2);
-    Spans spans = sfq.getSpans(indexReader);
+    Spans spans = MultiSpansWrapper.wrap(indexReader.getTopReaderContext(), sfq);
     checkSpans(spans, 109, 1, 1, 1);
     //Test more complicated subclause
     SpanQuery[] clauses = new SpanQuery[2];
@@ -92,11 +91,11 @@ public class TestPayloadSpans extends Lu
     clauses[1] = new SpanTermQuery(new Term(PayloadHelper.FIELD, "hundred"));
     match = new SpanNearQuery(clauses, 0, true);
     sfq = new SpanFirstQuery(match, 2);
-    checkSpans(sfq.getSpans(indexReader), 100, 2, 1, 1);
+    checkSpans(MultiSpansWrapper.wrap(indexReader.getTopReaderContext(), sfq), 100, 2, 1, 1);
 
     match = new SpanNearQuery(clauses, 0, false);
     sfq = new SpanFirstQuery(match, 2);
-    checkSpans(sfq.getSpans(indexReader), 100, 2, 1, 1);
+    checkSpans(MultiSpansWrapper.wrap(indexReader.getTopReaderContext(), sfq), 100, 2, 1, 1);
     
   }
   
@@ -119,8 +118,9 @@ public class TestPayloadSpans extends Lu
     writer.addDocument(doc);
     IndexReader reader = writer.getReader();
     writer.close();
+    
 
-    checkSpans(snq.getSpans(new SlowMultiReaderWrapper(reader)), 1,new int[]{2});
+    checkSpans(MultiSpansWrapper.wrap(reader.getTopReaderContext(), snq), 1,new int[]{2});
     reader.close();
     directory.close();
   }
@@ -130,7 +130,7 @@ public class TestPayloadSpans extends Lu
     Spans spans;
     IndexSearcher searcher = getSearcher();
     stq = new SpanTermQuery(new Term(PayloadHelper.FIELD, "mark"));
-    spans = stq.getSpans(searcher.getIndexReader());
+    spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), stq);
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 0, null);
 
@@ -141,7 +141,7 @@ public class TestPayloadSpans extends Lu
     clauses[2] = new SpanTermQuery(new Term(PayloadHelper.FIELD, "xx"));
     SpanNearQuery spanNearQuery = new SpanNearQuery(clauses, 12, false);
 
-    spans = spanNearQuery.getSpans(searcher.getIndexReader());
+    spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), spanNearQuery);
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 2, new int[]{3,3});
 
@@ -152,8 +152,8 @@ public class TestPayloadSpans extends Lu
 
     spanNearQuery = new SpanNearQuery(clauses, 6, true);
    
-    
-    spans = spanNearQuery.getSpans(searcher.getIndexReader());
+    spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), spanNearQuery);
+
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 1, new int[]{3});
      
@@ -175,7 +175,7 @@ public class TestPayloadSpans extends Lu
     
     // yy within 6 of xx within 6 of rr
 
-    spans = nestedSpanNearQuery.getSpans(searcher.getIndexReader());
+    spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), nestedSpanNearQuery);
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 2, new int[]{3,3});
     closeIndexReader.close();
@@ -206,8 +206,8 @@ public class TestPayloadSpans extends Lu
     clauses3[1] = snq;
      
     SpanNearQuery nestedSpanNearQuery = new SpanNearQuery(clauses3, 6, false);
+    spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), nestedSpanNearQuery);
 
-    spans = nestedSpanNearQuery.getSpans(searcher.getIndexReader());
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 1, new int[]{3});
     closeIndexReader.close();
@@ -244,7 +244,7 @@ public class TestPayloadSpans extends Lu
      
     SpanNearQuery nestedSpanNearQuery = new SpanNearQuery(clauses3, 6, false);
 
-    spans = nestedSpanNearQuery.getSpans(searcher.getIndexReader());
+    spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), nestedSpanNearQuery);
     assertTrue("spans is null and it shouldn't be", spans != null);
     checkSpans(spans, 2, new int[]{8, 8});
     closeIndexReader.close();
@@ -261,7 +261,7 @@ public class TestPayloadSpans extends Lu
     doc.add(new Field("content", new StringReader("a b c d e f g h i j a k")));
     writer.addDocument(doc);
 
-    IndexReader reader = new SlowMultiReaderWrapper(writer.getReader());
+    IndexReader reader = writer.getReader();
     IndexSearcher is = new IndexSearcher(reader);
     writer.close();
 
@@ -269,7 +269,7 @@ public class TestPayloadSpans extends Lu
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
     SpanQuery[] sqs = { stq1, stq2 };
     SpanNearQuery snq = new SpanNearQuery(sqs, 1, true);
-    Spans spans = snq.getSpans(is.getIndexReader());
+    Spans spans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
 
     TopDocs topDocs = is.search(snq, 1);
     Set<String> payloadSet = new HashSet<String>();
@@ -298,7 +298,7 @@ public class TestPayloadSpans extends Lu
     Document doc = new Document();
     doc.add(new Field("content", new StringReader("a b a d k f a h i k a k")));
     writer.addDocument(doc);
-    IndexReader reader = new SlowMultiReaderWrapper(writer.getReader());
+    IndexReader reader = writer.getReader();
     IndexSearcher is = new IndexSearcher(reader);
     writer.close();
 
@@ -306,7 +306,7 @@ public class TestPayloadSpans extends Lu
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
     SpanQuery[] sqs = { stq1, stq2 };
     SpanNearQuery snq = new SpanNearQuery(sqs, 0, true);
-    Spans spans = snq.getSpans(is.getIndexReader());
+    Spans spans =  MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
 
     TopDocs topDocs = is.search(snq, 1);
     Set<String> payloadSet = new HashSet<String>();
@@ -334,7 +334,7 @@ public class TestPayloadSpans extends Lu
     Document doc = new Document();
     doc.add(new Field("content", new StringReader("j k a l f k k p a t a k l k t a")));
     writer.addDocument(doc);
-    IndexReader reader = new SlowMultiReaderWrapper(writer.getReader());
+    IndexReader reader = writer.getReader();
     IndexSearcher is = new IndexSearcher(reader);
     writer.close();
 
@@ -342,7 +342,7 @@ public class TestPayloadSpans extends Lu
     SpanTermQuery stq2 = new SpanTermQuery(new Term("content", "k"));
     SpanQuery[] sqs = { stq1, stq2 };
     SpanNearQuery snq = new SpanNearQuery(sqs, 0, true);
-    Spans spans = snq.getSpans(is.getIndexReader());
+    Spans spans =  MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
 
     TopDocs topDocs = is.search(snq, 1);
     Set<String> payloadSet = new HashSet<String>();
@@ -376,11 +376,11 @@ public class TestPayloadSpans extends Lu
     doc.add(newField(PayloadHelper.FIELD,"xx rr yy mm  pp", Field.Store.YES, Field.Index.ANALYZED));
     writer.addDocument(doc);
   
-    IndexReader reader = new SlowMultiReaderWrapper(writer.getReader());
+    IndexReader reader = writer.getReader();
     writer.close();
     IndexSearcher searcher = new IndexSearcher(reader);
 
-    PayloadSpanUtil psu = new PayloadSpanUtil(searcher.getIndexReader());
+    PayloadSpanUtil psu = new PayloadSpanUtil(searcher.getTopReaderContext());
     
     Collection<byte[]> payloads = psu.getPayloadsForQuery(new TermQuery(new Term(PayloadHelper.FIELD, "rr")));
     if(VERBOSE)
@@ -440,7 +440,7 @@ public class TestPayloadSpans extends Lu
       writer.addDocument(doc);
     }
 
-    closeIndexReader = new SlowMultiReaderWrapper(writer.getReader());
+    closeIndexReader = writer.getReader();
     writer.close();
 
     IndexSearcher searcher = new IndexSearcher(closeIndexReader);

Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java Mon Jan 24 14:31:59 2011
@@ -28,16 +28,18 @@ import org.apache.lucene.search.IndexSea
 import org.apache.lucene.search.Weight.ScorerContext;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.index.IndexReader.ReaderContext;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
-import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.ReaderUtil;
+
 import java.io.IOException;
 
 public class TestSpans extends LuceneTestCase {
@@ -197,7 +199,7 @@ public class TestSpans extends LuceneTes
                                 makeSpanTermQuery("t3") },
                               slop,
                               ordered);
-    Spans spans = snq.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    Spans spans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq);
 
     assertTrue("first range", spans.next());
     assertEquals("first doc", 11, spans.doc());
@@ -223,7 +225,7 @@ public class TestSpans extends LuceneTes
                                 makeSpanTermQuery("u2") },
                               0,
                               false);
-    Spans spans = snq.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    Spans spans =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq);
     assertTrue("Does not have next and it should", spans.next());
     assertEquals("doc", 4, spans.doc());
     assertEquals("start", 1, spans.start());
@@ -259,7 +261,7 @@ public class TestSpans extends LuceneTes
                               },
                               1,
                               false);
-    spans = snq.getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    spans =  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq);
     assertTrue("Does not have next and it should", spans.next());
     assertEquals("doc", 4, spans.doc());
     assertEquals("start", 0, spans.start());
@@ -317,7 +319,7 @@ public class TestSpans extends LuceneTes
     for (int i = 0; i < terms.length; i++) {
       sqa[i] = makeSpanTermQuery(terms[i]);
     }
-    return (new SpanOrQuery(sqa)).getSpans(new SlowMultiReaderWrapper(searcher.getIndexReader()));
+    return  MultiSpansWrapper.wrap(searcher.getTopReaderContext(), new SpanOrQuery(sqa));
   }
 
   private void tstNextSpans(Spans spans, int doc, int start, int end)
@@ -402,34 +404,43 @@ public class TestSpans extends LuceneTes
   public void testSpanScorerZeroSloppyFreq() throws Exception {
     boolean ordered = true;
     int slop = 1;
-
-    final Similarity sim = new DefaultSimilarity() {
-      @Override
-      public float sloppyFreq(int distance) {
-        return 0.0f;
+    ReaderContext topReaderContext = searcher.getTopReaderContext();
+    AtomicReaderContext[] leaves = ReaderUtil.leaves(topReaderContext);
+    int subIndex = ReaderUtil.subIndex(11, leaves);
+    for (int i = 0; i < leaves.length; i++) {
+      
+     
+      final Similarity sim = new DefaultSimilarity() {
+        @Override
+        public float sloppyFreq(int distance) {
+          return 0.0f;
+        }
+      };
+  
+      final Similarity oldSim = searcher.getSimilarity();
+      Scorer spanScorer;
+      try {
+        searcher.setSimilarity(sim);
+        SpanNearQuery snq = new SpanNearQuery(
+                                new SpanQuery[] {
+                                  makeSpanTermQuery("t1"),
+                                  makeSpanTermQuery("t2") },
+                                slop,
+                                ordered);
+  
+        spanScorer = snq.weight(searcher).scorer(leaves[i], ScorerContext.def());
+      } finally {
+        searcher.setSimilarity(oldSim);
+      }
+      if (i == subIndex) {
+        assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+        assertEquals("first doc number", spanScorer.docID() + leaves[i].docBase, 11);
+        float score = spanScorer.score();
+        assertTrue("first doc score should be zero, " + score, score == 0.0f);
+      }  else {
+        assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
       }
-    };
-
-    final Similarity oldSim = searcher.getSimilarity();
-    Scorer spanScorer;
-    try {
-      searcher.setSimilarity(sim);
-      SpanNearQuery snq = new SpanNearQuery(
-                              new SpanQuery[] {
-                                makeSpanTermQuery("t1"),
-                                makeSpanTermQuery("t2") },
-                              slop,
-                              ordered);
-
-      spanScorer = snq.weight(searcher).scorer(new AtomicReaderContext(new SlowMultiReaderWrapper(searcher.getIndexReader())), ScorerContext.def());
-    } finally {
-      searcher.setSimilarity(oldSim);
     }
-    assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
-    assertEquals("first doc number", spanScorer.docID(), 11);
-    float score = spanScorer.score();
-    assertTrue("first doc score should be zero, " + score, score == 0.0f);
-    assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
   }
 
   // LUCENE-1404

Modified: lucene/dev/branches/bulkpostings/modules/analysis/common/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/analysis/common/build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/analysis/common/build.xml (original)
+++ lucene/dev/branches/bulkpostings/modules/analysis/common/build.xml Mon Jan 24 14:31:59 2011
@@ -25,7 +25,6 @@
 	
   <property name="build.dir" location="../build/common" />
   <property name="dist.dir" location="../dist/common" />
-  <property name="maven.dist.dir" location="../dist/maven" />
 
   <import file="../../../lucene/contrib/contrib-build.xml"/>
 	

Modified: lucene/dev/branches/bulkpostings/modules/analysis/smartcn/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/analysis/smartcn/build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/analysis/smartcn/build.xml (original)
+++ lucene/dev/branches/bulkpostings/modules/analysis/smartcn/build.xml Mon Jan 24 14:31:59 2011
@@ -25,7 +25,6 @@
 	
   <property name="build.dir" location="../build/smartcn" />
   <property name="dist.dir" location="../dist/smartcn" />
-  <property name="maven.dist.dir" location="../dist/maven" />
 
   <import file="../../../lucene/contrib/contrib-build.xml"/>
 

Modified: lucene/dev/branches/bulkpostings/modules/analysis/stempel/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/analysis/stempel/build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/analysis/stempel/build.xml (original)
+++ lucene/dev/branches/bulkpostings/modules/analysis/stempel/build.xml Mon Jan 24 14:31:59 2011
@@ -25,7 +25,6 @@
 	
   <property name="build.dir" location="../build/stempel" />
   <property name="dist.dir" location="../dist/stempel" />
-  <property name="maven.dist.dir" location="../dist/maven" />
 
   <import file="../../../lucene/contrib/contrib-build.xml"/>
 

Modified: lucene/dev/branches/bulkpostings/modules/benchmark/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/benchmark/build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/benchmark/build.xml (original)
+++ lucene/dev/branches/bulkpostings/modules/benchmark/build.xml Mon Jan 24 14:31:59 2011
@@ -7,7 +7,7 @@
 
     <property name="build.dir" location="build/" />
     <property name="dist.dir" location="dist/" />
-    <property name="maven.dist.dir" location="dist/maven" />
+    <property name="maven.dist.dir" location="../dist/maven" />
 
     <import file="../../lucene/contrib/contrib-build.xml"/>
     <property name="working.dir" location="work"/>

Modified: lucene/dev/branches/bulkpostings/modules/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/build.xml (original)
+++ lucene/dev/branches/bulkpostings/modules/build.xml Mon Jan 24 14:31:59 2011
@@ -56,8 +56,7 @@
 
   <target name="generate-maven-artifacts" description="Generate Maven Artifacts for Modules">
     <sequential>
-	  <ant target="get-maven-poms" inheritAll="false" dir=".."/>
-
+      <ant target="get-maven-poms" inheritAll="false" dir=".."/>
       <subant target="dist-maven" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />
@@ -67,6 +66,7 @@
 
   <target name="clean" description="Clean all modules">
     <sequential>
+      <delete dir="dist"/>
       <subant target="clean" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />

Modified: lucene/dev/branches/bulkpostings/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/CHANGES.txt?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/CHANGES.txt (original)
+++ lucene/dev/branches/bulkpostings/solr/CHANGES.txt Mon Jan 24 14:31:59 2011
@@ -158,6 +158,8 @@ Bug Fixes
   dealing with SolrDocumentList objects -- ie: sharded queries.
   (Antonio Verni via hossman)
   
+* SOLR-2127: Fixed serialization of default core and indentation of solr.xml when serializing.
+  (Ephraim Ofir, Mark Miller)
 
 Other Changes
 ----------------------
@@ -409,6 +411,9 @@ New Features
 * SOLR-2188: Added "maxTokenLength" argument to the factories for ClassicTokenizer,
   StandardTokenizer, and UAX29URLEmailTokenizer. (Steven Rowe)
 
+* SOLR-2129: Added a Solr module for dynamic metadata extraction/indexing with Apache UIMA.
+  See contrib/uima/README.txt for more information.  (Tommaso Teofili via rmuir)
+
 Optimizations
 ----------------------
 
@@ -605,8 +610,6 @@ Bug Fixes
 
 * SOLR-2173: Suggester should always rebuild Lookup data if Lookup.load fails. (ab)
 
-* SOLR-2190: change xpath from RSS 0.9 to 1.0 in slashdot sample. (koji)
-
 * SOLR-2057: DataImportHandler never calls UpdateRequestProcessor.finish()
   (Drew Farris via koji)
 

Modified: lucene/dev/branches/bulkpostings/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/build.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/build.xml Mon Jan 24 14:31:59 2011
@@ -56,7 +56,7 @@
     <echo message="Use 'ant compile' to compile the source code." />
     <echo message="Use 'ant dist' to build the project WAR and JAR files." />
     <echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
-    <echo message="Use 'ant package' to generate zip, tgz, and maven artifacts for distribution." />
+    <echo message="Use 'ant package' to generate zip, tgz for distribution." />
     <echo message="Use 'ant luke' to start luke.  see: http://luke.googlecode.com" />
     <echo message="Use 'ant test' to run unit tests." />
   </target>
@@ -218,6 +218,7 @@
           <packageset dir="contrib/dataimporthandler/src/main/java" />
           <packageset dir="contrib/clustering/src/main/java" />
           <packageset dir="contrib/extraction/src/main/java" />
+          <packageset dir="contrib/uima/src/main/java" />
           <packageset dir="contrib/analysis-extras/src/java" />
           <group title="Core" packages="org.apache.*" />
           <group title="Common" packages="org.apache.solr.common.*" />
@@ -225,6 +226,7 @@
           <group title="contrib: DataImportHandler" packages="org.apache.solr.handler.dataimport*" />
           <group title="contrib: Clustering" packages="org.apache.solr.handler.clustering*" />
           <group title="contrib: Solr Cell" packages="org.apache.solr.handler.extraction*" />
+          <group title="contrib: Solr UIMA" packages="org.apache.solr.uima*" />
         </sources>
       </invoke-javadoc>
     </sequential>
@@ -514,6 +516,7 @@
       <fileset dir="contrib/dataimporthandler/src/main/java" />
       <fileset dir="contrib/clustering/src/main/java" />
       <fileset dir="contrib/extraction/src/main/java" />
+      <fileset dir="contrib/uima/src/main/java" />
       <fileset dir="contrib/analysis-extras/src/java" />
     </clover-setup>
   </target>
@@ -617,6 +620,10 @@
               basedir="contrib/clustering/src" />
     <solr-jar destfile="${dist}/apache-solr-analysis-extras-src-${version}.jar"
               basedir="contrib/analysis-extras/src" />
+    <solr-jar destfile="${dist}/apache-solr-uima-src-${version}.jar"
+              basedir="contrib/uima/src/main/java" >
+       <fileset dir="contrib/uima/src/main/resources" />
+    </solr-jar>
   </target>
 
   <target name="dist-javadoc" description="Creates the Solr javadoc distribution files"
@@ -635,6 +642,8 @@
               basedir="${build.javadoc}/contrib-solr-cell" />
     <solr-jar destfile="${dist}/apache-solr-analysis-extras-docs-${version}.jar"
               basedir="${build.javadoc}/contrib-solr-analysis-extras" />
+    <solr-jar destfile="${dist}/apache-solr-uima-docs-${version}.jar"
+              basedir="${build.javadoc}/contrib-solr-uima" />
   </target>
 
   <!-- Creates the solr jar. -->
@@ -714,7 +723,7 @@
   </target>
   
   <!-- make a distribution -->
-  <target name="package" depends="generate-maven-artifacts"/>
+  <target name="package" depends="create-package"/>
 
   <target name="create-package"
           description="Packages the Solr Distribution files and Documentation."
@@ -731,7 +740,7 @@
       <tarfileset dir="."
         prefix="${fullnamever}"
         includes="LICENSE.txt NOTICE.txt *.txt *.xml lucene-libs/** lib/** src/** example/** client/** contrib/"
-        excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python contrib/**/build/ **/*.iml **/*.ipr **/*.iws contrib/clustering/example/lib/** contrib/clustering/lib/downloads/** contrib/analysis-extras/lib/**" />
+        excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python contrib/**/build/ **/*.iml **/*.ipr **/*.iws contrib/clustering/example/lib/** contrib/clustering/lib/downloads/** contrib/analysis-extras/lib/** contrib/uima/lib/**" />
       <tarfileset dir="."
         prefix="${fullnamever}"
         includes="src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
@@ -903,6 +912,14 @@
         </artifact-attachments>
       </m2-deploy>
 
+      <m2-deploy pom.xml="contrib/extraction/solr-uima-pom.xml.template"
+                 jar.file="${dist}/apache-solr-uima-${version}.jar">
+        <artifact-attachments>
+          <attach file="${dist}/apache-solr-uima-src-${version}.jar" classifier="sources"/>
+          <attach file="${dist}/apache-solr-uima-docs-${version}.jar" classifier="javadoc"/>
+        </artifact-attachments>
+      </m2-deploy>
+
       <m2-deploy pom.xml="src/pom.xml"
                  jar.file="${dist}/apache-solr-core-${version}.jar">
         <artifact-attachments>
@@ -924,11 +941,6 @@
     </sequential>
   </target>
 
-  <target name="nightly"
-          depends="set-fsdir, test, create-package">
-     <!-- no description, don't advertise -->
-  </target>
-  
   <target name="set-fsdir">
      <property name="use.fsdir" value="true"/>
   </target>
@@ -957,6 +969,8 @@
       <fileset dir="contrib/extraction/src/test/java"/>
       <fileset dir="contrib/analysis-extras/src/test"/>
       <fileset dir="contrib/analysis-extras/src/test"/>
+      <fileset dir="contrib/uima/src/main/java"/>
+      <fileset dir="contrib/uima/src/test/java"/>
     </rat:report>
   </target>
 

Modified: lucene/dev/branches/bulkpostings/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/common-build.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/common-build.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/common-build.xml Mon Jan 24 14:31:59 2011
@@ -138,8 +138,8 @@
   <property name="junit.output.dir" location="${common-solr.dir}/${dest}/test-results"/>
   <property name="junit.reports" location="${common-solr.dir}/${dest}/test-results/reports"/>
   <property name="junit.formatter" value="plain"/>
-  <condition property="junit.details.formatter"
-      value="org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"
+  <condition property="junit.details.formatter" 
+      value="org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"
       else="org.apache.lucene.util.LuceneJUnitResultFormatter">
     <isset property="tests.sequential"/>
   </condition>

Modified: lucene/dev/branches/bulkpostings/solr/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/contrib/dataimporthandler/CHANGES.txt?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/dev/branches/bulkpostings/solr/contrib/dataimporthandler/CHANGES.txt Mon Jan 24 14:31:59 2011
@@ -78,6 +78,8 @@ Bug Fixes
 * SOLR-2252: When a child entity in nested entities is rootEntity="true", delta-import doesn't work.
   (koji)
 
+* SOLR-2330: solrconfig.xml files in example-DIH are broken. (Matt Parker, koji)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/db/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/db/conf/solrconfig.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/db/conf/solrconfig.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/db/conf/solrconfig.xml Mon Jan 24 14:31:59 2011
@@ -17,18 +17,17 @@
 -->
 
 <config>
+  
+  <!--
+    Controls what version of Lucene various components of Solr adhere to. Generally, you want
+    to use the latest version to get all bug fixes and improvements. It is highly recommended 
+    that you fully re-index after changing this setting as it can affect both how text is indexed
+    and queried.
+  -->
+  <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
 
   <jmx />
 
-  <!-- Set this to 'false' if you want solr to continue working after it has 
-       encountered an severe configuration error.  In a production environment, 
-       you may want solr to keep working even if one handler is mis-configured.
-
-       You may also set this to false using by setting the system property:
-         -Dsolr.abortOnConfigurationError=false
-     -->
-  <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
-
   <indexDefaults>
    <!-- Values here affect all index writers and act as a default unless overridden. -->
     <useCompoundFile>false</useCompoundFile>
@@ -350,112 +349,6 @@
      </lst>
   </requestHandler>
 
-
-  <!-- DisMaxRequestHandler allows easy searching across multiple fields
-       for simple user-entered phrases. 
-       see http://wiki.apache.org/solr/DisMaxRequestHandler
-   -->
-  <requestHandler name="dismax" class="solr.DisMaxRequestHandler" >
-    <lst name="defaults">
-     <str name="echoParams">explicit</str>
-     <float name="tie">0.01</float>
-     <str name="qf">
-        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
-     </str>
-     <str name="pf">
-        text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
-     </str>
-     <str name="bf">
-        ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3
-     </str>
-     <str name="fl">
-        id,name,price,score
-     </str>
-     <str name="mm">
-        2&lt;-1 5&lt;-2 6&lt;90%
-     </str>
-     <int name="ps">100</int>
-     <str name="q.alt">*:*</str>
-     <!-- example highlighter config, enable per-query with hl=true -->     
-     <str name="hl.fl">text features name</str>
-     <!-- for this field, we want no fragmenting, just highlighting -->
-     <str name="f.name.hl.fragsize">0</str>
-     <!-- instructs Solr to return the field itself if no query terms are
-          found -->
-     <str name="f.name.hl.alternateField">name</str>
-     <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
-    </lst>
-  </requestHandler>
-
-  <!-- Note how you can register the same handler multiple times with
-       different names (and different init parameters)
-    -->
-  <requestHandler name="partitioned" class="solr.DisMaxRequestHandler" >
-    <lst name="defaults">
-     <str name="echoParams">explicit</str>
-     <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
-     <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
-     <!-- This is an example of using Date Math to specify a constantly
-          moving date range in a config...
-       -->
-     <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
-    </lst>
-    <!-- In addition to defaults, "appends" params can be specified
-         to identify values which should be appended to the list of
-         multi-val params from the query (or the existing "defaults").
-
-         In this example, the param "fq=instock:true" will be appended to
-         any query time fq params the user may specify, as a mechanism for
-         partitioning the index, independent of any user selected filtering
-         that may also be desired (perhaps as a result of faceted searching).
-
-         NOTE: there is *absolutely* nothing a client can do to prevent these
-         "appends" values from being used, so don't use this mechanism
-         unless you are sure you always want it.
-      -->
-    <lst name="appends">
-      <str name="fq">inStock:true</str>
-    </lst>
-    <!-- "invariants" are a way of letting the Solr maintainer lock down
-         the options available to Solr clients.  Any params values
-         specified here are used regardless of what values may be specified
-         in either the query, the "defaults", or the "appends" params.
-
-         In this example, the facet.field and facet.query params are fixed,
-         limiting the facets clients can use.  Faceting is not turned on by
-         default - but if the client does specify facet=true in the request,
-         these are the only facets they will be able to see counts for;
-         regardless of what other facet.field or facet.query params they
-         may specify.
-
-         NOTE: there is *absolutely* nothing a client can do to prevent these
-         "invariants" values from being used, so don't use this mechanism
-         unless you are sure you always want it.
-      -->
-    <lst name="invariants">
-      <str name="facet.field">cat</str>
-      <str name="facet.field">manu_exact</str>
-      <str name="facet.query">price:[* TO 500]</str>
-      <str name="facet.query">price:[500 TO *]</str>
-    </lst>
-  </requestHandler>
-  
-  <requestHandler name="instock" class="solr.DisMaxRequestHandler" >
-    <!-- for legacy reasons, DisMaxRequestHandler will assume all init
-         params are "defaults" if you don't explicitly specify any defaults.
-      -->
-     <str name="fq">
-        inStock:true
-     </str>
-     <str name="qf">
-        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
-     </str>
-     <str name="mm">
-        2&lt;-1 5&lt;-2 6&lt;90%
-     </str>
-  </requestHandler>
-
-
   <!-- SpellCheckerRequestHandler takes in a word (or several words) as the
        value of the "q" parameter and returns a list of alternative spelling
        suggestions.  If invoked with a ...&cmd=rebuild, it will rebuild the
@@ -575,16 +468,6 @@
     -->
   </requestHandler>
 
-  <!--
-   Analysis request handler.  Since Solr 1.3.  Use to returnhow a document is analyzed.  Useful
-   for debugging and as a token server for other types of applications
-   -->
-  <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" >
-    <!--
-    <str name="update.processor.class">org.apache.solr.handler.UpdateRequestProcessor</str>
-    -->
-  </requestHandler>
-
   <!-- CSV update handler, loaded on demand -->
   <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
 

Modified: lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/mail/conf/solrconfig.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/mail/conf/solrconfig.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/mail/conf/solrconfig.xml Mon Jan 24 14:31:59 2011
@@ -17,14 +17,14 @@
 -->
 
 <config>
-  <!-- Set this to 'false' if you want solr to continue working after it has
-       encountered an severe configuration error.  In a production environment,
-       you may want solr to keep working even if one handler is mis-configured.
-
-       You may also set this to false using by setting the system property:
-         -Dsolr.abortOnConfigurationError=false
-     -->
-  <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
+  
+  <!--
+    Controls what version of Lucene various components of Solr adhere to. Generally, you want
+    to use the latest version to get all bug fixes and improvements. It is highly recommended 
+    that you fully re-index after changing this setting as it can affect both how text is indexed
+    and queried.
+  -->
+  <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
 
   <lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*jar$" />
   <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
@@ -655,12 +655,6 @@
 
   <requestHandler name="/update/javabin" class="solr.BinaryUpdateRequestHandler" />
 
-  <!--
-   Analysis request handler.  Since Solr 1.3.  Use to returnhow a document is analyzed.  Useful
-   for debugging and as a token server for other types of applications
-   -->
-  <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
-
 
   <!-- CSV update handler, loaded on demand -->
   <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
@@ -721,7 +715,7 @@
       <!-- allow 50% slop on fragment sizes -->
       <float name="hl.regex.slop">0.5</float>
       <!-- a basic sentence pattern -->
-      <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
+      <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
     </lst>
    </fragmenter>
 

Modified: lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml Mon Jan 24 14:31:59 2011
@@ -5,17 +5,22 @@
                 pk="link"
                 url="http://rss.slashdot.org/Slashdot/slashdot"
                 processor="XPathEntityProcessor"
-                forEach="/rss/channel/item"
+                forEach="/RDF/channel | /RDF/item"
                 transformer="DateFormatTransformer">
+				
+            <field column="source" xpath="/RDF/channel/title" commonField="true" />
+            <field column="source-link" xpath="/RDF/channel/link" commonField="true" />
+            <field column="subject" xpath="/RDF/channel/subject" commonField="true" />
 			
-            <field column="title" xpath="/rss/channel/item/title" />
-            <field column="link" xpath="/rss/channel/item/link" />
-            <field column="description" xpath="/rss/channel/item/description" />
-            <field column="creator" xpath="/rss/channel/item/creator" />
-            <field column="item-subject" xpath="/rss/channel/item/subject" />
-            <field column="date" xpath="/rss/channel/item/date" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss" />
-            <field column="slash-department" xpath="/rss/channel/item/department" />
-            <field column="slash-section" xpath="/rss/channel/item/section" />
+            <field column="title" xpath="/RDF/item/title" />
+            <field column="link" xpath="/RDF/item/link" />
+            <field column="description" xpath="/RDF/item/description" />
+            <field column="creator" xpath="/RDF/item/creator" />
+            <field column="item-subject" xpath="/RDF/item/subject" />
+            <field column="date" xpath="/RDF/item/date" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss" />
+            <field column="slash-department" xpath="/RDF/item/department" />
+            <field column="slash-section" xpath="/RDF/item/section" />
+            <field column="slash-comments" xpath="/RDF/item/comments" />
         </entity>
     </document>
 </dataConfig>

Modified: lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/schema.xml?rev=1062798&r1=1062797&r2=1062798&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/schema.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/example/example-DIH/solr/rss/conf/schema.xml Mon Jan 24 14:31:59 2011
@@ -294,10 +294,11 @@
 	<field name="link" type="string" indexed="true" stored="true" />
 	<field name="description" type="html" indexed="true" stored="true" />
 	<field name="creator" type="string" indexed="false" stored="true" />
-	<field name="item-subject" type="string" indexed="true" stored="true" />
-	<field name="date" type="date" indexed="true" stored="true" />
-	<field name="slash-department" type="string" indexed="true" stored="true" />
-	<field name="slash-section" type="string" indexed="true" stored="true" />
+	<field name="item-subject" type="string" indexed="true" stored="false" />
+	<field name="date" type="date" indexed="true" stored="false" />
+	<field name="slash-department" type="string" indexed="true" stored="false" />
+	<field name="slash-section" type="string" indexed="true" stored="false" />
+	<field name="slash-comments" type="sint" indexed="true" stored="true" />
 	
 	<field name="all_text" type="text" indexed="true" stored="false" multiValued="true" />
 	<copyField source="source" dest="all_text" />



Mime
View raw message