From 53d75ec1ef24b9a23dc1f2003bd01ff90cc15243 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Fri, 11 Nov 2011 01:07:46 +0000 Subject: [PATCH] LUCENE-3443: add comments & CHANGES entry git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1200676 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/CHANGES.txt | 5 +++++ .../src/java/org/apache/lucene/search/FieldCacheImpl.java | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 9b310723b89..33e32615597 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -747,6 +747,11 @@ Optimizations * LUCENE-2205: Very substantial (3-5X) RAM reduction required to hold the terms index on opening an IndexReader (Aaron McCurry via Mike McCandless) +* LUCENE-3443: FieldCache can now set docsWithField, and create an + array, in a single pass. This results in faster init time for apps + that need both (such as sorting by a field with a missing value). + (Mike McCandless) + Test Cases * LUCENE-3420: Disable the finalness checks in TokenStream and Analyzer diff --git a/lucene/src/java/org/apache/lucene/search/FieldCacheImpl.java b/lucene/src/java/org/apache/lucene/search/FieldCacheImpl.java index c49d061fbac..ff791b24e24 100644 --- a/lucene/src/java/org/apache/lucene/search/FieldCacheImpl.java +++ b/lucene/src/java/org/apache/lucene/search/FieldCacheImpl.java @@ -561,7 +561,7 @@ class FieldCacheImpl implements FieldCache { } @Override - protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField) + protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField /* ignored */) throws IOException { final String field = entryKey.field; FixedBitSet res = null; @@ -1065,7 +1065,7 @@ class FieldCacheImpl implements FieldCache { } @Override - protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField) + protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField /* ignored */) throws IOException { Terms terms = MultiFields.getTerms(reader, entryKey.field); @@ -1210,7 +1210,7 @@ class FieldCacheImpl implements FieldCache { } @Override - protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField) + protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField /* ignored */) throws IOException { Terms terms = MultiFields.getTerms(reader, entryKey.field); @@ -1294,7 +1294,7 @@ class FieldCacheImpl implements FieldCache { } @Override - protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField) + protected Object createValue(IndexReader reader, Entry entryKey, boolean setDocsWithField /* ignored */) throws IOException { return new DocTermOrds(reader, entryKey.field); }