Package org.apache.jackrabbit.core.query.lucene

Examples of org.apache.jackrabbit.core.query.lucene.SearchIndex


        QueryResult res = qm.createQuery(statement, JCR_SQL2).execute();
        checkResult(res, nodes);
    }

    protected void flushSearchIndex() throws RepositoryException {
        SearchIndex si = getSearchIndex();
        if (si != null) {
            si.flush();
        }
    }
View Full Code Here


        TestHelper.waitForTextExtractionTasksToFinish(session);
        flushSearchIndex();
    }

    protected void flushSearchIndex() throws RepositoryException {
        SearchIndex si = getSearchIndex();
        if (si != null) {
            si.flush();
        }
    }
View Full Code Here

        final String workspaceName = session.getWorkspace().getName();
        QueryHandler qh = ri.getSearchManager(workspaceName).getQueryHandler();
        if (!(qh instanceof SearchIndex)) {
            throw new NotExecutableException("No search index");
        }
        SearchIndex si = (SearchIndex) qh;
        return si.runConsistencyCheck();
    }
View Full Code Here

    public void testResultSet() throws RepositoryException {
        createNodes(testRootNode, 10, 5, 0);
        superuser.save();

        SearchIndex index = getSearchIndex();
        int resultFetchSize = index.getResultFetchSize();
        try {
            String stmt = testPath + "//*[@" + jcrPrimaryType + "] order by @jcr:score descending";

            // with result fetch size Integer.MAX_VALUE
            readResult(executeQuery(stmt));

            // with result fetch size 100
            index.setResultFetchSize(100);
            readResult(executeQuery(stmt));

            // with 100 limit
            QueryImpl query = (QueryImpl) qm.createQuery(stmt, Query.XPATH);
            query.setLimit(100);
            readResult(query.execute());
        } finally {
            index.setResultFetchSize(resultFetchSize);
        }

        for (NodeIterator it = testRootNode.getNodes(); it.hasNext(); ) {
            it.nextNode().remove();
            superuser.save();
View Full Code Here

            throws RepositoryException {
        Session session = getHelper().getSuperuserSession(wspName);
        try {
            QueryManager qm = session.getWorkspace().getQueryManager();
            QueryHandler handler = ((QueryManagerImpl) qm).getQueryHandler();
            SearchIndex index = (SearchIndex) handler;
            assertEquals("Wrong index format", version.getVersion(),
                    index.getIndexFormatVersion().getVersion());
        } finally {
            session.logout();
        }
    }
View Full Code Here

            throws RepositoryException {
        Session session = helper.getSuperuserSession(wspName);
        try {
            QueryManager qm = session.getWorkspace().getQueryManager();
            QueryHandler handler = ((QueryManagerImpl) qm).getQueryHandler();
            SearchIndex index = (SearchIndex) handler;
            assertEquals("Wrong index format", version.getVersion(),
                    index.getIndexFormatVersion().getVersion());
        } finally {
            session.logout();
        }
    }
View Full Code Here

    public void testResultSet() throws RepositoryException {
        createNodes(testRootNode, 10, 5, 0);
        superuser.save();

        SearchIndex index = (SearchIndex) getQueryHandler();
        int resultFetchSize = index.getResultFetchSize();
        try {
            String stmt = testPath + "//*[@" + jcrPrimaryType + "] order by @jcr:score descending";

            // with result fetch size Integer.MAX_VALUE
            readResult(executeQuery(stmt));

            // with result fetch size 100
            index.setResultFetchSize(100);
            readResult(executeQuery(stmt));

            // with 100 limit
            QueryImpl query = (QueryImpl) qm.createQuery(stmt, Query.XPATH);
            query.setLimit(100);
            readResult(query.execute());
        } finally {
            index.setResultFetchSize(resultFetchSize);
        }

        for (NodeIterator it = testRootNode.getNodes(); it.hasNext(); ) {
            it.nextNode().remove();
            superuser.save();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.query.lucene.SearchIndex

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.