lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1578133 [1/11] - in /lucene/dev/branches/lucene5376_2/lucene: ./ analysis/common/src/java/org/apache/lucene/analysis/charfilter/ analysis/common/src/java/org/apache/lucene/analysis/pattern/ analysis/common/src/java/org/apache/lucene/analys...
Date Sun, 16 Mar 2014 18:11:10 GMT
Author: mikemccand
Date: Sun Mar 16 18:11:07 2014
New Revision: 1578133

URL: http://svn.apache.org/r1578133
Log:
LUCENE-5376: carry over last branch

Added:
    lucene/dev/branches/lucene5376_2/lucene/server/
    lucene/dev/branches/lucene5376_2/lucene/server/build.xml   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/ivy.xml   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/BlockingThreadPoolExecutor.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Constants.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/DirectoryFactory.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDef.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDefBindings.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FinishRequest.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FromFileTermFreqIterator.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/GenFileUtil.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/GlobalState.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/IndexState.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/MyIndexSearcher.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Pipe.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/PreHandle.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/SVJSONPassageFormatter.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Server.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/ServerCodec.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/StringLiveFieldValues.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/WholeMVJSONPassageFormatter.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/AddDocumentHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/AddDocumentsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/AnalysisHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/BuildSuggestHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/BulkAddDocumentHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/BulkAddDocumentsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/BulkUpdateDocumentHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/BulkUpdateDocumentsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/CannedScorer.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/CommitHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/CreateIndexHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/CreateSnapshotHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/DeleteAllDocumentsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/DeleteDocumentsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/DeleteIndexHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/DocHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/GetCommitUserDataHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/Handler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/LiveSettingsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/LiveValuesHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/RAMResourceLoaderWrapper.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/RegisterFieldHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/ReleaseSnapshotHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/SearchHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/SetCommitUserDataHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/SettingsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/ShutdownHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/StartIndexHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/StatsHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/StopIndexHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/SuggestLookupHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/UpdateDocumentHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/UpdateSuggestHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/handlers/package.html   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/http/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/http/HttpStaticFileServerHandler.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/http/package.html   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/package.html   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/AnyType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/BooleanType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/EnumType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/FloatType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/IntType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/ListType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/LongType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/OrType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/Param.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/PolyType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/Request.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/RequestFailedException.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/StringType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/StructType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/Type.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/WrapType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/params/package.html   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/plugins/
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/plugins/Plugin.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/plugins/package.html   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/java/overview.html   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/resources/
    lucene/dev/branches/lucene5376_2/lucene/server/src/resources/META-INF/
    lucene/dev/branches/lucene5376_2/lucene/server/src/resources/META-INF/services/
    lucene/dev/branches/lucene5376_2/lucene/server/src/resources/META-INF/services/org.apache.lucene.codecs.Codec
    lucene/dev/branches/lucene5376_2/lucene/server/src/scripts/
    lucene/dev/branches/lucene5376_2/lucene/server/src/scripts/another-post.py   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/scripts/loadTest2.py   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/scripts/post.py   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/MockPlugin-hello.txt
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/MockPlugin-lucene-server-plugin.properties   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/MockPlugin.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/ServerBaseTestCase.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TermFreqPayload.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestAddDocuments.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestAnalysis.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestBlockJoinQuery.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestBooleanFieldType.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestCommitUserData.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestCustomDirectory.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestFacets.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestGrouping.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestHighlight.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestIndexing.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestLiveValues.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestNumericFields.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestPlugins.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestSearch.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestServer.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestSettings.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestSimpleSpatial.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestSnapshots.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestSort.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestSuggest.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/server/src/test/org/apache/lucene/server/TestVirtualFields.java   (with props)
    lucene/dev/branches/lucene5376_2/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/SuggestStopFilterFactory.java   (with props)
Modified:
    lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/MappingCharFilterFactory.java
    lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternReplaceCharFilterFactory.java
    lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java
    lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java
    lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java
    lucene/dev/branches/lucene5376_2/lucene/build.xml
    lucene/dev/branches/lucene5376_2/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
    lucene/dev/branches/lucene5376_2/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
    lucene/dev/branches/lucene5376_2/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java
    lucene/dev/branches/lucene5376_2/lucene/highlighter/build.xml
    lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/MultiTermHighlighting.java
    lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java
    lucene/dev/branches/lucene5376_2/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestMultiTermHighlighting.java
    lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java
    lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
    lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java
    lucene/dev/branches/lucene5376_2/lucene/module-build.xml
    lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyRevision.java
    lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexRevision.java
    lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/LocalReplicator.java
    lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Replicator.java
    lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Revision.java
    lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/http/ReplicationService.java
    lucene/dev/branches/lucene5376_2/lucene/suggest/build.xml
    lucene/dev/branches/lucene5376_2/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingInfixSuggester.java

Modified: lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/MappingCharFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/MappingCharFilterFactory.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/MappingCharFilterFactory.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/MappingCharFilterFactory.java Sun Mar 16 18:11:07 2014
@@ -55,7 +55,7 @@ public class MappingCharFilterFactory ex
     super(args);
     mapping = get(args, "mapping");
     if (!args.isEmpty()) {
-      throw new IllegalArgumentException("Unknown parameters: " + args);
+      throw new IllegalArgumentException("Unknown parameters: " + args + "; valid parameters: mapping, luceneMatchVersion, class");
     }
   }
 
@@ -94,30 +94,32 @@ public class MappingCharFilterFactory ex
   }
 
   // "source" => "target"
-  static Pattern p = Pattern.compile( "\"(.*)\"\\s*=>\\s*\"(.*)\"\\s*$" );
+  static Pattern p = Pattern.compile("\"(.*)\"\\s*=>\\s*\"(.*)\"\\s*$");
 
