Package org.jboss.dna.graph.search

Examples of org.jboss.dna.graph.search.SearchEngineIndexer


        indexer.close();
    }

    @Test
    public void shouldReIndexRepositoryContentStartingAtNonRootNode() {
        SearchEngineIndexer indexer = new SearchEngineIndexer(context, engine, connectionFactory);
        indexer.index(workspaceName1, path("/Cars"), 10);
        indexer.index(workspaceName1, path("/Cars"), 10);
        indexer.index(workspaceName1, path("/Cars"), 10);
        indexer.close();
    }
View Full Code Here


    // ----------------------------------------------------------------------------------------------------------------
    // Full-text search
    // ----------------------------------------------------------------------------------------------------------------

    protected void indexWorkspace( String workspaceName ) {
        SearchEngineIndexer indexer = new SearchEngineIndexer(context, engine, connectionFactory);
        try {
            indexer.index(workspaceName, path("/"));
        } finally {
            indexer.close();
        }
    }
View Full Code Here

        public void reindexContent() {
            // Get the workspace names ...
            Set<String> workspaces = Graph.create(sourceName, connectionFactory, context).getWorkspaces();

            // Index the existing content (this obtains a connection and possibly locks the source) ...
            SearchEngineIndexer indexer = new SearchEngineIndexer(context, searchEngine, connectionFactory);
            try {
                for (String workspace : workspaces) {
                    indexer.index(workspace);
                }
            } finally {
                indexer.close();
            }

        }
View Full Code Here

         *
         * @see org.jboss.dna.jcr.RepositoryQueryManager#reindexContent(org.jboss.dna.jcr.JcrWorkspace)
         */
        @Override
        public void reindexContent( JcrWorkspace workspace ) {
            SearchEngineIndexer indexer = new SearchEngineIndexer(context, searchEngine, connectionFactory);
            try {
                indexer.index(workspace.getName());
            } finally {
                indexer.close();
            }
        }
View Full Code Here

        @Override
        public void reindexContent( JcrWorkspace workspace,
                                    String path,
                                    int depth ) {
            Path at = workspace.context().getValueFactories().getPathFactory().create(path);
            SearchEngineIndexer indexer = new SearchEngineIndexer(context, searchEngine, connectionFactory);
            try {
                indexer.index(workspace.getName(), at, depth);
            } finally {
                indexer.close();
            }
        }
View Full Code Here

        primeGraph.createWorkspace().named(workspaceName2);

        // Prime the search engine ...
        sw.reset();
        sw.start();
        SearchEngineIndexer indexer = new SearchEngineIndexer(context, searchEngine, connectionFactory);
        indexer.indexAllWorkspaces();
        indexer.close();
        sw.stop();
        Duration zeroth = sw.getTotalDuration();
        System.out.println("Time to prime search engine:                 " + zeroth);

        // First load the content into the unsearched source ...
        sw.reset();
        sw.start();
        loadContent(unsearchedContent);
        sw.stop();
        Duration first = sw.getTotalDuration();

        // Now load the same content into the searchable source ...
        sw.reset();
        sw.start();
        loadContent(content);
        sw.stop();
        Duration second = sw.getTotalDuration();

        // And measure the time required to re-index ...
        sw.reset();
        sw.start();
        indexer = new SearchEngineIndexer(context, searchEngine, connectionFactory);
        indexer.indexAllWorkspaces();
        indexer.close();
        sw.stop();
        Duration third = sw.getTotalDuration();

        int percentOfLoading = (int)(((second.floatValue() / first.floatValue())) * 100.0f);
        System.out.println("Time to load content without indexing:       " + first);
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.search.SearchEngineIndexer

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.