Package org.apache.jackrabbit.oak.query

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


        final String parent = relPaths.size() == 0 ? "" : relPaths.iterator().next();
        // we only restrict non-full-text conditions if there is
        // no relative property in the full-text constraint
        final boolean nonFullTextConstraints = parent.isEmpty();
        final int parentDepth = getDepth(parent);
        QueryEngineSettings settings = filter.getQueryEngineSettings();
        Iterator<LuceneResultRow> itr = new AbstractIterator<LuceneResultRow>() {
            private final Deque<LuceneResultRow> queue = Queues.newArrayDeque();
            private final Set<String> seenPaths = Sets.newHashSet();
            private ScoreDoc lastDoc;
View Full Code Here


        String parent = relPaths.size() == 0 ? "" : relPaths.iterator().next();
        // we only restrict non-full-text conditions if there is
        // no relative property in the full-text constraint
        boolean nonFullTextConstraints = parent.isEmpty();
        Directory directory = newDirectory(root);
        QueryEngineSettings settings = filter.getQueryEngineSettings();
        if (directory == null) {
            return newPathCursor(Collections.<String> emptySet(), settings);
        }
        long s = System.currentTimeMillis();
        try {
View Full Code Here

    private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
        NodeState system = root.getChildNode(JCR_SYSTEM);
        NodeState types = system.getChildNode(JCR_NODE_TYPES);
        NodeState type = types.getChildNode(nodeTypeName);
        SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
        return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
    }
View Full Code Here

            String value) {
        NodeState system = root.getChildNode(JCR_SYSTEM);
        NodeState types = system.getChildNode(JCR_NODE_TYPES);
        NodeState type = types.getChildNode(NT_BASE);
        SelectorImpl selector = new SelectorImpl(type, NT_BASE);
        Filter filter = new FilterImpl(selector, "SELECT * FROM [nt:base]", new QueryEngineSettings());
        return Sets.newHashSet(lookup.query(filter, name,
                PropertyValues.newString(value)));
    }
View Full Code Here

    private static FilterImpl createFilter(NodeState indexed, String nodeTypeName) {
        NodeState system = indexed.getChildNode(JCR_SYSTEM);
        NodeState types = system.getChildNode(JCR_NODE_TYPES);
        NodeState type = types.getChildNode(nodeTypeName);
        SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
        return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
    }
View Full Code Here

        NodeState after = builder.getNodeState();

        NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY);

        QueryIndex queryIndex = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictPath("/newnode", Filter.PathRestriction.EXACT);
        filter.restrictProperty("prop", Operator.EQUAL,
                PropertyValues.newString("val"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
View Full Code Here

        NodeState after = builder.getNodeState();

        NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY);

        QueryIndex queryIndex = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
View Full Code Here

        NodeState after = builder.getNodeState();

        NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY);

        QueryIndex queryIndex = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "", new QueryEngineSettings());
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        filter.restrictFulltextCondition("bar");
        Cursor cursor = queryIndex.query(filter, indexed);
View Full Code Here

    private FilterImpl createFilter(String nodeTypeName) {
        NodeState system = root.getChildNode(JCR_SYSTEM);
        NodeState types = system.getChildNode(JCR_NODE_TYPES);
        NodeState type = types.getChildNode(nodeTypeName);
        SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
        return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
    }
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

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.