-  protected void parseRules( List<String> rules, NormalizeCharMap.Builder builder ){
-    for( String rule : rules ){
-      Matcher m = p.matcher( rule );
-      if( !m.find() )
-        throw new IllegalArgumentException("Invalid Mapping Rule : [" + rule + "], file = " + mapping);
-      builder.add( parseString( m.group( 1 ) ), parseString( m.group( 2 ) ) );
+  protected void parseRules(List<String> rules, NormalizeCharMap.Builder builder) {
+    for(String rule : rules) {
+      Matcher m = p.matcher(rule);
+      if (m.find() == false) {
+        throw new IllegalArgumentException("Invalid Mapping Rule \"" + rule + "\" (file=\"" + mapping + "\"); should be form \"xxx\" => \"yyy\"");
+      }
+      builder.add(parseString(m.group(1)), parseString(m.group(2)));
     }
   }
 
   char[] out = new char[256];
   
-  protected String parseString( String s ){
+  protected String parseString(String s) {
     int readPos = 0;
     int len = s.length();
     int writePos = 0;
-    while( readPos < len ){
-      char c = s.charAt( readPos++ );
-      if( c == '\\' ){
-        if( readPos >= len )
+    while (readPos < len) {
+      char c = s.charAt(readPos++);
+      if (c == '\\') {
+        if (readPos >= len) {
           throw new IllegalArgumentException("Invalid escaped char in [" + s + "]");
-        c = s.charAt( readPos++ );
-        switch( c ) {
+        }
+        c = s.charAt(readPos++);
+        switch(c) {
           case '\\' : c = '\\'; break;
           case '"' : c = '"'; break;
           case 'n' : c = '\n'; break;
@@ -126,16 +128,17 @@ public class MappingCharFilterFactory ex
           case 'b' : c = '\b'; break;
           case 'f' : c = '\f'; break;
           case 'u' :
-            if( readPos + 3 >= len )
+            if (readPos + 3 >= len) {
               throw new IllegalArgumentException("Invalid escaped char in [" + s + "]");
-            c = (char)Integer.parseInt( s.substring( readPos, readPos + 4 ), 16 );
+            }
+            c = (char) Integer.parseInt(s.substring(readPos, readPos + 4 ), 16);
             readPos += 4;
             break;
         }
       }
       out[writePos++] = c;
     }
-    return new String( out, 0, writePos );
+    return new String(out, 0, writePos);
   }
 
   @Override

Modified: lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternReplaceCharFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternReplaceCharFilterFactory.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternReplaceCharFilterFactory.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternReplaceCharFilterFactory.java Sun Mar 16 18:11:07 2014
@@ -47,7 +47,7 @@ public class PatternReplaceCharFilterFac
     pattern = getPattern(args, "pattern");
     replacement = get(args, "replacement", "");
     if (!args.isEmpty()) {
-      throw new IllegalArgumentException("Unknown parameters: " + args);
+      throw new IllegalArgumentException("Unknown parameters: " + args + "; valid parameters: pattern, replacement, luceneMatchVersion, class");
     }
   }
 

Modified: lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java Sun Mar 16 18:11:07 2014
@@ -17,13 +17,14 @@ package org.apache.lucene.analysis.util;
  * limitations under the License.
  */
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
-import java.util.LinkedHashMap;
-import java.util.Set;
 import java.util.ServiceConfigurationError;
+import java.util.Set;
 
 import org.apache.lucene.util.SPIClassIterator;
 
@@ -108,6 +109,18 @@ final class AnalysisSPILoader<S extends 
     final Class<? extends S> service = lookupClass(name);
     try {
       return service.getConstructor(Map.class).newInstance(args);
+    } catch (InvocationTargetException ite) {
+      Throwable cause = ite.getCause();
+      if (cause instanceof RuntimeException) {
+        throw (RuntimeException) cause;
+      }
+      if (cause instanceof Error) {
+        throw (Error) cause;
+      }
+      // TODO: AssertionError?  It's invalid for analysis
+      // factories to throw checked exc...
+      throw new IllegalArgumentException("SPI class of type "+clazz.getName()+" with name '"+name+"' cannot be instantiated. " +
+            "This is likely due to a misconfiguration of the java class '" + service.getName() + "': ", ite);
     } catch (Exception e) {
       throw new IllegalArgumentException("SPI class of type "+clazz.getName()+" with name '"+name+"' cannot be instantiated. " +
             "This is likely due to a misconfiguration of the java class '" + service.getName() + "': ", e);
@@ -120,7 +133,7 @@ final class AnalysisSPILoader<S extends 
       return service;
     } else {
       throw new IllegalArgumentException("A SPI class of type "+clazz.getName()+" with name '"+name+"' does not exist. "+
-          "You need to add the corresponding JAR file supporting this SPI to your classpath."+
+          "You need to add the corresponding JAR file supporting this SPI to your classpath. "+
           "The current classpath supports the following names: "+availableServices());
     }
   }

Modified: lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java Sun Mar 16 18:11:07 2014
@@ -24,7 +24,7 @@ package org.apache.lucene.analysis.util;
  * @lucene.experimental
  */
 public interface MultiTermAwareComponent {
-  /** Returns an analysis component to handle analysis if multi-term queries.
+  /** Returns an analysis component to handle analysis of multi-term queries.
    * The returned component must be a TokenizerFactory, TokenFilterFactory or CharFilterFactory.
    */
   public AbstractAnalysisFactory getMultiTermComponent();

Modified: lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java Sun Mar 16 18:11:07 2014
@@ -104,6 +104,7 @@ public class TestAllAnalyzersHaveFactori
     List<Class<?>> analysisClasses = TestRandomChains.getClassesForPackage("org.apache.lucene.analysis");
     
     for (final Class<?> c : analysisClasses) {
+      // nocommit can we avoid deprecated components...
       final int modifiers = c.getModifiers();
       if (
         // don't waste time with abstract classes
@@ -133,7 +134,10 @@ public class TestAllAnalyzersHaveFactori
           }
           assertSame(c, instance.create().getClass());
         } catch (IllegalArgumentException e) {
-          if (!e.getMessage().contains("SPI")) {
+          // nocommit does this really catch a missing
+          // factory!?  the exc message on a missing factory
+          // contains SPI ...
+          if (!e.getMessage().contains("missing parameter") && !e.getMessage().contains("SPI")) {
             throw e;
           }
           // TODO: For now pass because some factories have not yet a default config that always works
@@ -155,7 +159,10 @@ public class TestAllAnalyzersHaveFactori
             assertSame(c, createdClazz);
           }
         } catch (IllegalArgumentException e) {
-          if (!e.getMessage().contains("SPI")) {
+          // nocommit does this really catch a missing
+          // factory!?  the exc message on a missing factory
+          // contains SPI ...
+          if (!e.getMessage().contains("missing parameter") && !e.getMessage().contains("SPI")) {
             throw e;
           }
           // TODO: For now pass because some factories have not yet a default config that always works
@@ -177,7 +184,10 @@ public class TestAllAnalyzersHaveFactori
             assertSame(c, createdClazz);
           }
         } catch (IllegalArgumentException e) {
-          if (!e.getMessage().contains("SPI")) {
+          // nocommit does this really catch a missing
+          // factory!?  the exc message on a missing factory
+          // contains SPI ...
+          if (!e.getMessage().contains("missing parameter") && !e.getMessage().contains("SPI")) {
             throw e;
           }
           // TODO: For now pass because some factories have not yet a default config that always works

Modified: lucene/dev/branches/lucene5376_2/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/build.xml?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/build.xml (original)
+++ lucene/dev/branches/lucene5376_2/lucene/build.xml Sun Mar 16 18:11:07 2014
@@ -249,6 +249,7 @@
     <!-- queries: problems -->
     <!-- queryparser: problems -->
     <!-- sandbox: problems -->
+    <check-missing-javadocs dir="build/docs/server" level="method"/>
     <!-- spatial: problems -->
     <check-missing-javadocs dir="build/docs/suggest" level="method"/>
     <!-- test-framework: problems -->

Modified: lucene/dev/branches/lucene5376_2/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/core/src/java/org/apache/lucene/index/PersistentSnapshotDeletionPolicy.java Sun Mar 16 18:11:07 2014
@@ -31,6 +31,7 @@ import org.apache.lucene.store.Directory
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
+import org.apache.lucene.store.NoSuchDirectoryException;
 import org.apache.lucene.util.IOUtils;
 
 /**
@@ -111,9 +112,12 @@ public class PersistentSnapshotDeletionP
 
     loadPriorSnapshots();
 
-    if (mode == OpenMode.APPEND && nextWriteGen == 0) {
-      throw new IllegalStateException("no snapshots stored in this directory");
-    }
+    // nocommit this seems overly anal?  it could simply be
+    // i'm opening a prior index but had never taken a
+    // snapshot in it?
+    //if (mode == OpenMode.APPEND && nextWriteGen == 0) {
+    //throw new IllegalStateException("no snapshots stored in this directory");
+    //}
   }
 
   /**
@@ -215,7 +219,15 @@ public class PersistentSnapshotDeletionP
   }
 
   private synchronized void clearPriorSnapshots() throws IOException {
-    for(String file : dir.listAll()) {
+    String[] files;
+    try {
+      files = dir.listAll();
+    } catch (NoSuchDirectoryException nsde) {
+      // It's OK if the directory doesn't exist yet; this
+      // just means there's nothing to clear:
+      return;
+    }
+    for(String file : files) {
       if (file.startsWith(SNAPSHOTS_PREFIX)) {
         dir.deleteFile(file);
       }
@@ -242,7 +254,15 @@ public class PersistentSnapshotDeletionP
     long genLoaded = -1;
     IOException ioe = null;
     List<String> snapshotFiles = new ArrayList<String>();
-    for(String file : dir.listAll()) {
+    String[] files;
+    try {
+      files = dir.listAll();
+    } catch (NoSuchDirectoryException nsde) {
+      // It's OK if the directory doesn't exist yet; this
+      // just means there's nothing to load:
+      return;      
+    }
+    for(String file : files) {
       if (file.startsWith(SNAPSHOTS_PREFIX)) {
         long gen = Long.parseLong(file.substring(SNAPSHOTS_PREFIX.length()));
         if (genLoaded == -1 || gen > genLoaded) {

Modified: lucene/dev/branches/lucene5376_2/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/core/src/test/org/apache/lucene/index/TestPersistentSnapshotDeletionPolicy.java Sun Mar 16 18:11:07 2014
@@ -100,19 +100,6 @@ public class TestPersistentSnapshotDelet
     dir.close();
   }
 
-  @Test
-  public void testMissingSnapshots() throws Exception {
-    Directory dir = newDirectory();
-    try {
-      new PersistentSnapshotDeletionPolicy(
-                                           new KeepOnlyLastCommitDeletionPolicy(), dir, OpenMode.APPEND);
-      fail("did not hit expected exception");
-    } catch (IllegalStateException ise) {
-      // expected
-    }
-    dir.close();
-  }
-
   public void testExceptionDuringSave() throws Exception {
     MockDirectoryWrapper dir = newMockDirectory();
     dir.failOn(new MockDirectoryWrapper.Failure() {

Modified: lucene/dev/branches/lucene5376_2/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java Sun Mar 16 18:11:07 2014
@@ -994,13 +994,15 @@ public class DirectoryTaxonomyWriter imp
   }
   
   /**
-   * Used by {@link DirectoryTaxonomyReader} to support NRT.
+   * Expert: used by {@link DirectoryTaxonomyReader} to support NRT.
    * <p>
    * <b>NOTE:</b> you should not use the obtained {@link IndexWriter} in any
    * way, other than opening an IndexReader on it, or otherwise, the taxonomy
    * index may become corrupt!
+   *
+   * @lucene.internal
    */
-  final IndexWriter getInternalIndexWriter() {
+  public final IndexWriter getInternalIndexWriter() {
     return indexWriter;
   }
   

Modified: lucene/dev/branches/lucene5376_2/lucene/highlighter/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/highlighter/build.xml?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/highlighter/build.xml (original)
+++ lucene/dev/branches/lucene5376_2/lucene/highlighter/build.xml Sun Mar 16 18:11:07 2014
@@ -31,11 +31,13 @@
   <path id="classpath">
     <pathelement path="${memory.jar}"/>
     <pathelement path="${queries.jar}"/>
+    <pathelement path="${join.jar}"/>
+    <pathelement path="${grouping.jar}"/>
     <path refid="base.classpath"/>
   </path>
 
-  <target name="compile-core" depends="jar-memory, common.compile-core" />
-  <target name="javadocs" depends="javadocs-memory,compile-core">
+  <target name="compile-core" depends="jar-memory,jar-join,jar-grouping,common.compile-core" />
+  <target name="javadocs" depends="javadocs-memory,javadocs-join,javadocs-grouping,compile-core">
     <invoke-module-javadoc>
       <links>
         <link href="../memory"/>

Modified: lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/MultiTermHighlighting.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/MultiTermHighlighting.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/MultiTermHighlighting.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/MultiTermHighlighting.java Sun Mar 16 18:11:07 2014
@@ -36,6 +36,8 @@ import org.apache.lucene.search.FuzzyQue
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermRangeQuery;
+import org.apache.lucene.search.join.ToChildBlockJoinQuery;
+import org.apache.lucene.search.join.ToParentBlockJoinQuery;
 import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
 import org.apache.lucene.search.spans.SpanNearQuery;
 import org.apache.lucene.search.spans.SpanNotQuery;
@@ -184,7 +186,16 @@ class MultiTermHighlighting {
           }
         });
       }
+    // nocommit we could add an interface, which a given
+    // Query impl would optionally implement, to
+    // extractQueries?  then we don't need hard deps on all
+    // the world's queries:
+    } else if (query instanceof ToParentBlockJoinQuery) {
+      list.addAll(Arrays.asList(extractAutomata(((ToParentBlockJoinQuery) query).getChildQuery(), field)));
+    } else if (query instanceof ToChildBlockJoinQuery) {
+      list.addAll(Arrays.asList(extractAutomata(((ToChildBlockJoinQuery) query).getParentQuery(), field)));
     }
+
     return list.toArray(new CharacterRunAutomaton[list.size()]);
   }
   
@@ -198,7 +209,7 @@ class MultiTermHighlighting {
     final CharTermAttribute charTermAtt = ts.addAttribute(CharTermAttribute.class);
     final OffsetAttribute offsetAtt = ts.addAttribute(OffsetAttribute.class);
     ts.reset();
-    
+
     // TODO: we could use CachingWrapperFilter, (or consume twice) to allow us to have a true freq()
     // but this would have a performance cost for likely little gain in the user experience, it
     // would only serve to make this method less bogus.

Modified: lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java Sun Mar 16 18:11:07 2014
@@ -298,7 +298,7 @@ public class PostingsHighlighter {
    * @throws IllegalArgumentException if <code>field</code> was indexed without 
    *         {@link IndexOptions#DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS}
    */
-  public Map<String,String[]> highlightFields(String fieldsIn[], Query query, IndexSearcher searcher, int[] docidsIn, int maxPassagesIn[]) throws IOException {
+  public Map<String,String[]> highlightFields(String fieldsIn[], Query query, IndexSearcher searcher, int docidsIn[], int maxPassagesIn[]) throws IOException {
     Map<String,String[]> snippets = new HashMap<String,String[]>();
     for(Map.Entry<String,Object[]> ent : highlightFieldsAsObjects(fieldsIn, query, searcher, docidsIn, maxPassagesIn).entrySet()) {
       Object[] snippetObjects = ent.getValue();
@@ -337,7 +337,7 @@ public class PostingsHighlighter {
    * @throws IllegalArgumentException if <code>field</code> was indexed without 
    *         {@link IndexOptions#DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS}
    */
-  protected Map<String,Object[]> highlightFieldsAsObjects(String fieldsIn[], Query query, IndexSearcher searcher, int[] docidsIn, int maxPassagesIn[]) throws IOException {
+  protected Map<String,Object[]> highlightFieldsAsObjects(String fieldsIn[], Query query, IndexSearcher searcher, int docidsIn[], int maxPassagesIn[]) throws IOException {
     if (fieldsIn.length < 1) {
       throw new IllegalArgumentException("fieldsIn must not be empty");
     }

Modified: lucene/dev/branches/lucene5376_2/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestMultiTermHighlighting.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestMultiTermHighlighting.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestMultiTermHighlighting.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/highlighter/src/test/org/apache/lucene/search/postingshighlight/TestMultiTermHighlighting.java Sun Mar 16 18:11:07 2014
@@ -17,6 +17,10 @@ package org.apache.lucene.search.posting
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.MockTokenizer;
@@ -24,24 +28,34 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.DisjunctionMaxQuery;
+import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.FuzzyQuery;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.PrefixQuery;
 import org.apache.lucene.search.Query;
+import org.apache.lucene.search.QueryWrapperFilter;
 import org.apache.lucene.search.RegexpQuery;
 import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.WildcardQuery;
+import org.apache.lucene.search.grouping.GroupDocs;
+import org.apache.lucene.search.grouping.TopGroups;
+import org.apache.lucene.search.join.FixedBitSetCachingWrapperFilter;
+import org.apache.lucene.search.join.ScoreMode;
+import org.apache.lucene.search.join.ToChildBlockJoinQuery;
+import org.apache.lucene.search.join.ToParentBlockJoinCollector;
+import org.apache.lucene.search.join.ToParentBlockJoinQuery;
 import org.apache.lucene.search.spans.SpanFirstQuery;
 import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
 import org.apache.lucene.search.spans.SpanNearQuery;
@@ -50,8 +64,8 @@ import org.apache.lucene.search.spans.Sp
 import org.apache.lucene.search.spans.SpanQuery;
 import org.apache.lucene.search.spans.SpanTermQuery;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+import org.apache.lucene.util.LuceneTestCase;
 
 /** 
  * Some tests that override {@link PostingsHighlighter#getIndexAnalyzer} to
@@ -794,4 +808,78 @@ public class TestMultiTermHighlighting e
     ir.close();
     dir.close();
   }
+
+  public void testWildcardWithJoins() throws Exception {
+    Directory dir = newDirectory();
+    final Analyzer analyzer = new MockAnalyzer(random());
+    RandomIndexWriter w = new RandomIndexWriter(random(), dir, analyzer);
+    List<Document> docs = new ArrayList<Document>();
+    Document child = new Document();
+    child.add(newTextField("body", "something to highlight here", Field.Store.YES));
+    docs.add(child);
+
+    Document parent = new Document();
+    parent.add(newStringField("isParent", "yes", Field.Store.NO));
+    parent.add(newTextField("parentBody", "something else to highlight here", Field.Store.YES));
+    docs.add(parent);
+
+    w.addDocuments(docs);
+    IndexReader r = w.getReader();
+    w.close();
+    IndexSearcher s = newSearcher(r);
+
+    Filter parentsFilter = new FixedBitSetCachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("isParent", "yes"))));
+
+    PostingsHighlighter highlighter = new PostingsHighlighter() {
+        // Must override this else no MTQ highlights:
+        @Override
+        protected Analyzer getIndexAnalyzer(String field) {
+          return analyzer;
+        }
+      };
+
+    // To parent join:
+    {
+      Query childQuery = new WildcardQuery(new Term("body", "high*"));
+      ToParentBlockJoinQuery parentQuery = new ToParentBlockJoinQuery(childQuery, parentsFilter, ScoreMode.Max);
+      ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(Sort.RELEVANCE, 10, true, true);
+      s.search(parentQuery, c);
+      TopGroups<Integer> groups = c.getTopGroups(parentQuery, Sort.RELEVANCE, 0, 10, 0, true);
+      assertEquals(1, groups.totalGroupCount.intValue());
+      assertEquals(1, groups.groups.length);
+
+      GroupDocs<Integer> group = groups.groups[0];
+      assertEquals(1, group.totalHits);
+      assertEquals(1, group.scoreDocs.length);
+
+      int[] docIDs = new int[] {group.scoreDocs[0].doc};
+
+      Map<String,String[]> highlights = highlighter.highlightFields(new String[] {"body"}, parentQuery, s, docIDs, new int[] {2});
+      assertEquals(1, highlights.size());
+      String[] snippets = highlights.get("body");
+      assertNotNull(snippets);
+      assertEquals(1, snippets.length);
+      assertEquals("something to <b>highlight</b> here", snippets[0]);
+    }
+
+    // To child join:
+    {
+      Query parentQuery = new WildcardQuery(new Term("parentBody", "high*"));
+      ToChildBlockJoinQuery childQuery = new ToChildBlockJoinQuery(parentQuery, parentsFilter, random().nextBoolean());
+      TopDocs hits = s.search(childQuery, 10);
+      assertEquals(1, hits.totalHits);
+
+      // Parent doc is 1+ child doc:
+      int[] docIDs = new int[] {hits.scoreDocs[0].doc+1};
+      Map<String,String[]> highlights = highlighter.highlightFields(new String[] {"parentBody"}, childQuery, s, docIDs, new int[] {2});
+      assertEquals(1, highlights.size());
+      String[] snippets = highlights.get("parentBody");
+      assertNotNull(snippets);
+      assertEquals(1, snippets.length);
+      assertEquals("something else to <b>highlight</b> here", snippets[0]);
+    }
+    
+    r.close();
+    dir.close();
+  }
 }

Modified: lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java Sun Mar 16 18:11:07 2014
@@ -87,6 +87,11 @@ public class ToChildBlockJoinQuery exten
     this.doScores = doScores;
   }
 
+  /** Returns the parent query passed during init. */
+  public Query getParentQuery() {
+    return parentQuery;
+  }
+
   @Override
   public Weight createWeight(IndexSearcher searcher) throws IOException {
     return new ToChildBlockJoinWeight(this, parentQuery.createWeight(searcher), parentsFilter, doScores);

Modified: lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java Sun Mar 16 18:11:07 2014
@@ -96,7 +96,12 @@ public class ToParentBlockJoinCollector 
   private boolean queueFull;
 
   private OneGroup bottom;
+
+  /** This is really the total group count, in the returned
+   *  TopGroups, since each parent is one group containging
+   *  its child docs. */
   private int totalHitCount;
+
   private float maxScore = Float.NaN;
 
   /**  Creates a ToParentBlockJoinCollector.  The provided sort must
@@ -487,17 +492,20 @@ public class ToParentBlockJoinCollector 
       final TopDocs topDocs = collector.topDocs(withinGroupOffset, numDocsInGroup);
 
       groups[groupIDX-offset] = new GroupDocs<>(og.score,
-                                                       topDocs.getMaxScore(),
-                                                       numChildDocs,
-                                                       topDocs.scoreDocs,
-                                                       og.doc,
-                                                       groupSortValues);
+                                                topDocs.getMaxScore(),
+                                                numChildDocs,
+                                                topDocs.scoreDocs,
+                                                og.doc,
+                                                groupSortValues);
     }
 
+    // We must pass 0 for totalHitCount, since for each
+    // collected parent doc we don't go and sum the child
+    // doc count for all sub-queries:
     return new TopGroups<>(new TopGroups<>(sort.getSort(),
-                                                       withinGroupSort == null ? null : withinGroupSort.getSort(),
-                                                       0, totalGroupedHitCount, groups, maxScore),
-                                  totalHitCount);
+                                           withinGroupSort == null ? null : withinGroupSort.getSort(),
+                                           0, totalGroupedHitCount, groups, maxScore),
+                           totalHitCount);
   }
 
   /** Returns the TopGroups for the specified BlockJoinQuery.

Modified: lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java Sun Mar 16 18:11:07 2014
@@ -449,6 +449,11 @@ public class ToParentBlockJoinQuery exte
     childQuery.extractTerms(terms);
   }
 
+  /** Returns the child query passed during init. */
+  public Query getChildQuery() {
+    return childQuery;
+  }
+
   @Override
   public Query rewrite(IndexReader reader) throws IOException {
     final Query childRewrite = childQuery.rewrite(reader);

Modified: lucene/dev/branches/lucene5376_2/lucene/module-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/module-build.xml?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/module-build.xml (original)
+++ lucene/dev/branches/lucene5376_2/lucene/module-build.xml Sun Mar 16 18:11:07 2014
@@ -476,6 +476,17 @@
     <property name="grouping-javadocs.uptodate" value="true"/>
   </target>
 
+  <property name="join-javadoc.jar" value="${common.dir}/build/join/lucene-join-${version}-javadoc.jar"/>
+  <target name="check-join-javadocs-uptodate" unless="join-javadocs.uptodate">
+    <module-uptodate name="join" jarfile="${join-javadoc.jar}" property="join-javadocs.uptodate"/>
+  </target>
+  <target name="javadocs-join" unless="join-javadocs.uptodate" depends="check-join-javadocs-uptodate">
+    <ant dir="${common.dir}/join" target="javadocs" inheritAll="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </ant>
+    <property name="join-javadocs.uptodate" value="true"/>
+  </target>
+
   <property name="highlighter.jar" value="${common.dir}/build/highlighter/lucene-highlighter-${version}.jar"/>
   <target name="check-highlighter-uptodate" unless="highlighter.uptodate">
     <module-uptodate name="highlighter" jarfile="${highlighter.jar}" property="highlighter.uptodate"/>

Modified: lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyRevision.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyRevision.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyRevision.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexAndTaxonomyRevision.java Sun Mar 16 18:11:07 2014
@@ -47,7 +47,7 @@ import org.apache.lucene.store.IOContext
 public class IndexAndTaxonomyRevision implements Revision {
   
   /**
-   * A {@link DirectoryTaxonomyWriter} which sets the underlying
+   * A utility class creating a {@link DirectoryTaxonomyWriter} and setting the underlying
    * {@link IndexWriter}'s {@link IndexDeletionPolicy} to
    * {@link SnapshotDeletionPolicy}.
    */
@@ -55,7 +55,7 @@ public class IndexAndTaxonomyRevision im
     
     private SnapshotDeletionPolicy sdp;
     private IndexWriter writer;
-    
+
     /**
      * @see DirectoryTaxonomyWriter#DirectoryTaxonomyWriter(Directory,
      *      IndexWriterConfig.OpenMode, TaxonomyWriterCache)
@@ -93,12 +93,6 @@ public class IndexAndTaxonomyRevision im
     public SnapshotDeletionPolicy getDeletionPolicy() {
       return sdp;
     }
-    
-    /** Returns the {@link IndexWriter} used by this {@link DirectoryTaxonomyWriter}. */
-    public IndexWriter getIndexWriter() {
-      return writer;
-    }
-    
   }
   
   private static final int RADIX = 16;
@@ -107,7 +101,7 @@ public class IndexAndTaxonomyRevision im
   public static final String TAXONOMY_SOURCE = "taxo";
   
   private final IndexWriter indexWriter;
-  private final SnapshotDirectoryTaxonomyWriter taxoWriter;
+  private final DirectoryTaxonomyWriter taxoWriter;
   private final IndexCommit indexCommit, taxoCommit;
   private final SnapshotDeletionPolicy indexSDP, taxoSDP;
   private final String version;
@@ -135,7 +129,7 @@ public class IndexAndTaxonomyRevision im
    * {@link IndexCommit} found in the {@link Directory} managed by the given
    * writer.
    */
-  public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)
+  public IndexAndTaxonomyRevision(IndexWriter indexWriter, DirectoryTaxonomyWriter taxoWriter)
       throws IOException {
     IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();
     if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
@@ -143,8 +137,13 @@ public class IndexAndTaxonomyRevision im
     }
     this.indexWriter = indexWriter;
     this.taxoWriter = taxoWriter;
+
     this.indexSDP = (SnapshotDeletionPolicy) delPolicy;
-    this.taxoSDP = taxoWriter.getDeletionPolicy();
+    delPolicy = taxoWriter.getInternalIndexWriter().getConfig().getIndexDeletionPolicy();
+    if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
+      throw new IllegalArgumentException("DirectoryTaxonomyWriter must be created with SnapshotDeletionPolicy");
+    }
+    this.taxoSDP = (SnapshotDeletionPolicy) delPolicy;
     this.indexCommit = indexSDP.snapshot();
     this.taxoCommit = taxoSDP.snapshot();
     this.version = revisionVersion(indexCommit, taxoCommit);
@@ -206,7 +205,7 @@ public class IndexAndTaxonomyRevision im
     try {
       indexWriter.deleteUnusedFiles();
     } finally {
-      taxoWriter.getIndexWriter().deleteUnusedFiles();
+      taxoWriter.getInternalIndexWriter().deleteUnusedFiles();
     }
   }
   

Modified: lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexRevision.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexRevision.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexRevision.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/IndexRevision.java Sun Mar 16 18:11:07 2014
@@ -95,6 +95,10 @@ public class IndexRevision implements Re
    * {@link IndexCommit} found in the {@link Directory} managed by the given
    * writer.
    */
+  // nocommit: accept an incoming IndexCommit?  so we can
+  // replicate a specific snapshot
+  // nocommit: we could "in theory" allow replication w/o
+  // committing ... NRT replication
   public IndexRevision(IndexWriter writer) throws IOException {
     IndexDeletionPolicy delPolicy = writer.getConfig().getIndexDeletionPolicy();
     if (!(delPolicy instanceof SnapshotDeletionPolicy)) {
@@ -135,6 +139,9 @@ public class IndexRevision implements Re
     assert source.equals(SOURCE) : "invalid source; expected=" + SOURCE + " got=" + source;
     return new IndexInputInputStream(commit.getDirectory().openInput(fileName, IOContext.READONCE));
   }
+
+  // nocommit maybe some safety around this?  if (released
+  // == false) { sdp.release(commit) };
   
   @Override
   public void release() throws IOException {

Modified: lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/LocalReplicator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/LocalReplicator.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/LocalReplicator.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/LocalReplicator.java Sun Mar 16 18:11:07 2014
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -111,18 +112,16 @@ public class LocalReplicator implements 
   private final Map<String, ReplicationSession> sessions = new HashMap<String, ReplicationSession>();
   
   private void checkExpiredSessions() throws IOException {
-    // make a "to-delete" list so we don't risk deleting from the map while iterating it
-    final ArrayList<ReplicationSession> toExpire = new ArrayList<ReplicationSession>();
-    for (ReplicationSession token : sessions.values()) {
+    Iterator<ReplicationSession> it = sessions.values().iterator();
+    while (it.hasNext()) {
+      ReplicationSession token = it.next();
       if (token.isExpired(expirationThresholdMilllis)) {
-        toExpire.add(token);
+        token.revision.decRef();
+        it.remove();
       }
     }
-    for (ReplicationSession token : toExpire) {
-      releaseSession(token.session.id);
-    }
   }
-  
+
   private void releaseSession(String sessionID) throws IOException {
     ReplicationSession session = sessions.remove(sessionID);
     // if we're called concurrently by close() and release(), could be that one
@@ -194,7 +193,7 @@ public class LocalReplicator implements 
       throw new SessionExpiredException("session (" + sessionID + ") expired while obtaining file: source=" + source
           + " file=" + fileName);
     }
-    sessions.get(sessionID).markAccessed();
+    session.markAccessed();
     return session.revision.revision.open(source, fileName);
   }
   

Modified: lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Replicator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Replicator.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Replicator.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Replicator.java Sun Mar 16 18:11:07 2014
@@ -33,7 +33,7 @@ import java.io.InputStream;
  * <p>
  * A client is always updated to the newest revision available. That is, if a
  * client is on revision <em>r1</em> and revisions <em>r2</em> and <em>r3</em>
- * were published, then when the cllient will next check for update, it will
+ * were published, then when the client will next check for update, it will
  * receive <em>r3</em>.
  * 
  * @lucene.experimental

Modified: lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Revision.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Revision.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Revision.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/Revision.java Sun Mar 16 18:11:07 2014
@@ -61,7 +61,7 @@ public interface Revision extends Compar
   
   /**
    * Returns an {@link IndexInput} for the given fileName and source. It is the
-   * caller's respnsibility to close the {@link IndexInput} when it has been
+   * caller's responsibility to close the {@link IndexInput} when it has been
    * consumed.
    */
   public InputStream open(String source, String fileName) throws IOException;

Modified: lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/http/ReplicationService.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/http/ReplicationService.java?rev=1578133&r1=1578132&r2=1578133&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/http/ReplicationService.java (original)
+++ lucene/dev/branches/lucene5376_2/lucene/replicator/src/java/org/apache/lucene/replicator/http/ReplicationService.java Sun Mar 16 18:11:07 2014
@@ -172,7 +172,7 @@ public class ReplicationService {
           if (token == null) {
             resOut.write(0); // marker for null token
           } else {
-            resOut.write(1); // marker for null token
+            resOut.write(1); // marker for non-null token
             token.serialize(new DataOutputStream(resOut));
           }
           break;

Added: lucene/dev/branches/lucene5376_2/lucene/server/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/build.xml?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/build.xml (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/build.xml Sun Mar 16 18:11:07 2014
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+ 
+        http://www.apache.org/licenses/LICENSE-2.0
+ 
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ -->
+
+<project name="server" default="default">
+
+  <description>
+    Demo Server
+  </description>
+
+  <property name="forbidden-sysout-excludes" value="
+    org/apache/lucene/server/GlobalState.class
+    org/apache/lucene/server/IndexState.class
+    org/apache/lucene/server/Server.class
+    org/apache/lucene/server/http/HttpStaticFileServerHandler.class
+    org/apache/lucene/server/http/HttpStaticFileServerHandler$1.class
+  "/>
+        
+  <import file="../module-build.xml"/>
+
+  <path id="classpath">
+    <pathelement path="${analyzers-common.jar}"/>
+    <pathelement path="${analyzers-icu.jar}"/>
+    <pathelement path="${facet.jar}"/>
+    <pathelement path="${grouping.jar}"/>
+    <pathelement path="${highlighter.jar}"/>
+    <pathelement path="${join.jar}"/>
+    <pathelement path="${misc.jar}"/>
+    <pathelement path="${queries.jar}"/>
+    <pathelement path="${queryparser.jar}"/>
+    <pathelement path="${suggest.jar}"/>
+    <pathelement path="${expressions.jar}"/>
+    <fileset dir="../expressions/lib"/>
+    <fileset dir="lib"/>
+    <path refid="base.classpath"/>
+  </path>
+
+  <target name="javadocs" depends="javadocs-facet,javadocs-highlighter,javadocs-suggest,javadocs-analyzers-common,compile-core">
+    <invoke-module-javadoc>
+      <links>
+        <link href="../facet"/>
+        <link href="../highlighter"/>
+        <link href="../suggest"/>
+      </links>
+    </invoke-module-javadoc>
+  </target>
+
+  <target name="compile-core" depends="jar-analyzers-common, jar-analyzers-icu, jar-facet, jar-grouping, jar-highlighter, jar-join, jar-misc, jar-queries, jar-queryparser, jar-suggest, jar-expressions, common.compile-core" />
+
+</project>

Added: lucene/dev/branches/lucene5376_2/lucene/server/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/ivy.xml?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/ivy.xml (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/ivy.xml Sun Mar 16 18:11:07 2014
@@ -0,0 +1,32 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="2.0">
+  <info organisation="org.apache.lucene" module="lucene-server"/>
+  <dependencies>
+    <dependency org="io.netty" name="netty" rev="${/io.netty/netty}" transitive="false"/>
+    <!-- only for Base64 encode/decode I think: -->
+    <dependency org="commons-codec" name="commons-codec" rev="${/commons-codec/commons-codec}" transitive="false"/>
+    <dependency org="com.ibm.icu" name="icu4j" rev="${/com.ibm.icu/icu4j}" transitive="false"/>
+
+    <dependency org="net.minidev" name="json-smart" rev="1.2" transitive="false"/>
+    <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="${/org.codehaus.jackson/jackson-core-asl}" transitive="false"/>
+    <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="${/org.codehaus.jackson/jackson-mapper-asl}" transitive="false"/>
+    <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+  </dependencies>
+</ivy-module>

Added: lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/BlockingThreadPoolExecutor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/BlockingThreadPoolExecutor.java?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/BlockingThreadPoolExecutor.java (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/BlockingThreadPoolExecutor.java Sun Mar 16 18:11:07 2014
@@ -0,0 +1,61 @@
+package org.apache.lucene.server;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+// From Brian Goetz, JCiP:
+class BlockingThreadPoolExecutor extends ThreadPoolExecutor {
+        
+  private final Semaphore semaphore;
+
+  public BlockingThreadPoolExecutor(int bound, int corePoolSize,  int maxPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> queue, ThreadFactory threadFactory) {
+    super(corePoolSize, maxPoolSize, keepAliveTime, unit, queue, threadFactory);
+    this.semaphore = new Semaphore(bound);
+  }
+
+  @Override
+  public void execute(Runnable task) {
+    try {
+      semaphore.acquire();
+    } catch (InterruptedException ie) {
+      Thread.currentThread().interrupt();
+      throw new RuntimeException(ie);
+    }
+
+    try {
+      super.execute(task);
+    } catch(RuntimeException e) {
+      // specifically, handle RejectedExecutionException  
+      semaphore.release();
+      throw e;
+    } catch(Error e) {
+      semaphore.release();
+      throw e;
+    }
+  }
+
+  @Override
+  protected void afterExecute(Runnable r, Throwable t) {
+    semaphore.release();
+  }
+}

Added: lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Constants.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Constants.java?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Constants.java (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/Constants.java Sun Mar 16 18:11:07 2014
@@ -0,0 +1,33 @@
+package org.apache.lucene.server;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.regex.Pattern;
+
+/** Static constants. */
+public class Constants {
+  private Constants() {
+  }
+
+  // nocommit can we nuke this hack now?
+  /** Used to join multi-valued fields. */
+  public static final char INFORMATION_SEP = '\u001f';
+
+  /** Regexp version of {@link #INFORMATION_SEP}. */
+  public static final String INFORMATION_SEP_REGEX = Pattern.quote(Character.toString(INFORMATION_SEP));
+}

Added: lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/DirectoryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/DirectoryFactory.java?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/DirectoryFactory.java (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/DirectoryFactory.java Sun Mar 16 18:11:07 2014
@@ -0,0 +1,113 @@
+package org.apache.lucene.server;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+//import org.apache.lucene.store.AsyncFSDirectory;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.MMapDirectory;
+import org.apache.lucene.store.NIOFSDirectory;
+import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.store.SimpleFSDirectory;
+
+/** A factory to open a {@link Directory} from a provided
+ *  filesystem path. */
+public abstract class DirectoryFactory {
+
+  /** Sole constructor. */
+  public DirectoryFactory() {
+  }
+
+  /** Open a new {@link Directory} at the specified path. */
+  public abstract Directory open(File path) throws IOException;
+
+  /** Returns an instance, using the specified
+   *  implementation {FSDirectory, MMapDirectory,
+   *  NIOFSDirectory, SimpleFSDirectory or RAMDirectory}. */
+  public static DirectoryFactory get(final String dirImpl) {
+    if (dirImpl.equals("FSDirectory")) {
+      return new DirectoryFactory() {
+          @Override
+          public Directory open(File path) throws IOException {
+            return FSDirectory.open(path);
+          }
+        };
+    } else if (dirImpl.equals("MMapDirectory")) {
+      return new DirectoryFactory() {
+          @Override
+          public Directory open(File path) throws IOException {
+            return new MMapDirectory(path);
+          }
+        };
+    } else if (dirImpl.equals("NIOFSDirectory")) {
+      return new DirectoryFactory() {
+          @Override
+          public Directory open(File path) throws IOException {
+            return new NIOFSDirectory(path);
+          }
+        };
+    } else if (dirImpl.equals("SimpleFSDirectory")) {
+      return new DirectoryFactory() {
+          @Override
+          public Directory open(File path) throws IOException {
+            return new SimpleFSDirectory(path);
+          }
+        };
+    } else if (dirImpl.equals("RAMDirectory")) {
+      return new DirectoryFactory() {
+          @Override
+          public Directory open(File path) throws IOException {
+            return new RAMDirectory();
+          }
+      };
+    } else {
+      final Class<? extends Directory> dirClass;
+      try {
+        dirClass = Class.forName(dirImpl).asSubclass(Directory.class);
+      } catch (ClassNotFoundException cnfe) {
+        throw new IllegalArgumentException("could not locate Directory sub-class \"" + dirImpl + "\"; verify CLASSPATH");
+      }
+      final Constructor<? extends Directory> ctor;
+      try {
+        ctor = dirClass.getConstructor(File.class);
+      } catch (NoSuchMethodException nsme) {
+        throw new IllegalArgumentException("class \"" + dirImpl + "\" does not have a constructor taking a single File argument");
+      }
+
+      return new DirectoryFactory() {
+        @Override
+        public Directory open(File path) throws IOException {
+          try {
+            return ctor.newInstance(path);
+          } catch (InstantiationException ie) {
+            throw new RuntimeException("failed to instantiate directory class \"" + dirImpl + "\" on path=\"" + path + "\"", ie);
+          } catch (InvocationTargetException ite) {
+            throw new RuntimeException("failed to instantiate directory class \"" + dirImpl + "\" on path=\"" + path + "\"", ite);
+          } catch (IllegalAccessException iae) {
+            throw new RuntimeException("failed to instantiate directory class \"" + dirImpl + "\" on path=\"" + path + "\"", iae);
+          }
+        }
+      };
+    }
+  }
+}

Added: lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDef.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDef.java?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDef.java (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDef.java Sun Mar 16 18:11:07 2014
@@ -0,0 +1,103 @@
+package org.apache.lucene.server;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.document.FieldType;
+import org.apache.lucene.queries.function.ValueSource;
+import org.apache.lucene.search.similarities.Similarity;
+
+/** Defines the type of one field. */
+public class FieldDef {
+  /** Field name. */
+  public final String name;
+
+  /** {@link FieldType}, used during indexing. */
+  public final FieldType fieldType;
+
+  /** {@link FieldType} minus doc values, used during
+   * indexing because we separately add the doc values field
+   * and then the "normal" field. */
+  public final FieldType fieldTypeNoDV;
+
+  // nocommit use enum:
+  /** Value type (atom, text, boolean, etc.). */
+  public final String valueType;
+
+  // nocommit use enum:
+  /** Facet type (no, flat, hierarchical, numericRange, sortedSetDocValues). */
+  public final String faceted;
+
+  /** Postings format (codec). */
+  public final String postingsFormat;
+
+  /** Doc values format (codec). */
+  public final String docValuesFormat;
+
+  /** True if the field is multi valued. */
+  public final boolean multiValued;
+
+  /** {@link Similarity} to use during indexing searching. */
+  public final Similarity sim;
+
+  /** Index-time {@link Analyzer}. */
+  public final Analyzer indexAnalyzer;
+
+  /** Search-time {@link Analyzer}. */
+  public final Analyzer searchAnalyzer;
+
+  /** True if the field will be highlighted. */
+  public final boolean highlighted;
+
+  /** Field name to use as the ID field for live-values. */
+  public final String liveValuesIDField;
+
+  /** Only set for a virtual field (expression). */
+  public final ValueSource valueSource;
+
+  /** Sole constructor. */
+  public FieldDef(String name, FieldType fieldType, String valueType, String faceted,
+                  String postingsFormat, String docValuesFormat, boolean multiValued,
+                  Similarity sim, Analyzer indexAnalyzer, Analyzer searchAnalyzer, boolean highlighted, String liveValuesIDField,
+                  ValueSource valueSource) {
+    this.name = name;
+    this.fieldType = fieldType;
+    if (fieldType != null) {
+      fieldType.freeze();
+    }
+    this.valueType = valueType;
+    this.faceted = faceted;
+    this.postingsFormat = postingsFormat;
+    this.docValuesFormat = docValuesFormat;
+    this.multiValued = multiValued;
+    this.sim = sim;
+    this.indexAnalyzer = indexAnalyzer;
+    this.searchAnalyzer = searchAnalyzer;
+    this.highlighted = highlighted;
+    this.liveValuesIDField = liveValuesIDField;
+    // nocommit messy:
+    if (fieldType != null) {
+      fieldTypeNoDV = new FieldType(fieldType);
+      fieldTypeNoDV.setDocValueType(null);
+      fieldTypeNoDV.freeze();
+    } else {
+      fieldTypeNoDV = null;
+    }
+    this.valueSource = valueSource;
+  }
+}

Added: lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDefBindings.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDefBindings.java?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDefBindings.java (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FieldDefBindings.java Sun Mar 16 18:11:07 2014
@@ -0,0 +1,69 @@
+package org.apache.lucene.server;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.lucene.expressions.Bindings;
+import org.apache.lucene.index.FieldInfo.DocValuesType;
+import org.apache.lucene.queries.function.ValueSource;
+import org.apache.lucene.queries.function.valuesource.DoubleFieldSource;
+import org.apache.lucene.queries.function.valuesource.FloatFieldSource;
+import org.apache.lucene.queries.function.valuesource.IntFieldSource;
+import org.apache.lucene.queries.function.valuesource.LongFieldSource;
+
+/** Implements {@link Bindings} on top of the registered
+ *  fields. */
+public final class FieldDefBindings extends Bindings {
+
+  private final Map<String,FieldDef> fields;
+
+  /** Sole constructor. */
+  public FieldDefBindings(Map<String,FieldDef> fields) {
+    this.fields = fields;
+  }
+
+  @Override
+  public ValueSource getValueSource(String name) {
+    if (name.equals("_score")) {
+      return getScoreValueSource();
+    }
+    FieldDef fd = fields.get(name);
+    if (fd == null) {
+      throw new IllegalArgumentException("Invalid reference '" + name + "'");
+    }
+    if (fd.valueType.equals("virtual")) {
+      return fd.valueSource;
+    } else if (fd.fieldType != null && fd.fieldType.docValueType() == DocValuesType.NUMERIC) {
+      if (fd.valueType.equals("int")) {
+        return new IntFieldSource(name);
+      } else if (fd.valueType.equals("float")) {
+        return new FloatFieldSource(name);
+      } else if (fd.valueType.equals("long")) {
+        return new LongFieldSource(name);
+      } else if (fd.valueType.equals("double")) {
+        return new DoubleFieldSource(name);
+      } else {
+        assert false: "unknown numeric field type: " + fd.valueType;
+        return null;
+      }
+    } else {
+      throw new IllegalArgumentException("Field \'" + name + "\' cannot be used in an expression: it was not registered with sort=true");
+    }
+  }
+}

Added: lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FinishRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FinishRequest.java?rev=1578133&view=auto
==============================================================================
--- lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FinishRequest.java (added)
+++ lucene/dev/branches/lucene5376_2/lucene/server/src/java/org/apache/lucene/server/FinishRequest.java Sun Mar 16 18:11:07 2014
@@ -0,0 +1,30 @@
+package org.apache.lucene.server;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// nocommit: javadocs seem outdated
+
+/** Returned from {@code Handler#finish} to make actual
+ *  changes from the request.  We do this two-step
+ *  process so that we can fail if there are unhandled
+ *  params, without having made any changes to the index. */
+public interface FinishRequest {
+
+  /** Perform the actual work of the request. */
+  public String finish() throws Exception;
+}



Mime
View raw message