Skip to content

Commit

Permalink
Merge pull request #11 from safarijv/1.6.2
Browse files Browse the repository at this point in the history
v1.6.2 Always use getSlowAtomicReader() instead of top reader context
  • Loading branch information
anthonygroves committed Jul 10, 2019
2 parents c4533d3 + b17d621 commit 2c741a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ifpress</groupId>
<artifactId>ifpress-solr-plugin</artifactId>
<version>1.6.1</version>
<version>1.6.2</version>
<name>ifpress solr plugin</name>
<description>Contains plugins to be installed in the solr server</description>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ private void retrieveDocValuesHelper(String[] valueFields, SolrInputDocument doc
Term idTerm = new Term(idField, id);
TermQuery query = new TermQuery (idTerm);
TopDocs docs = searcher.search(query, 1);
// getSlowAtomicReader is slower, so try to get LeafReader from LeafReaderContext first
List<LeafReaderContext> leaves = searcher.getTopReaderContext().leaves();
LeafReader leafReader = leaves.isEmpty() ? searcher.getSlowAtomicReader() : leaves.get(0).reader();
LeafReader leafReader = searcher.getSlowAtomicReader();
if (docs.totalHits == 1) {
// get the value
// LOG.debug(String.format("found %s", id));
Expand Down

0 comments on commit 2c741a6

Please sign in to comment.