File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed 
server/src/main/java/org/elasticsearch/common/lucene/search/function Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 99
1010package  org .elasticsearch .common .lucene .search .function ;
1111
12- import  org .apache .lucene .index .IndexReader ;
1312import  org .apache .lucene .index .LeafReaderContext ;
1413import  org .apache .lucene .index .Term ;
1514import  org .apache .lucene .search .BooleanClause ;
@@ -81,8 +80,8 @@ protected int doHashCode() {
8180        }
8281
8382        @ Override 
84-         protected  ScoreFunction  rewrite (IndexReader   reader ) throws  IOException  {
85-             Query  newFilter  = filter .rewrite (new   IndexSearcher ( reader ) );
83+         protected  ScoreFunction  rewrite (IndexSearcher   searcher ) throws  IOException  {
84+             Query  newFilter  = filter .rewrite (searcher );
8685            if  (newFilter  == filter ) {
8786                return  this ;
8887            }
@@ -215,7 +214,7 @@ public Query rewrite(IndexSearcher searcher) throws IOException {
215214        ScoreFunction [] newFunctions  = new  ScoreFunction [functions .length ];
216215        boolean  needsRewrite  = (newQ  != subQuery );
217216        for  (int  i  = 0 ; i  < functions .length ; i ++) {
218-             newFunctions [i ] = functions [i ].rewrite (searcher . getIndexReader () );
217+             newFunctions [i ] = functions [i ].rewrite (searcher );
219218            needsRewrite  |= (newFunctions [i ] != functions [i ]);
220219        }
221220        if  (needsRewrite ) {
Original file line number Diff line number Diff line change 99
1010package  org .elasticsearch .common .lucene .search .function ;
1111
12- import  org .apache .lucene .index .IndexReader ;
1312import  org .apache .lucene .index .LeafReaderContext ;
13+ import  org .apache .lucene .search .IndexSearcher ;
1414
1515import  java .io .IOException ;
1616import  java .util .Objects ;
@@ -69,7 +69,7 @@ public final int hashCode() {
6969
7070    protected  abstract  int  doHashCode ();
7171
72-     protected  ScoreFunction  rewrite (IndexReader   reader ) throws  IOException  {
72+     protected  ScoreFunction  rewrite (IndexSearcher   searcher ) throws  IOException  {
7373        return  this ;
7474    }
7575}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments