/** * A helper method delegating the call to the IteratorResultSet. * * @return */ public int getTotalProcessedArtifactInfoCount() { return getResults().getTotalProcessedArtifactInfoCount(); }
public ArtifactInfo identify( Field field, String query ) throws IOException { return identify( queryCreator.constructQuery( field, query, SearchType.EXACT ) ); }
public ScanningResult scan( ScanningRequest request ) { request.getArtifactScanningListener().scanningStarted( request.getIndexingContext() ); ScanningResult result = new ScanningResult(); scanDirectory( request.getIndexingContext().getRepository(), request ); request.getArtifactScanningListener().scanningFinished( request.getIndexingContext(), result ); return result; }
public FlatSearchResponse searchFlatPaged( FlatSearchRequest request ) throws IOException { TreeSet<ArtifactInfo> result = new TreeSet<ArtifactInfo>( request.getArtifactInfoComparator() ); int totalHits = 0; for ( IndexingContext context : request.getContexts() ) { totalHits += searchFlat( request, result, context, request.getQuery(), request.getStart(), request.getCount() ); } return new FlatSearchResponse( request.getQuery(), totalHits, result ); }
public ArtifactInfo identify( Query query, Collection<IndexingContext> contexts ) throws IOException { IteratorSearchResponse result = searcher.searchIteratorPaged( new IteratorSearchRequest( query ), contexts ); // TODO: this implementation is flakey: case a) 0 hits is okay, b) 1 hit is okay, c1) >1 hits and all same GAVs // -- okay but which source repo will be used? c2) >1 hits, and different GAVs --- huh? if ( result.getTotalHits() > 0 ) { return result.getResults().next(); } else { return null; } }
@Deprecated public Set<ArtifactInfo> searchFlat( Comparator<ArtifactInfo> artifactInfoComparator, Collection<IndexingContext> indexingContexts, Query query ) throws IOException { return searchFlatPaged( new FlatSearchRequest( query, artifactInfoComparator ), indexingContexts ).getResults(); }
public IteratorSearchResponse flatIteratorSearch( Map<String, String> terms, String repositoryId, Integer from, Integer count, Integer hitLimit, boolean uniqueRGA, SearchType searchType, List<ArtifactInfoFilter> filters ) throws NoSuchRepositoryException { if ( !canHandle( terms ) ) { return IteratorSearchResponse.EMPTY_ITERATOR_SEARCH_RESPONSE; } return m_lucene.searchArtifactClassIterator( terms.get( TERM_CLASSNAME ), repositoryId, from, count, hitLimit, searchType, filters ); }
/** * @deprecated use {@link #searchGrouped(GroupedSearchRequest) */ @Deprecated public Map<String, ArtifactInfoGroup> searchGrouped( Grouping grouping, Comparator<String> groupKeyComparator, Query query, IndexingContext context ) throws IOException { return searcher.searchGrouped( new GroupedSearchRequest( query, grouping, groupKeyComparator ), Arrays.asList( new IndexingContext[] { context } ) ).getResults(); }
public IndexerField selectIndexerField( final Field field, final SearchType type ) { IndexerField lastField = null; for ( IndexerField indexerField : field.getIndexerFields() ) { lastField = indexerField; if ( type.matchesIndexerField( indexerField ) ) { return indexerField; } } return lastField; }
public IteratorSearchRequest( Query query, List<IndexingContext> contexts, ArtifactInfoFilter filter ) { super( query, contexts ); setArtifactInfoFilter( filter ); } }
/** * Delegates to indexer manager. * * {@inheritDoc} */ public void reindexAllRepositories( final String path, final boolean fullReindex ) throws Exception { indexerManager.reindexAllRepositories( path, fullReindex ); }
@Override protected void perform(Repository member) throws IOException { publishRepositoryIndex(member, processedRepositoryIds); } }.perform();
public IndexerField( final org.sonatype.nexus.index.Field ontology, final IndexerFieldVersion version, final String key, final String description, final Store storeMethod, final Index indexMethod, final TermVector termVector ) { this.ontology = ontology; this.version = version; this.key = key; this.storeMethod = storeMethod; this.indexMethod = indexMethod; this.termVector = termVector; ontology.addIndexerField( this ); }
public boolean isHitLimitExceeded() { return getTotalHits() == LIMIT_EXCEEDED; } }
public void scan( IndexingContext context, final ArtifactScanningListener listener ) throws IOException { scan( context, listener, false ); }
public IteratorSearchResponse searchIteratorPaged( IteratorSearchRequest request, Collection<IndexingContext> indexingContexts ) throws IOException { return searchIteratorPaged( request, indexingContexts, false ); }
public FlatSearchResponse searchFlatPaged( FlatSearchRequest request, Collection<IndexingContext> indexingContexts ) throws IOException { return searchFlatPaged( request, indexingContexts, false ); }
public GroupedSearchResponse forceSearchGrouped( GroupedSearchRequest request, Collection<IndexingContext> indexingContexts ) throws IOException { return searchGrouped( request, indexingContexts, true ); }
public IndexingContext getContext() { IndexingContext result = context; while (result instanceof LockingIndexingContext) { result = ((LockingIndexingContext) result).getContext(); } return result; } }
@Deprecated public Set<ArtifactInfo> searchFlat( Comparator<ArtifactInfo> artifactInfoComparator, IndexingContext indexingContext, Query query ) throws IOException { return searchFlatPaged( new FlatSearchRequest( query, artifactInfoComparator, indexingContext ) ).getResults(); }