@@ -1245,9 +1245,9 @@ private ReaderContext findReaderContext(ShardSearchContextId id, TransportReques
1245
1245
if (id .getSessionId ().isEmpty ()) {
1246
1246
throw new IllegalArgumentException ("Session id must be specified" );
1247
1247
}
1248
- // if (sessionId.equals(id.getSessionId()) == false) {
1249
- // throw new SearchContextMissingException(id);
1250
- // }
1248
+ // if (sessionId.equals(id.getSessionId()) == false) {
1249
+ // throw new SearchContextMissingException(id);
1250
+ // }
1251
1251
final ReaderContext reader = activeReaders .get (id .readerContextId ());
1252
1252
if (reader == null ) {
1253
1253
throw new SearchContextMissingException (id );
@@ -1848,10 +1848,10 @@ public long getDefaultKeepAliveInMillis() {
1848
1848
1849
1849
public List <ReaderContext > getActiveContexts (ShardId shardId ) {
1850
1850
return this .activeReaders .values ()
1851
- .stream ()
1852
- .filter (c -> c .singleSession () == false )
1853
- .filter (c -> c .indexShard ().shardId ().equals (shardId ))
1854
- .collect (Collectors .toList ());
1851
+ .stream ()
1852
+ .filter (c -> c .singleSession () == false )
1853
+ .filter (c -> c .indexShard ().shardId ().equals (shardId ))
1854
+ .collect (Collectors .toList ());
1855
1855
}
1856
1856
1857
1857
public void reopenPitContexts (ShardId shardId , String segmentsFileName , long keepAlive , String sessionId , long contextId ) {
@@ -1860,17 +1860,16 @@ public void reopenPitContexts(ShardId shardId, String segmentsFileName, long kee
1860
1860
ReaderContext readerContext = null ;
1861
1861
try {
1862
1862
Directory directory = shard .store ().directory ();
1863
- SegmentInfos segmentCommitInfos = SegmentInfos .readCommit (directory , segmentsFileName ,
1864
- IndexVersions .MINIMUM_READONLY_COMPATIBLE .luceneVersion ().major );
1863
+ SegmentInfos segmentCommitInfos = SegmentInfos .readCommit (
1864
+ directory ,
1865
+ segmentsFileName ,
1866
+ IndexVersions .MINIMUM_READONLY_COMPATIBLE .luceneVersion ().major
1867
+ );
1865
1868
IndexCommit indexCommit = Lucene .getIndexCommit (segmentCommitInfos , directory );
1866
1869
DirectoryReader open = StandardDirectoryReader .open (indexCommit );
1867
1870
1868
1871
String searcherId = ReadOnlyEngine .generateSearcherId (segmentCommitInfos );
1869
- final ShardSearchContextId shardSearchContextId = new ShardSearchContextId (
1870
- sessionId ,
1871
- contextId ,
1872
- searcherId
1873
- );
1872
+ final ShardSearchContextId shardSearchContextId = new ShardSearchContextId (sessionId , contextId , searcherId );
1874
1873
SearcherSupplier searchSupplier = new Engine .SearcherSupplier (Function .identity ()) {
1875
1874
1876
1875
@ Override
@@ -1883,13 +1882,12 @@ protected Searcher acquireSearcherInternal(String source) {
1883
1882
EngineConfig engineConfig = shard .getEngineOrNull ().getEngineConfig ();
1884
1883
1885
1884
return new Searcher (
1886
- "source" ,
1887
- open ,
1888
- engineConfig .getSimilarity (),
1889
- engineConfig .getQueryCache (),
1890
- engineConfig .getQueryCachingPolicy (),
1891
- () -> {
1892
- }
1885
+ "source" ,
1886
+ open ,
1887
+ engineConfig .getSimilarity (),
1888
+ engineConfig .getQueryCache (),
1889
+ engineConfig .getQueryCachingPolicy (),
1890
+ () -> {}
1893
1891
);
1894
1892
}
1895
1893
};
0 commit comments