Index: lucene/core/src/java/org/apache/lucene/search/FieldCache.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/FieldCache.java	(revision 1562808)
+++ lucene/core/src/java/org/apache/lucene/search/FieldCache.java	(working copy)
@@ -211,7 +211,7 @@
   }
 
   /** Expert: The cache used internally by sorting and range query classes. */
-  public static FieldCache DEFAULT = new FieldCacheImpl();
+  public static FieldCache DEFAULT = FieldCacheContainer.getTheFieldCacheContainer().getFieldCache();
 
   /** The default parser for byte values, which are encoded by {@link Byte#toString(byte)} */
   @Deprecated
Index: lucene/core/src/java/org/apache/lucene/search/FieldCacheContainer.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/FieldCacheContainer.java	(revision 0)
+++ lucene/core/src/java/org/apache/lucene/search/FieldCacheContainer.java	(revision 0)
@@ -0,0 +1,48 @@
+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.
+ */
+
+public class FieldCacheContainer {
+  
+  private static FieldCacheContainer fcc = new FieldCacheContainer();
+  public static FieldCacheContainer getTheFieldCacheContainer() {
+    return fcc;
+  }
+  
+  private FieldCache instance = new FieldCacheImpl();
+  private boolean hasInstanceBeenRetrieved = false;
+  
+  public synchronized FieldCache getFieldCache() {
+    hasInstanceBeenRetrieved = true;
+    return instance;
+  }
+  
+  /** @return original instance of the FieldCache */
+  public synchronized FieldCache setFieldCache(final FieldCache newInstance) {
+    final FieldCache orgInstance = instance;
+    if (hasInstanceBeenRetrieved) {
+      throw new UnsupportedOperationException("Cannot change field cache after it has been retrieved. You tried to set " + 
+          newInstance + ", but it has already been set to " + instance);
+    } else {
+      instance = newInstance;
+    }
+    
+    return orgInstance;
+  }
+  
+}
Index: lucene/core/src/java/org/apache/lucene/search/FieldCacheImpl.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/FieldCacheImpl.java	(revision 1562808)
+++ lucene/core/src/java/org/apache/lucene/search/FieldCacheImpl.java	(working copy)
@@ -53,14 +53,14 @@
  *
  * @since   lucene 1.4
  */
-class FieldCacheImpl implements FieldCache {
+public class FieldCacheImpl implements FieldCache {
 
-  private Map<Class<?>,Cache> caches;
-  FieldCacheImpl() {
+  protected Map<Class<?>,Cache> caches;
+  public FieldCacheImpl() {
     init();
   }
 
-  private synchronized void init() {
+  protected synchronized void init() {
     caches = new HashMap<Class<?>,Cache>(9);
     caches.put(Byte.TYPE, new ByteCache(this));
     caches.put(Short.TYPE, new ShortCache(this));
@@ -143,9 +143,9 @@
   }
 
   /** Expert: Internal cache. */
-  abstract static class Cache {
+  abstract protected static class Cache {
 
-    Cache(FieldCacheImpl wrapper) {
+    protected Cache(FieldCacheImpl wrapper) {
       this.wrapper = wrapper;
     }
 
@@ -248,7 +248,7 @@
   }
 
   /** Expert: Every composite-key in the internal cache is of this type. */
-  static class CacheKey {
+  static protected class CacheKey {
     final String field;        // which Field
     final Object custom;       // which custom comparator or parser
 
@@ -257,6 +257,10 @@
       this.field = field;
       this.custom = custom;
     }
+    
+    public String getField() {
+      return field;
+    }
 
     /** Two of these are equal iff they reference the same field and type. */
     @Override
@@ -398,8 +402,8 @@
     }
   }
 
-  static final class ByteCache extends Cache {
-    ByteCache(FieldCacheImpl wrapper) {
+  static protected class ByteCache extends Cache {
+    protected ByteCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -492,8 +496,8 @@
     }
   }
 
-  static final class ShortCache extends Cache {
-    ShortCache(FieldCacheImpl wrapper) {
+  static protected class ShortCache extends Cache {
+    protected ShortCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -609,8 +613,8 @@
     public long minValue;
   }
 
-  static final class IntCache extends Cache {
-    IntCache(FieldCacheImpl wrapper) {
+  static protected class IntCache extends Cache {
+    protected IntCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -701,8 +705,8 @@
     return (Bits) caches.get(DocsWithFieldCache.class).get(reader, new CacheKey(field, null), false);
   }
 
-  static final class DocsWithFieldCache extends Cache {
-    DocsWithFieldCache(FieldCacheImpl wrapper) {
+  static protected class DocsWithFieldCache extends Cache {
+    protected DocsWithFieldCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
     
@@ -803,8 +807,8 @@
     }
   }
 
-  static final class FloatCache extends Cache {
-    FloatCache(FieldCacheImpl wrapper) {
+  static protected class FloatCache extends Cache {
+    protected FloatCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -916,8 +920,8 @@
     }
   }
 
-  static final class LongCache extends Cache {
-    LongCache(FieldCacheImpl wrapper) {
+  static protected class LongCache extends Cache {
+    protected LongCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -1040,8 +1044,8 @@
     }
   }
 
-  static final class DoubleCache extends Cache {
-    DoubleCache(FieldCacheImpl wrapper) {
+  static protected class DoubleCache extends Cache {
+    protected DoubleCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -1166,8 +1170,8 @@
     }
   }
 
-  static class SortedDocValuesCache extends Cache {
-    SortedDocValuesCache(FieldCacheImpl wrapper) {
+  static protected class SortedDocValuesCache extends Cache {
+    protected SortedDocValuesCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -1306,8 +1310,8 @@
     return (BinaryDocValues) caches.get(BinaryDocValues.class).get(reader, new CacheKey(field, acceptableOverheadRatio), setDocsWithField);
   }
 
-  static final class BinaryDocValuesCache extends Cache {
-    BinaryDocValuesCache(FieldCacheImpl wrapper) {
+  static protected class BinaryDocValuesCache extends Cache {
+    protected BinaryDocValuesCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
@@ -1426,8 +1430,8 @@
     return dto.iterator(reader);
   }
 
-  static final class DocTermOrdsCache extends Cache {
-    DocTermOrdsCache(FieldCacheImpl wrapper) {
+  static protected class DocTermOrdsCache extends Cache {
+    protected DocTermOrdsCache(FieldCacheImpl wrapper) {
       super(wrapper);
     }
 
Index: lucene/core/src/test/org/apache/lucene/search/TestFieldCacheContainer.java
===================================================================
--- lucene/core/src/test/org/apache/lucene/search/TestFieldCacheContainer.java	(revision 0)
+++ lucene/core/src/test/org/apache/lucene/search/TestFieldCacheContainer.java	(revision 0)
@@ -0,0 +1,60 @@
+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.junit.Test;
+
+public class TestFieldCacheContainer extends LuceneTestCase {
+
+  private class MyFieldCache extends FieldCacheImpl {}
+  
+  @Test
+  public void testTheRealFieldCache() {
+    // You can get it and default it is an FieldCacheImpl
+    assertEquals(FieldCacheImpl.class, FieldCache.DEFAULT.getClass());
+    // Now that it has been retrieved, verify it cannot be set
+    try {
+      FieldCacheContainer.getTheFieldCacheContainer().setFieldCache(new FieldCacheImpl());
+      fail();
+    } catch (UnsupportedOperationException e) {
+      // expected
+    }
+  }
+  
+  @Test
+  public void testFieldCacheContainer() {
+    // Since the real FieldCache-implementation is a static on FieldCache, we probably cannot changes
+    // it by now, because numerous other tests has already fetched it - and it cant be changed after fetch
+    // Therefore the set-part is tested on another FieldCacheContainer, than "the real" one
+    FieldCache fc1 = new MyFieldCache();
+    FieldCacheContainer fcc = new FieldCacheContainer();
+    fcc.setFieldCache(fc1);
+    // Retrieve the FieldCache
+    assertEquals(fc1, fcc.getFieldCache());
+    // Now that it has been retrieved, verify it cannot be set again
+    try {
+      fcc.setFieldCache(new FieldCacheImpl(){});
+      fail();
+    } catch (UnsupportedOperationException e) {
+      // expected
+    }
+    
+  }
+  
+}
