/** * Creates a new {@link IndexSearcher} * * @return a new {@link IndexSearcher} * @throws IOException */ public IndexSearcher newIndexSearcher() throws IOException { return indexingContext.acquireIndexSearcher(); }
@Override public IndexSearcher acquireIndexSearcher() throws IOException { lock.lock(); return !isClosed() ? context.acquireIndexSearcher() : EMPTY_SEARCHER; }
public synchronized IndexReader acquire() throws IOException { if ( searchers != null ) { release(); throw new IllegalStateException( "acquire() called 2nd time without release() in between!" ); } this.searchers = new ArrayList<IndexSearcher>(); final ArrayList<IndexReader> contextReaders = new ArrayList<IndexReader>( contexts.size() ); for ( IndexingContext ctx : contexts ) { final IndexSearcher indexSearcher = ctx.acquireIndexSearcher(); searchers.add( indexSearcher ); contextReaders.add( indexSearcher.getIndexReader() ); } return new MultiReader( contextReaders.toArray( new IndexReader[contextReaders.size()] ) ); }
public synchronized IndexReader acquire() throws IOException { if ( searchers != null ) { release(); throw new IllegalStateException( "acquire() called 2nd time without release() in between!" ); } this.searchers = new ArrayList<IndexSearcher>(); final ArrayList<IndexReader> contextReaders = new ArrayList<IndexReader>( contexts.size() ); for ( IndexingContext ctx : contexts ) { final IndexSearcher indexSearcher = ctx.acquireIndexSearcher(); searchers.add( indexSearcher ); contextReaders.add( indexSearcher.getIndexReader() ); } return new MultiReader( contextReaders.toArray( new IndexReader[contextReaders.size()] ) ); }
public synchronized IndexReader acquire() throws IOException { if ( searchers != null ) { release(); throw new IllegalStateException( "acquire() called 2nd time without release() in between!" ); } this.searchers = new ArrayList<IndexSearcher>(); final ArrayList<IndexReader> contextReaders = new ArrayList<IndexReader>( contexts.size() ); for ( IndexingContext ctx : contexts ) { final IndexSearcher indexSearcher = ctx.acquireIndexSearcher(); searchers.add( indexSearcher ); contextReaders.add( indexSearcher.getIndexReader() ); } return new MultiReader( contextReaders.toArray( new IndexReader[contextReaders.size()] ) ); }
private Document getOldDocument( IndexingContext context, ArtifactContext ac ) { try { final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try { TopDocs result = indexSearcher.search( new TermQuery( new Term( ArtifactInfo.UINFO, ac.getArtifactInfo().getUinfo() ) ), 2 ); if ( result.totalHits == 1 ) { return indexSearcher.doc( result.scoreDocs[0].doc ); } } finally { context.releaseIndexSearcher( indexSearcher ); } } catch ( IOException e ) { // huh? throw new IllegalStateException( e ); } return null; }
private Document getOldDocument( IndexingContext context, ArtifactContext ac ) { try { final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try { TopDocs result = indexSearcher.search( new TermQuery( new Term( ArtifactInfo.UINFO, ac.getArtifactInfo().getUinfo() ) ), 2 ); if ( result.totalHits == 1 ) { return indexSearcher.doc( result.scoreDocs[0].doc ); } } finally { context.releaseIndexSearcher( indexSearcher ); } } catch ( IOException e ) { // huh? throw new IllegalStateException( e ); } return null; }
private Document getOldDocument( IndexingContext context, ArtifactContext ac ) { try { final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try { TopDocs result = indexSearcher.search( new TermQuery( new Term( ArtifactInfo.UINFO, ac.getArtifactInfo().getUinfo() ) ), 2 ); if ( result.totalHits == 1 ) { return indexSearcher.doc( result.scoreDocs[0].doc ); } } finally { context.releaseIndexSearcher( indexSearcher ); } } catch ( IOException e ) { // huh? throw new IllegalStateException( e ); } return null; }
private void initialize( IndexingContext ctx ) throws IOException, CorruptIndexException final IndexSearcher indexSearcher = ctx.acquireIndexSearcher(); try
private void initialize( IndexingContext ctx ) throws IOException, CorruptIndexException final IndexSearcher indexSearcher = ctx.acquireIndexSearcher(); try
private void initialize( IndexingContext ctx ) throws IOException, CorruptIndexException final IndexSearcher indexSearcher = ctx.acquireIndexSearcher(); try
TopScoreDocCollector collector = TopScoreDocCollector.create(NexusRepositoryIndexerImpl.MAX_RESULT_COUNT, true); for (IndexingContext context : contexts) { IndexSearcher searcher = context.acquireIndexSearcher(); try { searcher.search(refClassQuery, collector);
@Override public void pack( final ArchivaIndexingContext context ) throws IndexUpdateFailedException { executeUpdateFunction( context, indexingContext -> { try { IndexPackingRequest request = new IndexPackingRequest( indexingContext, indexingContext.acquireIndexSearcher( ).getIndexReader( ), indexingContext.getIndexDirectoryFile( ) ); indexPacker.packIndex( request ); indexingContext.updateTimestamp( true ); } catch ( IOException e ) { log.error( "IOException while packing index of context " + context.getId( ) + ( StringUtils.isNotEmpty( e.getMessage( ) ) ? ": " + e.getMessage( ) : "" ) ); throw new IndexUpdateFailedException( "IOException during update of " + context.getId( ), e ); } } ); }
context.acquireIndexSearcher( ).getIndexReader( ),
@Override public void run(final IndexingContext context) throws IOException { if (ISPROXY(this.repository)) { updateRemoteIndex(this.repository.adaptToFacet(ProxyRepository.class), context, this.fullReindex); } TaskUtil.checkInterruption(); // igorf, this needs be merged back to maven indexer, see MINDEXER-65 final IndexSearcher contextIndexSearcher = context.acquireIndexSearcher(); try { final NexusScanningListener scanListener = new NexusScanningListener(context, contextIndexSearcher, this.fullReindex, ISPROXY(this.repository)); scanner.scan(new ScanningRequest(context, scanListener, this.fromPath)); } finally { context.releaseIndexSearcher(contextIndexSearcher); } } }
final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try
for ( IndexingContext context : participatingContexts ) final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try
for ( IndexingContext context : participatingContexts ) final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try
final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try
final IndexSearcher indexSearcher = context.acquireIndexSearcher(); try