You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2013/05/30 18:23:38 UTC
svn commit: r1487915 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
Author: uschindler
Date: Thu May 30 16:23:37 2013
New Revision: 1487915
URL: http://svn.apache.org/r1487915
Log:
Merged revision(s) 1487914 from lucene/dev/trunk:
SOLR-4877, LUCENE-5023: Removed SolrIndexSearcher#getDocSetNC()'s special case for handling TermQuery to prevent NullPointerException if reader does not have fields
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1487915&r1=1487914&r2=1487915&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Thu May 30 16:23:37 2013
@@ -185,6 +185,10 @@ Bug Fixes
* SOLR-4870: RecentUpdates.update() does not increment numUpdates loop counter
(Alexey Kudinov via shalin)
+* SOLR-4877, LUCENE-5023: Removed SolrIndexSearcher#getDocSetNC()'s special
+ case for handling TermQuery to prevent NullPointerException if reader does
+ not have fields. (Bao Yang Yang, Uwe Schindler)
+
Other Changes
----------------------
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1487915&r1=1487914&r2=1487915&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Thu May 30 16:23:37 2013
@@ -1094,41 +1094,12 @@ public class SolrIndexSearcher extends I
DocSetCollector collector = new DocSetCollector(maxDoc()>>6, maxDoc());
if (filter==null) {
- if (query instanceof TermQuery) {
- Term t = ((TermQuery)query).getTerm();
- for (final AtomicReaderContext leaf : leafContexts) {
- final AtomicReader reader = leaf.reader();
- collector.setNextReader(leaf);
- Fields fields = reader.fields();
- Terms terms = fields.terms(t.field());
- BytesRef termBytes = t.bytes();
-
- Bits liveDocs = reader.getLiveDocs();
- DocsEnum docsEnum = null;
- if (terms != null) {
- final TermsEnum termsEnum = terms.iterator(null);
- if (termsEnum.seekExact(termBytes, false)) {
- docsEnum = termsEnum.docs(liveDocs, null, DocsEnum.FLAG_NONE);
- }
- }
-
- if (docsEnum != null) {
- int docid;
- while ((docid = docsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
- collector.collect(docid);
- }
- }
- }
- } else {
- super.search(query,null,collector);
- }
- return collector.getDocSet();
-
+ super.search(query,null,collector);
} else {
Filter luceneFilter = filter.getTopFilter();
super.search(query, luceneFilter, collector);
- return collector.getDocSet();
}
+ return collector.getDocSet();
}