Package org.jboss.dna.graph.query

Examples of org.jboss.dna.graph.query.QueryResults


     */
    public QueryResults search( final String fullTextSearchExpression,
                                int maxResults,
                                int offset ) {
        FullTextSearchRequest request = requests.search(getCurrentWorkspaceName(), fullTextSearchExpression, maxResults, offset);
        QueryResults results = new org.jboss.dna.graph.query.process.QueryResults(request.getResultColumns(),
                                                                                  request.getStatistics(), request.getTuples());
        return results;
    }
View Full Code Here


    @Override
    public void process( AccessQueryRequest request ) {
        PathWorkspace workspace = getWorkspace(request, request.workspace());
        if (workspace == null) return;
        final ExecutionContext context = getExecutionContext();
        QueryResults results = workspace.query(context, request);
        if (results != null) {
            request.setResults(results.getTuples(), results.getStatistics());
        } else {
            super.processUnknownRequest(request);
        }
    }
View Full Code Here

    @Override
    public void process( FullTextSearchRequest request ) {
        PathWorkspace workspace = getWorkspace(request, request.workspace());
        if (workspace == null) return;
        final ExecutionContext context = getExecutionContext();
        QueryResults results = workspace.search(context, request.expression());
        if (results != null) {
            request.setResults(results.getColumns(), results.getTuples(), results.getStatistics());
        } else {
            super.processUnknownRequest(request);
        }
    }
View Full Code Here

    @Override
    public void process( AccessQueryRequest request ) {
        MapWorkspace workspace = getWorkspace(request, request.workspace());
        if (workspace == null) return;
        final ExecutionContext context = getExecutionContext();
        QueryResults results = workspace.query(context, request);
        if (results != null) {
            request.setResults(results.getTuples(), results.getStatistics());
        } else {
            super.processUnknownRequest(request);
        }
    }
View Full Code Here

    @Override
    public void process( FullTextSearchRequest request ) {
        MapWorkspace workspace = getWorkspace(request, request.workspace());
        if (workspace == null) return;
        final ExecutionContext context = getExecutionContext();
        QueryResults results = workspace.search(context, request.expression());
        if (results != null) {
            request.setResults(results.getColumns(), results.getTuples(), results.getStatistics());
        } else {
            super.processUnknownRequest(request);
        }
    }
View Full Code Here

    }

    @Test
    public void shouldFindNodesByFullTextSearch() {
        indexWorkspace(workspaceName1);
        QueryResults results = search(workspaceName1, "Toyota Prius", 10, 0);
        assertThat(results, is(notNullValue()));
        assertRowCount(results, 2);
        Location first = (Location)(results.getTuples().get(0)[0]);
        Location second = (Location)(results.getTuples().get(1)[0]);
        assertThat(first.getPath(), is(path("/Cars/Hybrid/Toyota Prius")));
        assertThat(second.getPath(), is(path("/Cars/Hybrid/Toyota Highlander")));
    }
View Full Code Here

    }

    @Test
    public void shouldFindNodesByFullTextSearchWithOffset() {
        indexWorkspace(workspaceName1);
        QueryResults results = search(workspaceName1, "toyota prius", 1, 0);
        assertThat(results, is(notNullValue()));
        assertRowCount(results, 1);
        Location first = (Location)(results.getTuples().get(0)[0]);
        assertThat(first.getPath(), is(path("/Cars/Hybrid/Toyota Prius")));

        results = search(workspaceName1, "+Toyota", 1, 1);
        assertThat(results, is(notNullValue()));
        assertRowCount(results, 1);
        first = (Location)(results.getTuples().get(0)[0]);
        assertThat(first.getPath(), is(path("/Cars/Hybrid/Toyota Highlander")));
    }
View Full Code Here

    @Test
    public void shouldFindAllNodesBySimpleQuery() {
        indexWorkspace(workspaceName1);
        String query = "SELECT [jcr:primaryType] FROM __ALLNODES__";
        QueryResults results = query(workspaceName1, query);
        assertRowCount(results, 18);
    }
View Full Code Here

    @Test
    public void shouldFindNodesBySimpleQuery() {
        indexWorkspace(workspaceName1);
        String query = "SELECT model, maker FROM __ALLNODES__";
        QueryResults results = query(workspaceName1, query);
        assertRowCount(results, 18);
    }
View Full Code Here

    @Test
    public void shouldFindNodesBySimpleQueryWithEqualityComparisonCriteria() {
        indexWorkspace(workspaceName1);
        String query = "SELECT model, maker FROM __ALLNODES__ WHERE maker = 'Toyota'";
        QueryResults results = query(workspaceName1, query);
        assertRowCount(results, 2);
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.query.QueryResults

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.