You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2019/06/21 08:28:54 UTC

[lucene-solr] branch master updated: Expose IndexSearchers executor in order to enable searcher cloning (#732)

This is an automated email from the ASF dual-hosted git repository.

simonw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new b3e759a  Expose IndexSearchers executor in order to enable searcher cloning (#732)
b3e759a is described below

commit b3e759a6580656b7467ab49a0671661549ae6fde
Author: Simon Willnauer <si...@apache.org>
AuthorDate: Fri Jun 21 10:28:47 2019 +0200

    Expose IndexSearchers executor in order to enable searcher cloning (#732)
    
    Today if an executor was added to the IndexSearcher it's impossible to
    clone the searcher with it's cache, similarty and caching policy since
    the executor is not exposed. This adds a simple getter to make cloning
    easier.
---
 lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
index b6b85b9..72d3d12 100644
--- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
+++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
@@ -847,4 +847,11 @@ public class IndexSearcher {
     }
     return new CollectionStatistics(field, reader.maxDoc(), docCount, sumTotalTermFreq, sumDocFreq);
   }
+
+  /**
+   * Returns this searchers executor or <code>null</code> if no executor was provided
+   */
+  public Executor getExecutor() {
+    return executor;
+  }
 }