IndexingContext.acquireIndexSearcher
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.maven.index.context.IndexingContext.acquireIndexSearcher(Showing top 15 results out of 315)

  • Common ways to obtain IndexingContext
private void myMethod () {
IndexingContext i =
  • Indexer indexer;indexer.createIndexingContext(id, repositoryId, repository, indexDirectory, repositoryUrl, indexUpdateUrl, true, true, indexers)
  • Smart code suggestions by Codota
}
origin: org.jboss.windup.org.apache.maven.indexer/indexer-core

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()] ) );
}
origin: org.apache.maven.indexer/indexer-core

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;
}
origin: apache/archiva

context.acquireIndexSearcher( ).getIndexReader( ),
origin: org.netbeans.modules/org-netbeans-modules-maven-indexer

TopScoreDocCollector collector = TopScoreDocCollector.create(NexusRepositoryIndexerImpl.MAX_RESULT_COUNT, true);
for (IndexingContext context : contexts) {
  IndexSearcher searcher = context.acquireIndexSearcher();
  try {
searcher.search(refClassQuery, collector);
origin: org.jboss.windup.org.apache.maven.indexer/indexer-core

private void initialize( IndexingContext ctx )
  throws IOException, CorruptIndexException
  final IndexSearcher indexSearcher = ctx.acquireIndexSearcher();
  try
origin: org.apache.maven.indexer/indexer-core

final IndexSearcher indexSearcher = context.acquireIndexSearcher();
try
origin: apache/archiva

                            indexingContext.acquireIndexSearcher().getIndexReader(), //
                            indexLocation.toFile() );
indexPacker.packIndex( request );
origin: org.apache.maven.indexer/indexer-core

final IndexSearcher indexSearcher = context.acquireIndexSearcher();
try
origin: org.jboss.windup.org.apache.maven.indexer/indexer-core

for ( IndexingContext context : participatingContexts )
  final IndexSearcher indexSearcher = context.acquireIndexSearcher();
  try
origin: org.jboss.windup.org.apache.maven.indexer/indexer-core

final IndexSearcher indexSearcher = context.acquireIndexSearcher();
try
origin: org.apache.maven.indexer/indexer-core

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()] ) );
}
origin: org.jboss.windup.org.apache.maven.indexer/indexer-core

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;
}
origin: org.apache.maven.indexer/indexer-core

private void initialize( IndexingContext ctx )
  throws IOException, CorruptIndexException
  final IndexSearcher indexSearcher = ctx.acquireIndexSearcher();
  try
origin: org.apache.maven.indexer/indexer-core

for ( IndexingContext context : participatingContexts )
  final IndexSearcher indexSearcher = context.acquireIndexSearcher();
  try
origin: org.jboss.windup.org.apache.maven.indexer/indexer-core

final IndexSearcher indexSearcher = context.acquireIndexSearcher();
try
org.apache.maven.index.contextIndexingContextacquireIndexSearcher

Javadoc

Acquires a fresh instance of IndexSearcher. You have to release the received instance with #releaseIndexSearcher(IndexSearcher) otherwise you are about to introduce leak.

Popular methods of IndexingContext

  • getId
    Returns this indexing context id.
  • getIndexDirectoryFile
  • getIndexDirectory
  • updateTimestamp
  • close
    Shuts down this context.
  • commit
    Commits changes to context, eventually refreshing readers/searchers too.
  • getIndexUpdateUrl
    Returns url for the index update
  • optimize
    Optimizes index. According to Lucene 3.6+ Javadoc, there is no more sense to optimize, so this metho
  • getAllGroups
    Gets all group names stored in the current indexing context
  • getIndexCreators
    List of IndexCreators used in this context.
  • getRepository
    Returns location for the local repository.
  • getRepositoryId
    Returns repository id.
  • getRepository,
  • getRepositoryId,
  • getRepositoryUrl,
  • isSearchable,
  • merge,
  • releaseIndexSearcher,
  • replace,
  • setSearchable,
  • getAnalyzer

Popular classes and methods

  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • File (java.io)
    LocalStorage based File implementation for GWT. Should probably have used Harmony as a starting poin
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • LinkedHashMap (java.util)
    Hash table implementation of the Map interface with predictable iteration order. [Sun docs] [http:/
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)