Index: build.xml
===================================================================
--- build.xml	(revision 784027)
+++ build.xml	(working copy)
@@ -73,15 +73,6 @@
   <!-- Prepares the build directory                                       -->
   <!-- ================================================================== -->
 
-  <!-- Overrides common.compile-core to add rmic -->
-  <target name="compile-core" depends="common.compile-core"
-          description="Compiles core classes, including rmic">
-    <rmic classname="org.apache.lucene.search.RemoteSearchable"
-      base="${build.dir}/classes/java" stubversion="1.2">
-      <classpath refid="classpath"/>
-    </rmic>
-  </target>
-
   <target name="test-core" depends="common.test"
           description="Runs unit tests for the core Lucene code"
   />
Index: src/test/org/apache/lucene/search/RemoteCachingWrapperFilterHelper.java
===================================================================
--- src/test/org/apache/lucene/search/RemoteCachingWrapperFilterHelper.java	(revision 784027)
+++ src/test/org/apache/lucene/search/RemoteCachingWrapperFilterHelper.java	(working copy)
@@ -1,59 +0,0 @@
-package org.apache.lucene.search;
-
-/**
- * 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.IOException;
-import java.util.BitSet;
-
-import junit.framework.TestCase;
-
-import org.apache.lucene.index.IndexReader;
-
-/**
- * A unit test helper class to help with RemoteCachingWrapperFilter testing and
- * assert that it is working correctly.
- */
-public class RemoteCachingWrapperFilterHelper extends RemoteCachingWrapperFilter {
-
-  private boolean shouldHaveCache;
-
-  public RemoteCachingWrapperFilterHelper(Filter filter, boolean shouldHaveCache) {
-    super(filter);
-    this.shouldHaveCache = shouldHaveCache;
-  }
-  
-  public void shouldHaveCache(boolean shouldHaveCache) {
-    this.shouldHaveCache = shouldHaveCache;
-  }
-
-  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
-    Filter cachedFilter = FilterManager.getInstance().getFilter(filter);
-    
-    TestCase.assertNotNull("Filter should not be null", cachedFilter);
-    if (!shouldHaveCache) {
-      TestCase.assertSame("First time filter should be the same ", filter, cachedFilter);
-    } else {
-      TestCase.assertNotSame("We should have a cached version of the filter", filter, cachedFilter);
-    }
-    
-    if (filter instanceof CachingWrapperFilterHelper) {
-      ((CachingWrapperFilterHelper)cachedFilter).setShouldHaveCache(shouldHaveCache);
-    }
-    return cachedFilter.getDocIdSet(reader);
-  }
-}
Index: src/test/org/apache/lucene/search/TestSort.java
===================================================================
--- src/test/org/apache/lucene/search/TestSort.java	(revision 784027)
+++ src/test/org/apache/lucene/search/TestSort.java	(working copy)
@@ -20,7 +20,6 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import junit.textui.TestRunner;
 import org.apache.lucene.analysis.SimpleAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -32,14 +31,10 @@
 
 import java.io.IOException;
 import java.io.Serializable;
-import java.rmi.Naming;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
 import java.util.BitSet;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Locale;
