Package org.apache.maven.index.expr

Examples of org.apache.maven.index.expr.SourcedSearchExpression


    {
        final ArchetypeCatalog catalog = new ArchetypeCatalog();
        try
        {
            final Map<String, String> repositories = getRepositoryMap();
            final Query pq = indexer.constructQuery( MAVEN.PACKAGING, new SourcedSearchExpression( "maven-archetype" ) );
            final FlatSearchRequest searchRequest = new FlatSearchRequest( pq );
            searchRequest.setContexts( getIndexingContexts() );
            final FlatSearchResponse searchResponse = indexer.searchFlat( searchRequest );
            for ( ArtifactInfo info : searchResponse.getResults() )
            {
View Full Code Here


            while ( ( n = is.read( buff ) ) > -1 )
            {
                sha1.update( buff, 0, n );
            }
            byte[] digest = sha1.digest();
            return identify( constructQuery( MAVEN.SHA1, new SourcedSearchExpression( encode( digest ) ) ), contexts );
        }
        catch ( NoSuchAlgorithmException ex )
        {
            IOException ioe = new IOException( "Unable to calculate digest" );
            ioe.initCause( ex );
View Full Code Here

    {
        // change is SVN Rev1158917 (http://svn.apache.org/viewvc?view=revision&revision=1158917) is wrong (and is
        // undone)
        // because after removing it, we still dont have GAV dupes in results, here is a proof:

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.slf4j" ) );
        FlatSearchRequest fsReq = new FlatSearchRequest( query );
        fsReq.getContexts().add( context );
        fsReq.getContexts().add( context1 );
        fsReq.getContexts().add( context2 );
View Full Code Here

        throws IOException
    {
        // my use case: I am searching for duplicates in given two contexts belonging to given groupId "org.slf4j"
        // I expect to find intersection of two reposes, since both of those indexes/reposes contains that

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.slf4j" ) );

        FlatSearchRequest fsReq = new FlatSearchRequest( query );
        fsReq.setArtifactInfoComparator( ArtifactInfo.CONTEXT_VERSION_COMPARATOR );
        fsReq.getContexts().add( context );
        fsReq.getContexts().add( context1 );
View Full Code Here

        // Note: currently this is implemented for IteratorSearches only! TBD for Flat and Grouped searches

        // my use case: searching across multiple contexts, querying how many combinations of GAs exists in groupId
        // "org.slf4j".

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.slf4j" ) );

        IteratorSearchRequest isReq = new IteratorSearchRequest( query );

        // so, how many different GA combinations exists, this is almost equal to SQLs group by "groupId, artifactId"
        isReq.setArtifactInfoFilter( new UniqueArtifactFilterPostprocessor( new HashSet<Field>( Arrays.asList(
View Full Code Here

    public void testFlatSearchTotalHitsLie1k()
        throws Exception
    {
        createDummyAis( "org.test", "mindexer14", 1010 );

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.test" ) );

        FlatSearchRequest request = new FlatSearchRequest( query );

        FlatSearchResponse response = nexusIndexer.searchFlat( request );
View Full Code Here

    public void testFlatSearchUnlimited()
        throws Exception
    {
        createDummyAis( "org.test", "mindexer14", 1010 );

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.test" ) );

        FlatSearchRequest request = new FlatSearchRequest( query );

        FlatSearchResponse response = nexusIndexer.searchFlat( request );
View Full Code Here

    public void testFlatSearchLimited()
        throws Exception
    {
        createDummyAis( "org.test", "mindexer14", 1010 );

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.test" ) );

        FlatSearchRequest request = new FlatSearchRequest( query );
        request.setCount( 234 );

        FlatSearchResponse response = nexusIndexer.searchFlat( request );
View Full Code Here

    public void testGroupedSearchTotalHitsLie1k()
        throws Exception
    {
        createDummyAis( "org.test", "mindexer14", 1010 );

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.test" ) );

        GroupedSearchRequest request = new GroupedSearchRequest( query, new GAGrouping() );

        GroupedSearchResponse response = nexusIndexer.searchGrouped( request );
View Full Code Here

    public void testIteratorSearchTotalHitsLie1k()
        throws Exception
    {
        createDummyAis( "org.test", "mindexer14", 1010 );

        Query query = nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.test" ) );

        IteratorSearchRequest request = new IteratorSearchRequest( query );

        IteratorSearchResponse response = nexusIndexer.searchIterator( request );
View Full Code Here

TOP

Related Classes of org.apache.maven.index.expr.SourcedSearchExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.