Indexer
instead. Discouraged from further use, as it suffers from multiple synchronization
and other problems. As it tries to serve as "context registry" too, but it does not synchronize the
access to it, but also, introduces some extras (like "targeted" vs "non targeted" search), that makes
it's behavior less intuitive.@Deprecated @Singleton @Named public class DefaultNexusIndexer extends java.lang.Object implements NexusIndexer
NexusIndexer
implementation.Modifier and Type | Field and Description |
---|---|
private Indexer |
indexer
Deprecated.
|
private IndexerEngine |
indexerEngine
Deprecated.
|
private java.util.Map<java.lang.String,IndexingContext> |
indexingContexts
Deprecated.
|
private QueryCreator |
queryCreator
Deprecated.
|
private Scanner |
scanner
Deprecated.
|
ROLE
Constructor and Description |
---|
DefaultNexusIndexer(Indexer indexer,
Scanner scanner,
IndexerEngine indexerEngine,
QueryCreator queryCreator)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addArtifactsToIndex(java.util.Collection<ArtifactContext> acs,
IndexingContext context)
Deprecated.
|
void |
addArtifactToIndex(ArtifactContext ac,
IndexingContext context)
Deprecated.
Delegates to the
IndexerEngine to update artifact to the index |
void |
addIndexingContext(IndexingContext context)
Deprecated.
Adds an indexing context to Nexus indexer.
|
IndexingContext |
addIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory directory,
java.lang.String repositoryUrl,
java.lang.String indexUpdateUrl,
java.util.List<? extends IndexCreator> indexers)
Deprecated.
Adds an indexing context to Nexus indexer.
|
IndexingContext |
addIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
java.io.File indexDirectory,
java.lang.String repositoryUrl,
java.lang.String indexUpdateUrl,
java.util.List<? extends IndexCreator> indexers)
Deprecated.
Adds an indexing context to Nexus indexer.
|
IndexingContext |
addIndexingContextForced(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory directory,
java.lang.String repositoryUrl,
java.lang.String indexUpdateUrl,
java.util.List<? extends IndexCreator> indexers)
Deprecated.
Adds an indexing context to Nexus indexer.
|
IndexingContext |
addIndexingContextForced(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
java.io.File indexDirectory,
java.lang.String repositoryUrl,
java.lang.String indexUpdateUrl,
java.util.List<? extends IndexCreator> indexers)
Deprecated.
Adds an indexing context to Nexus indexer.
|
IndexingContext |
addMergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory indexDirectory,
boolean searchable,
java.util.Collection<IndexingContext> contexts)
Deprecated.
|
IndexingContext |
addMergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
org.apache.lucene.store.Directory indexDirectory,
boolean searchable,
ContextMemberProvider membersProvider)
Deprecated.
|
IndexingContext |
addMergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
java.io.File indexDirectory,
boolean searchable,
java.util.Collection<IndexingContext> contexts)
Deprecated.
|
IndexingContext |
addMergedIndexingContext(java.lang.String id,
java.lang.String repositoryId,
java.io.File repository,
java.io.File indexDirectory,
boolean searchable,
ContextMemberProvider membersProvider)
Deprecated.
|
void |
artifactDiscovered(ArtifactContext ac,
IndexingContext context)
Deprecated.
Delegates to the
IndexerEngine to add a new artifact to the index |
org.apache.lucene.search.Query |
constructQuery(Field field,
SearchExpression expression)
Deprecated.
Helper method to construct Lucene query for given field without need for knowledge (on caller side) HOW is a
field indexed, and WHAT query is needed to achieve that.
|
org.apache.lucene.search.Query |
constructQuery(Field field,
java.lang.String query,
SearchType type)
Deprecated.
|
void |
deleteArtifactFromIndex(ArtifactContext ac,
IndexingContext context)
Deprecated.
Delegates to the
IndexerEngine to remove artifact from the index |
void |
deleteArtifactsFromIndex(java.util.Collection<ArtifactContext> acs,
IndexingContext context)
Deprecated.
|
java.util.Map<java.lang.String,IndexingContext> |
getIndexingContexts()
Deprecated.
Returns the map of indexing contexts keyed by their ID.
|
java.util.Collection<ArtifactInfo> |
identify(Field field,
java.lang.String query)
Deprecated.
|
java.util.Collection<ArtifactInfo> |
identify(java.io.File artifact)
Deprecated.
|
java.util.Collection<ArtifactInfo> |
identify(java.io.File artifact,
java.util.Collection<IndexingContext> contexts)
Deprecated.
|
java.util.Collection<ArtifactInfo> |
identify(org.apache.lucene.search.Query query)
Deprecated.
|
java.util.Collection<ArtifactInfo> |
identify(org.apache.lucene.search.Query query,
java.util.Collection<IndexingContext> contexts)
Deprecated.
|
void |
removeIndexingContext(IndexingContext context,
boolean deleteFiles)
Deprecated.
Removes the indexing context from Nexus indexer, closes it and deletes (if specified) the index files.
|
void |
scan(IndexingContext context)
Deprecated.
Performs full scan (reindex) for the local repository belonging to supplied context.
|
void |
scan(IndexingContext context,
ArtifactScanningListener listener)
Deprecated.
Performs full scan (reindex) for the local repository belonging to supplied context.
|
void |
scan(IndexingContext context,
ArtifactScanningListener listener,
boolean update)
Deprecated.
Performs optionally incremental scan (reindex) for the local repository, with listener.
|
void |
scan(IndexingContext context,
boolean update)
Deprecated.
Performs optionally incremental scan (reindex/full reindex) for the local repository belonging to the supplied
context.
|
void |
scan(IndexingContext context,
java.lang.String fromPath,
ArtifactScanningListener listener,
boolean update)
Deprecated.
Uses
Scanner to scan repository content. |
FlatSearchResponse |
searchFlat(FlatSearchRequest request)
Deprecated.
Searches according the request parameters.
|
GroupedSearchResponse |
searchGrouped(GroupedSearchRequest request)
Deprecated.
Searches according the request parameters.
|
IteratorSearchResponse |
searchIterator(IteratorSearchRequest request)
Deprecated.
Searches according to request parameters.
|
private final Indexer indexer
private final Scanner scanner
private final IndexerEngine indexerEngine
private final QueryCreator queryCreator
private final java.util.Map<java.lang.String,IndexingContext> indexingContexts
@Inject public DefaultNexusIndexer(Indexer indexer, Scanner scanner, IndexerEngine indexerEngine, QueryCreator queryCreator)
public void addIndexingContext(IndexingContext context)
NexusIndexer
addIndexingContext
in interface NexusIndexer
public IndexingContext addIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.IOException, UnsupportedExistingLuceneIndexException
NexusIndexer
addIndexingContext
in interface NexusIndexer
id
- the ID of the context.repositoryId
- the ID of the repository that this context represents.repository
- the location of the repository.indexDirectory
- the location of the Lucene indexes.repositoryUrl
- the location of the remote repository.indexUpdateUrl
- the alternate location of the remote repository indexes (if they are not in default place).indexers
- the set of indexers to apply to this context.java.io.IOException
- in case of some serious IO problem.UnsupportedExistingLuceneIndexException
- if a Lucene index already exists where location is specified, but
it has no Nexus descriptor record or it has, but the embedded repoId differs from the repoId
specified from the supplied one.public IndexingContext addIndexingContextForced(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.IOException
NexusIndexer
addIndexingContextForced
in interface NexusIndexer
id
- the ID of the context.repositoryId
- the ID of the repository that this context represents.repository
- the location of the repository.indexDirectory
- the location of the Lucene indexes.repositoryUrl
- the location of the remote repository.indexUpdateUrl
- the alternate location of the remote repository indexes (if they are not in default place).indexers
- the set of indexers to apply to this context.java.io.IOException
- in case of some serious IO problem.public IndexingContext addIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory directory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.IOException, UnsupportedExistingLuceneIndexException
NexusIndexer
addIndexingContext
in interface NexusIndexer
id
- the ID of the context.repositoryId
- the ID of the repository that this context represents.repository
- the location of the repository.directory
- the location of the Lucene indexes.repositoryUrl
- the location of the remote repository.indexUpdateUrl
- the alternate location of the remote repository indexes (if they are not in default place).indexers
- the set of indexers to apply to this context.java.io.IOException
- in case of some serious IO problem.UnsupportedExistingLuceneIndexException
- if a Lucene index already exists where location is specified, but
it has no Nexus descriptor record or it has, but the embedded repoId differs from the repoId
specified from the supplied one.public IndexingContext addIndexingContextForced(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory directory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.IOException
NexusIndexer
addIndexingContextForced
in interface NexusIndexer
id
- the ID of the context.repositoryId
- the ID of the repository that this context represents.repository
- the location of the repository.directory
- the location of the Lucene indexes.repositoryUrl
- the location of the remote repository.indexUpdateUrl
- the alternate location of the remote repository indexes (if they are not in default place).indexers
- the set of indexers to apply to this context.java.io.IOException
- in case of some serious IO problem.public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, boolean searchable, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
addMergedIndexingContext
in interface NexusIndexer
java.io.IOException
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, boolean searchable, ContextMemberProvider membersProvider) throws java.io.IOException
addMergedIndexingContext
in interface NexusIndexer
java.io.IOException
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
addMergedIndexingContext
in interface NexusIndexer
java.io.IOException
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, ContextMemberProvider membersProvider) throws java.io.IOException
addMergedIndexingContext
in interface NexusIndexer
java.io.IOException
public void removeIndexingContext(IndexingContext context, boolean deleteFiles) throws java.io.IOException
NexusIndexer
removeIndexingContext
in interface NexusIndexer
java.io.IOException
public java.util.Map<java.lang.String,IndexingContext> getIndexingContexts()
NexusIndexer
getIndexingContexts
in interface NexusIndexer
public void scan(IndexingContext context) throws java.io.IOException
NexusIndexer
scan
in interface NexusIndexer
java.io.IOException
public void scan(IndexingContext context, boolean update) throws java.io.IOException
NexusIndexer
scan
in interface NexusIndexer
update
- if incremental reindex wanted, set true, otherwise false and full reindex will happenjava.io.IOException
public void scan(IndexingContext context, ArtifactScanningListener listener) throws java.io.IOException
NexusIndexer
scan
in interface NexusIndexer
java.io.IOException
public void scan(IndexingContext context, ArtifactScanningListener listener, boolean update) throws java.io.IOException
NexusIndexer
scan
in interface NexusIndexer
update
- if incremental reindex wanted, set true, otherwise false and full reindex will happenjava.io.IOException
public void scan(IndexingContext context, java.lang.String fromPath, ArtifactScanningListener listener, boolean update) throws java.io.IOException
Scanner
to scan repository content. A ArtifactScanningListener
is used to process found
artifacts and to add them to the index using
NexusIndexer.artifactDiscovered(ArtifactContext, IndexingContext)
.scan
in interface NexusIndexer
fromPath
- a path segment if you want "sub-path" reindexing (ie. reindex just a given subfolder of a
repository, ot whole repository from root.update
- if incremental reindex wanted, set true, otherwise false and full reindex will happenjava.io.IOException
DefaultScannerListener
,
artifactDiscovered(ArtifactContext, IndexingContext)
public void artifactDiscovered(ArtifactContext ac, IndexingContext context) throws java.io.IOException
IndexerEngine
to add a new artifact to the indexartifactDiscovered
in interface NexusIndexer
java.io.IOException
public void addArtifactToIndex(ArtifactContext ac, IndexingContext context) throws java.io.IOException
IndexerEngine
to update artifact to the indexaddArtifactToIndex
in interface NexusIndexer
java.io.IOException
public void addArtifactsToIndex(java.util.Collection<ArtifactContext> acs, IndexingContext context) throws java.io.IOException
addArtifactsToIndex
in interface NexusIndexer
java.io.IOException
public void deleteArtifactFromIndex(ArtifactContext ac, IndexingContext context) throws java.io.IOException
IndexerEngine
to remove artifact from the indexdeleteArtifactFromIndex
in interface NexusIndexer
java.io.IOException
public void deleteArtifactsFromIndex(java.util.Collection<ArtifactContext> acs, IndexingContext context) throws java.io.IOException
deleteArtifactsFromIndex
in interface NexusIndexer
java.io.IOException
public FlatSearchResponse searchFlat(FlatSearchRequest request) throws java.io.IOException
NexusIndexer
searchFlat
in interface NexusIndexer
java.io.IOException
public IteratorSearchResponse searchIterator(IteratorSearchRequest request) throws java.io.IOException
NexusIndexer
searchIterator
in interface NexusIndexer
java.io.IOException
public GroupedSearchResponse searchGrouped(GroupedSearchRequest request) throws java.io.IOException
NexusIndexer
searchGrouped
in interface NexusIndexer
java.io.IOException
@Deprecated public org.apache.lucene.search.Query constructQuery(Field field, java.lang.String query, SearchType type) throws java.lang.IllegalArgumentException
NexusIndexer
constructQuery
in interface NexusIndexer
java.lang.IllegalArgumentException
public org.apache.lucene.search.Query constructQuery(Field field, SearchExpression expression) throws java.lang.IllegalArgumentException
NexusIndexer
constructQuery
in interface NexusIndexer
java.lang.IllegalArgumentException
public java.util.Collection<ArtifactInfo> identify(Field field, java.lang.String query) throws java.lang.IllegalArgumentException, java.io.IOException
identify
in interface NexusIndexer
java.lang.IllegalArgumentException
java.io.IOException
public java.util.Collection<ArtifactInfo> identify(java.io.File artifact) throws java.io.IOException
identify
in interface NexusIndexer
java.io.IOException
public java.util.Collection<ArtifactInfo> identify(java.io.File artifact, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
identify
in interface NexusIndexer
java.io.IOException
public java.util.Collection<ArtifactInfo> identify(org.apache.lucene.search.Query query) throws java.io.IOException
identify
in interface NexusIndexer
java.io.IOException
public java.util.Collection<ArtifactInfo> identify(org.apache.lucene.search.Query query, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
identify
in interface NexusIndexer
java.io.IOException