Package org.apache.jackrabbit.oak.query

Examples of org.apache.jackrabbit.oak.query.QueryEngineSettings


        Tree someothernode = tree.addChild("someothernode");
        someothernode.addChild("someotherchild");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictPath("/somenode", Filter.PathRestriction.ALL_CHILDREN);
        Cursor cursor = index.query(filter, store.getRoot());
        assertCursor(
                cursor, "/somenode", "/somenode/child1",
                "/somenode/child2", "/somenode/child2/descendant");
View Full Code Here


        tree.addChild("someothernode").setProperty("foo", "bard");
        tree.addChild("anotherone").setProperty("foo", "a fool's bar");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictProperty("foo", Operator.EQUAL, PropertyValues.newString("bar"));
        Cursor cursor = index.query(filter, store.getRoot());
        assertCursor(cursor, "/somenode", "/anotherone");
    }
View Full Code Here

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        SelectorImpl selector = mock(SelectorImpl.class);
        Set<String> primaryTypes = new HashSet<String>();
        primaryTypes.add("nt:folder");
        when(selector.getPrimaryTypes()).thenReturn(primaryTypes);
        FilterImpl filter = new FilterImpl(selector, "select * from [nt:folder]", new QueryEngineSettings());
        Cursor cursor = index.query(filter, store.getRoot());
        assertCursor(cursor, "/afoldernode");
    }
View Full Code Here

    private boolean preparing;

    // TODO support "order by"
   
    public FilterImpl() {
        this(null, null, new QueryEngineSettings());
    }
View Full Code Here

        return new QueryEngineImpl() {
            @Override
            protected ExecutionContext getExecutionContext() {
                return new ExecutionContext(
                        rootTree.getNodeState(), ImmutableRoot.this,
                        new QueryEngineSettings(),
                        new PropertyIndexProvider());
            }
        };
    }
View Full Code Here

    }

    public SystemRoot(NodeStore store, CommitHook hook) {
        // FIXME: define proper default or pass workspace name with the constructor
        this(store, hook, Oak.DEFAULT_WORKSPACE_NAME, new OpenSecurityProvider(),
                new QueryEngineSettings(),
                new CompositeQueryIndexProvider());
    }
View Full Code Here

    public Oak with(@Nonnull Whiteboard whiteboard) {
        this.whiteboard = checkNotNull(whiteboard);
        if (securityProvider instanceof WhiteboardAware) {
            ((WhiteboardAware) securityProvider).setWhiteboard(whiteboard);
        }
        QueryEngineSettings queryEngineSettings = WhiteboardUtils.getService(whiteboard, QueryEngineSettings.class);
        if (queryEngineSettings != null) {
            this.queryEngineSettings = queryEngineSettings;
        }
        return this;
    }
View Full Code Here

                                 @Nonnull SecurityProvider securityProvider) {
        this.nodeStore = checkNotNull(nodeStore);
        this.commitHook = checkNotNull(commitHook);
        this.defaultWorkspaceName = checkNotNull(defaultWorkspaceName);
        this.securityProvider = checkNotNull(securityProvider);
        this.queryEngineSettings = queryEngineSettings != null ? queryEngineSettings : new QueryEngineSettings();
        this.indexProvider = indexProvider != null ? indexProvider : new CompositeQueryIndexProvider();
    }
View Full Code Here

        SolrServer solrServer = mock(SolrServer.class);
        OakSolrConfiguration configuration = new DefaultSolrConfiguration();
        SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);

        FilterImpl filter = new FilterImpl(selector, "", new QueryEngineSettings());
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(Double.POSITIVE_INFINITY == cost);
    }
View Full Code Here

        SolrServer solrServer = mock(SolrServer.class);
        OakSolrConfiguration configuration = new DefaultSolrConfiguration();
        SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);

        FilterImpl filter = new FilterImpl(selector, "select * from [nt:base] as a where isdescendantnode(a, '/test')", new QueryEngineSettings());
        filter.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(Double.POSITIVE_INFINITY == cost);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.query.QueryEngineSettings

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.