-import java.util.regex.Pattern;
 
 /**
  * Unit tests for sorting code.
@@ -70,21 +65,6 @@
 		super (name);
 	}
 
-	public static void main (String[] argv) {
-		if (argv == null || argv.length < 1)
-			TestRunner.run (suite());
-		else if ("server".equals (argv[0])) {
-			TestSort test = new TestSort (null);
-			try {
-				test.startServer();
-				Thread.sleep (500000);
-			} catch (Exception e) {
-				System.out.println (e);
-				e.printStackTrace();
-			}
-		}
-	}
-
 	public static Test suite() {
 		return new TestSuite (TestSort.class);
 	}
@@ -433,28 +413,6 @@
     runMultiSorts(searcher, false);
   }
 
-  // test a variety of sorts using a remote searcher
-  public void testRemoteSort() throws Exception {
-    Searchable searcher = getRemote();
-    MultiSearcher multi = new MultiSearcher(new Searchable[] { searcher });
-    runMultiSorts(multi, true); // this runs on the full index
-  }
-
-	// test custom search when remote
-	public void testRemoteCustomSort() throws Exception {
-		Searchable searcher = getRemote();
-		MultiSearcher multi = new MultiSearcher (new Searchable[] { searcher });
-		sort.setSort (new SortField ("custom", SampleComparable.getComparatorSource()));
-		assertMatches (multi, queryX, sort, "CAIEG");
-		sort.setSort (new SortField ("custom", SampleComparable.getComparatorSource(), true));
-		assertMatches (multi, queryY, sort, "HJDBF");
-		SortComparator custom = SampleComparable.getComparator();
-		sort.setSort (new SortField ("custom", custom));
-		assertMatches (multi, queryX, sort, "CAIEG");
-		sort.setSort (new SortField ("custom", custom, true));
-		assertMatches (multi, queryY, sort, "HJDBF");
-	}
-
 	// test that the relevancy scores are the same even if
 	// hits are sorted
 	public void testNormalizedScores() throws Exception {
@@ -465,97 +423,72 @@
     HashMap scoresA = getScores (full.search (queryA, null, 1000).scoreDocs, full);
 
 		// we'll test searching locally, remote and multi
-		MultiSearcher remote = new MultiSearcher (new Searchable[] { getRemote() });
 		MultiSearcher multi  = new MultiSearcher (new Searchable[] { searchX, searchY });
 
 		// change sorting and make sure relevancy stays the same
 
 		sort = new Sort();
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort(SortField.FIELD_DOC);
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort ("int");
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort ("float");
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort ("string");
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort (new String[] {"int","float"});
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort (new SortField[] { new SortField ("int", true), new SortField (null, SortField.DOC, true) });
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 		sort.setSort (new String[] {"float","string"});
     assertSameValues (scoresX, getScores (full.search (queryX, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresX, getScores (remote.search (queryX, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresX, getScores (multi.search (queryX, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresY, getScores (full.search (queryY, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresY, getScores (remote.search (queryY, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresY, getScores (multi.search (queryY, null, 1000, sort).scoreDocs, multi));
     assertSameValues (scoresA, getScores (full.search (queryA, null, 1000, sort).scoreDocs, full));
-    assertSameValues (scoresA, getScores (remote.search (queryA, null, 1000, sort).scoreDocs, remote));
     assertSameValues (scoresA, getScores (multi.search (queryA, null, 1000, sort).scoreDocs, multi));
 
 	}
@@ -700,29 +633,4 @@
       }
 		}
 	}
-
-	private Searchable getRemote () throws Exception {
-		try {
-			return lookupRemote ();
-		} catch (Throwable e) {
-			startServer ();
-			return lookupRemote ();
-		}
-	}
-
-	private Searchable lookupRemote () throws Exception {
-		return (Searchable) Naming.lookup ("//localhost/SortedSearchable");
-	}
-
-	private void startServer () throws Exception {
-		// construct an index
-		Searcher local = getFullIndex();
-		// local.search (queryA, new Sort());
-
-		// publish it
-		Registry reg = LocateRegistry.createRegistry (1099);
-		RemoteSearchable impl = new RemoteSearchable (local);
-		Naming.rebind ("//localhost/SortedSearchable", impl);
-	}
-
 }
Index: src/test/org/apache/lucene/search/TestRemoteSearchable.java
===================================================================
--- src/test/org/apache/lucene/search/TestRemoteSearchable.java	(revision 784027)
+++ src/test/org/apache/lucene/search/TestRemoteSearchable.java	(working copy)
@@ -1,136 +0,0 @@
-package org.apache.lucene.search;
-
-/**
- * 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.util.LuceneTestCase;
-import org.apache.lucene.analysis.SimpleAnalyzer;
-import org.apache.lucene.document.*;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.store.RAMDirectory;
-
-import java.rmi.Naming;
-import java.rmi.registry.LocateRegistry;
-import java.util.Collections;
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * @version $Id$
- */
-public class TestRemoteSearchable extends LuceneTestCase {
-  public TestRemoteSearchable(String name) {
-    super(name);
-  }
-
-  private static Searchable getRemote() throws Exception {
-    try {
-      return lookupRemote();
-    } catch (Throwable e) {
-      startServer();
-      return lookupRemote();
-    }
-  }
-
-  private static Searchable lookupRemote() throws Exception {
-    return (Searchable)Naming.lookup("//localhost/Searchable");
-  }
-
-  private static void startServer() throws Exception {
-    // construct an index
-    RAMDirectory indexStore = new RAMDirectory();
-    IndexWriter writer = new IndexWriter(indexStore,new SimpleAnalyzer(),true, IndexWriter.MaxFieldLength.LIMITED);
-    Document doc = new Document();
-    doc.add(new Field("test", "test text", Field.Store.YES, Field.Index.ANALYZED));
-    doc.add(new Field("other", "other test text", Field.Store.YES, Field.Index.ANALYZED));
-    writer.addDocument(doc);
-    writer.optimize();
-    writer.close();
-
-    // publish it
-    LocateRegistry.createRegistry(1099);
-    Searchable local = new IndexSearcher(indexStore);
-    RemoteSearchable impl = new RemoteSearchable(local);
-    Naming.rebind("//localhost/Searchable", impl);
-  }
-
-  private static void search(Query query) throws Exception {
-    // try to search the published index
-    Searchable[] searchables = { getRemote() };
-    Searcher searcher = new MultiSearcher(searchables);
-    ScoreDoc[] result = searcher.search(query, null, 1000).scoreDocs;
-
-    assertEquals(1, result.length);
-    Document document = searcher.doc(result[0].doc);
-    assertTrue("document is null and it shouldn't be", document != null);
-    assertEquals("test text", document.get("test"));
-    assertTrue("document.getFields() Size: " + document.getFields().size() + " is not: " + 2, document.getFields().size() == 2);
-    Set ftl = new HashSet();
-    ftl.add("other");
-    FieldSelector fs = new SetBasedFieldSelector(ftl, Collections.EMPTY_SET);
-    document = searcher.doc(0, fs);
-    assertTrue("document is null and it shouldn't be", document != null);
-    assertTrue("document.getFields() Size: " + document.getFields().size() + " is not: " + 1, document.getFields().size() == 1);
-    fs = new MapFieldSelector(new String[]{"other"});
-    document = searcher.doc(0, fs);
-    assertTrue("document is null and it shouldn't be", document != null);
-    assertTrue("document.getFields() Size: " + document.getFields().size() + " is not: " + 1, document.getFields().size() == 1);
-  }
-
-  public void testTermQuery() throws Exception {
-    search(new TermQuery(new Term("test", "test")));
-  }
-
-  public void testBooleanQuery() throws Exception {
-    BooleanQuery query = new BooleanQuery();
-    query.add(new TermQuery(new Term("test", "test")), BooleanClause.Occur.MUST);
-    search(query);
-  }
-
-  public void testPhraseQuery() throws Exception {
-    PhraseQuery query = new PhraseQuery();
-    query.add(new Term("test", "test"));
-    query.add(new Term("test", "text"));
-    search(query);
-  }
-
-  // Tests bug fix at http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20290
-  public void testQueryFilter() throws Exception {
-    // try to search the published index
-    Searchable[] searchables = { getRemote() };
-    Searcher searcher = new MultiSearcher(searchables);
-    ScoreDoc[] hits = searcher.search(
-          new TermQuery(new Term("test", "text")),
-          new QueryWrapperFilter(new TermQuery(new Term("test", "test"))), 1000).scoreDocs;
-    assertEquals(1, hits.length);
-    ScoreDoc[] nohits = searcher.search(
-          new TermQuery(new Term("test", "text")),
-          new QueryWrapperFilter(new TermQuery(new Term("test", "non-existent-term"))), 1000).scoreDocs;
-    assertEquals(0, nohits.length);
-  }
-
-  public void testConstantScoreQuery() throws Exception {
-    // try to search the published index
-    Searchable[] searchables = { getRemote() };
-    Searcher searcher = new MultiSearcher(searchables);
-    ScoreDoc[] hits = searcher.search(
-          new ConstantScoreQuery(new QueryWrapperFilter(
-                                   new TermQuery(new Term("test", "test")))), null, 1000).scoreDocs;
-    assertEquals(1, hits.length);
-  }
-}
Index: src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java
===================================================================
--- src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java	(revision 784027)
+++ src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java	(working copy)
@@ -1,127 +0,0 @@
-package org.apache.lucene.search;
-
-/**
- * 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.rmi.Naming;
-import java.rmi.registry.LocateRegistry;
-
-import org.apache.lucene.util.LuceneTestCase;
-
-import org.apache.lucene.analysis.SimpleAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.store.RAMDirectory;
-
-/**
- * Tests that the index is cached on the searcher side of things.
- * NOTE: This is copied from TestRemoteSearchable since it already had a remote index set up.
- */
-public class TestRemoteCachingWrapperFilter extends LuceneTestCase {
-  public TestRemoteCachingWrapperFilter(String name) {
-    super(name);
-  }
-
-  private static Searchable getRemote() throws Exception {
-    try {
-      return lookupRemote();
-    } catch (Throwable e) {
-      startServer();
-      return lookupRemote();
-    }
-  }
-
-  private static Searchable lookupRemote() throws Exception {
-    return (Searchable)Naming.lookup("//localhost/Searchable");
-  }
-
-  private static void startServer() throws Exception {
-    // construct an index
-    RAMDirectory indexStore = new RAMDirectory();
-    IndexWriter writer = new IndexWriter(indexStore, new SimpleAnalyzer(), true,
-                                         IndexWriter.MaxFieldLength.LIMITED);
-    Document doc = new Document();
-    doc.add(new Field("test", "test text", Field.Store.YES, Field.Index.ANALYZED));
-    doc.add(new Field("type", "A", Field.Store.YES, Field.Index.ANALYZED));
-    doc.add(new Field("other", "other test text", Field.Store.YES, Field.Index.ANALYZED));
-    writer.addDocument(doc);
-    //Need a second document to search for
-    doc = new Document();
-    doc.add(new Field("test", "test text", Field.Store.YES, Field.Index.ANALYZED));
-    doc.add(new Field("type", "B", Field.Store.YES, Field.Index.ANALYZED));
-    doc.add(new Field("other", "other test text", Field.Store.YES, Field.Index.ANALYZED));
-    writer.addDocument(doc);
-    writer.optimize();
-    writer.close();
-
-    // publish it
-    LocateRegistry.createRegistry(1099);
-    Searchable local = new IndexSearcher(indexStore);
-    RemoteSearchable impl = new RemoteSearchable(local);
-    Naming.rebind("//localhost/Searchable", impl);
-  }
-
-  private static void search(Query query, Filter filter, int hitNumber, String typeValue) throws Exception {
-    Searchable[] searchables = { getRemote() };
-    Searcher searcher = new MultiSearcher(searchables);
-    ScoreDoc[] result = searcher.search(query,filter, 1000).scoreDocs;
-    assertEquals(1, result.length);
-    Document document = searcher.doc(result[hitNumber].doc);
-    assertTrue("document is null and it shouldn't be", document != null);
-    assertEquals(typeValue, document.get("type"));
-    assertTrue("document.getFields() Size: " + document.getFields().size() + " is not: " + 3, document.getFields().size() == 3);
-  }
-
-
-  public void testTermRemoteFilter() throws Exception {
-    CachingWrapperFilterHelper cwfh = new CachingWrapperFilterHelper(new QueryWrapperFilter(new TermQuery(new Term("type", "a"))));
-    
-    // This is what we are fixing - if one uses a CachingWrapperFilter(Helper) it will never 
-    // cache the filter on the remote site
-    cwfh.setShouldHaveCache(false);
-    search(new TermQuery(new Term("test", "test")), cwfh, 0, "A");
-    cwfh.setShouldHaveCache(false);
-    search(new TermQuery(new Term("test", "test")), cwfh, 0, "A");
-    
-    // This is how we fix caching - we wrap a Filter in the RemoteCachingWrapperFilter(Handler - for testing)
-    // to cache the Filter on the searcher (remote) side
-    RemoteCachingWrapperFilterHelper rcwfh = new RemoteCachingWrapperFilterHelper(cwfh, false);
-    search(new TermQuery(new Term("test", "test")), rcwfh, 0, "A");
-
-    // 2nd time we do the search, we should be using the cached Filter
-    rcwfh.shouldHaveCache(true);
-    search(new TermQuery(new Term("test", "test")), rcwfh, 0, "A");
-
-    // assert that we get the same cached Filter, even if we create a new instance of RemoteCachingWrapperFilter(Helper)
-    // this should pass because the Filter parameters are the same, and the cache uses Filter's hashCode() as cache keys,
-    // and Filters' hashCode() builds on Filter parameters, not the Filter instance itself
-    rcwfh = new RemoteCachingWrapperFilterHelper(new QueryWrapperFilter(new TermQuery(new Term("type", "a"))), false);
-    rcwfh.shouldHaveCache(false);
-    search(new TermQuery(new Term("test", "test")), rcwfh, 0, "A");
-
-    rcwfh = new RemoteCachingWrapperFilterHelper(new QueryWrapperFilter(new TermQuery(new Term("type", "a"))), false);
-    rcwfh.shouldHaveCache(true);
-    search(new TermQuery(new Term("test", "test")), rcwfh, 0, "A");
-
-    // assert that we get a non-cached version of the Filter because this is a new Query (type:b)
-    rcwfh = new RemoteCachingWrapperFilterHelper(new QueryWrapperFilter(new TermQuery(new Term("type", "b"))), false);
-    rcwfh.shouldHaveCache(false);
-    search(new TermQuery(new Term("type", "b")), rcwfh, 0, "B");
-  }
-}
Index: src/java/org/apache/lucene/search/RemoteSearchable.java
===================================================================
--- src/java/org/apache/lucene/search/RemoteSearchable.java	(revision 784027)
+++ src/java/org/apache/lucene/search/RemoteSearchable.java	(working copy)
@@ -1,122 +0,0 @@
-package org.apache.lucene.search;
-
-/**
- * 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.document.Document;
-import org.apache.lucene.document.FieldSelector;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.CorruptIndexException;
-
-import java.io.IOException;
-import java.rmi.Naming;
-import java.rmi.RMISecurityManager;
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-/**
- * A remote searchable implementation.
- *
- * @version $Id$
- */
-public class RemoteSearchable
-  extends UnicastRemoteObject
-  implements Searchable {
-  
-  private Searchable local;
-  
-  /** Constructs and exports a remote searcher. */
-  public RemoteSearchable(Searchable local) throws RemoteException {
-    super();
-    this.local = local;
-  }
-
-
-  public void search(Weight weight, Filter filter, HitCollector results)
-    throws IOException {
-    local.search(weight, filter, results);
-  }
-
-  public void close() throws IOException {
-    local.close();
-  }
-
-  public int docFreq(Term term) throws IOException {
-    return local.docFreq(term);
-  }
-
-
-  public int[] docFreqs(Term[] terms) throws IOException {
-    return local.docFreqs(terms);
-  }
-
-  public int maxDoc() throws IOException {
-    return local.maxDoc();
-  }
-
-  public TopDocs search(Weight weight, Filter filter, int n) throws IOException {
-    return local.search(weight, filter, n);
-  }
-
-
-  public TopFieldDocs search (Weight weight, Filter filter, int n, Sort sort)
-  throws IOException {
-    return local.search (weight, filter, n, sort);
-  }
-
-  public Document doc(int i) throws CorruptIndexException, IOException {
-    return local.doc(i);
-  }
-
-  public Document doc(int i, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
-	    return local.doc(i, fieldSelector);
-  }
-  
-  public Query rewrite(Query original) throws IOException {
-    return local.rewrite(original);
-  }
-
-  public Explanation explain(Weight weight, int doc) throws IOException {
-    return local.explain(weight, doc);
-  }
-
-  /** Exports a searcher for the index in args[0] named
-   * "//localhost/Searchable". */
-  public static void main(String args[]) throws Exception {
-    String indexName = null;
-    
-    if (args != null && args.length == 1)
-      indexName = args[0];
-    
-    if (indexName == null) {
-      System.out.println("Usage: org.apache.lucene.search.RemoteSearchable <index>");
-      return;
-    }
-    
-    // create and install a security manager
-    if (System.getSecurityManager() == null) {
-      System.setSecurityManager(new RMISecurityManager());
-    }
-    
-    Searchable local = new IndexSearcher(indexName);
-    RemoteSearchable impl = new RemoteSearchable(local);
-      
-    // bind the implementation to "Searchable"
-    Naming.rebind("//localhost/Searchable", impl);
-  }
-
-}
Index: src/java/org/apache/lucene/search/RemoteCachingWrapperFilter.java
===================================================================
--- src/java/org/apache/lucene/search/RemoteCachingWrapperFilter.java	(revision 784027)
+++ src/java/org/apache/lucene/search/RemoteCachingWrapperFilter.java	(working copy)
@@ -1,69 +0,0 @@
-package org.apache.lucene.search;
-
-/**
- * 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.IOException;
-import java.util.BitSet;
-
-import org.apache.lucene.index.IndexReader;
-
-/**
- * Provides caching of {@link Filter}s themselves on the remote end of an RMI connection.
- * The cache is keyed on Filter's hashCode(), so if it sees the same filter twice
- * it will reuse the original version.
- * <p/>
- * NOTE: This does NOT cache the Filter bits, but rather the Filter itself.
- * Thus, this works hand-in-hand with {@link CachingWrapperFilter} to keep both
- * file Filter cache and the Filter bits on the remote end, close to the searcher.
- * <p/>
- * Usage:
- * <p/>
- * To cache a result you must do something like 
- * RemoteCachingWrapperFilter f = new RemoteCachingWrapperFilter(new CachingWrapperFilter(myFilter));
- * <p/>
- */
-public class RemoteCachingWrapperFilter extends Filter {
-  protected Filter filter;
-
-  public RemoteCachingWrapperFilter(Filter filter) {
-    this.filter = filter;
-  }
-
-  /**
-   * Uses the {@link FilterManager} to keep the cache for a filter on the 
-   * searcher side of a remote connection.
-   * @param reader the index reader for the Filter
-   * @return the bitset
-   * @deprecated Use {@link #getDocIdSet(IndexReader)} instead.
-   */
-  public BitSet bits(IndexReader reader) throws IOException {
-    Filter cachedFilter = FilterManager.getInstance().getFilter(filter);
-    return cachedFilter.bits(reader);
-  }
-  
-  /**
-   * Uses the {@link FilterManager} to keep the cache for a filter on the 
-   * searcher side of a remote connection.
-   * @param reader the index reader for the Filter
-   * @return the DocIdSet
-   */
-  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
-    Filter cachedFilter = FilterManager.getInstance().getFilter(filter);
-    return cachedFilter.getDocIdSet(reader);
-  }
-}
