Package org.apache.maven.archiva.indexer.record

Examples of org.apache.maven.archiva.indexer.record.RepositoryIndexRecord


            indexModifier = new IndexModifier( indexLocation, getAnalyzer(), !exists() );

            for ( Iterator i = artifacts.iterator(); i.hasNext(); )
            {
                Artifact artifact = (Artifact) i.next();
                RepositoryIndexRecord record = factory.createRecord( artifact );

                if ( record != null )
                {
                    Term term = new Term( FLD_PK, record.getPrimaryKey() );

                    indexModifier.deleteDocuments( term );

                    Document document = converter.convert( record );
                    document.add(
                        new Field( FLD_PK, record.getPrimaryKey(), Field.Store.NO, Field.Index.UN_TOKENIZED ) );

                    indexModifier.addDocument( document );
                }
            }
            indexModifier.optimize();
View Full Code Here


        IndexModifier indexModifier = null;
        try
        {
            indexModifier = new IndexModifier( indexLocation, getAnalyzer(), !exists() );

            RepositoryIndexRecord record = factory.createRecord( artifact );

            if ( record != null )
            {
                Term term = new Term( FLD_PK, record.getPrimaryKey() );

                indexModifier.deleteDocuments( term );

                Document document = converter.convert( record );
                document.add( new Field( FLD_PK, record.getPrimaryKey(), Field.Store.NO, Field.Index.UN_TOKENIZED ) );

                indexModifier.addDocument( document );
            }
            indexModifier.optimize();
        }
View Full Code Here

    public void testAddRecordNoIndex()
        throws IOException, RepositoryIndexException
    {
        Artifact artifact = createArtifact( "test-jar" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );
        index.indexRecords( Collections.singletonList( record ) );

        IndexReader reader = IndexReader.open( indexLocation );
        try
        {
View Full Code Here

    {
        createEmptyIndex();

        Artifact artifact = createArtifact( "test-jar" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );
        index.indexRecords( Collections.singletonList( record ) );

        IndexReader reader = IndexReader.open( indexLocation );
        try
        {
View Full Code Here

    {
        createEmptyIndex();

        Artifact artifact = createArtifact( "test-jar" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );
        index.indexRecords( Collections.singletonList( record ) );

        // Do it again
        record = recordFactory.createRecord( artifact );
        index.indexRecords( Collections.singletonList( record ) );
View Full Code Here

    {
        createEmptyIndex();

        Artifact artifact = createArtifact( "test-jar" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );
        index.indexRecords( Collections.singletonList( record ) );

        index.deleteRecords( Collections.singletonList( record ) );

        IndexReader reader = IndexReader.open( indexLocation );
View Full Code Here

    {
        createEmptyIndex();

        Artifact artifact = createArtifact( "test-jar" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );

        index.deleteRecords( Collections.singletonList( record ) );

        IndexReader reader = IndexReader.open( indexLocation );
        try
View Full Code Here

    public void testDeleteRecordNoIndex()
        throws IOException, RepositoryIndexException
    {
        Artifact artifact = createArtifact( "test-jar" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );
        index.deleteRecords( Collections.singleton( record ) );

        assertFalse( index.exists() );
    }
View Full Code Here

    {
        createEmptyIndex();

        Artifact artifact = createArtifact( "test-pom", "1.0", "pom" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );
        index.indexRecords( Collections.singletonList( record ) );

        IndexReader reader = IndexReader.open( indexLocation );
        try
        {
View Full Code Here

    {
        createEmptyIndex();

        Artifact artifact = createArtifact( "test-plugin" );

        RepositoryIndexRecord record = recordFactory.createRecord( artifact );

        index.indexRecords( Collections.singletonList( record ) );

        IndexReader reader = IndexReader.open( indexLocation );
        try
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.indexer.record.RepositoryIndexRecord

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.