Examples of QueryEngineSettings


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

                return true;
            }
        };
        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(10 == cost);
    }
View Full Code Here

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

        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 name = 'hello')", new QueryEngineSettings());
        filter.restrictProperty("name", Operator.EQUAL, PropertyValues.newString("hello"));
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(Double.POSITIVE_INFINITY == cost);
    }
View Full Code Here

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

                return true;
            }
        };
        SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);

        FilterImpl filter = new FilterImpl(selector, "select * from [nt:base] as a where name = 'hello')", new QueryEngineSettings());
        filter.restrictProperty("name", Operator.EQUAL, PropertyValues.newString("hello"));
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(10 == cost);
    }
View Full Code Here

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

        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 jcr:primaryType = 'nt:unstructured')", new QueryEngineSettings());
        filter.restrictProperty("jcr:primaryType", Operator.EQUAL, PropertyValues.newString("nt:unstructured"));
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(Double.POSITIVE_INFINITY == cost);
    }
View Full Code Here

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

                return true;
            }
        };
        SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);

        FilterImpl filter = new FilterImpl(selector, "select * from [nt:base] as a where jcr:primaryType = 'nt:unstructured')", new QueryEngineSettings());
        filter.restrictProperty("jcr:primaryType", Operator.EQUAL, PropertyValues.newString("nt:unstructured"));
        double cost = solrQueryIndex.getCost(filter, root);
        assertTrue(10 == cost);
    }
View Full Code Here

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

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

        assertEquals(10, plan.getEstimatedEntryCount());
    }

    @Test
    public void copy() throws Exception{
        Filter f = new FilterImpl(null, "SELECT * FROM [nt:file]", new QueryEngineSettings());
        IndexPlan.Builder b = new IndexPlan.Builder();
        IndexPlan plan1 = b.setEstimatedEntryCount(10).setFilter(f).setDelayed(true).build();

        IndexPlan plan2 = plan1.copy();
        plan2.setFilter(new FilterImpl(null, "SELECT * FROM [oak:Unstructured]", new QueryEngineSettings()));

        assertEquals(plan1.getEstimatedEntryCount(), 10);
        assertEquals(plan2.getEstimatedEntryCount(), 10);
        assertTrue(plan1.isDelayed());
        assertTrue(plan2.isDelayed());
View Full Code Here

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

        DocumentMK m = new DocumentMK.Builder()
                .setClusterId(1)
                .memoryCacheSize(64 * 1024 * 1024)
                .setMongoDB(connection.getDB())
                .open();
        QueryEngineSettings qs = new QueryEngineSettings();
        qs.setFullTextComparisonWithoutIndex(true);
        return new Jcr(new KernelNodeStore(m)).with(qs).createRepository();
    }
View Full Code Here

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

    @Override
    protected Repository createRepository(MongoConnection connection) {
        DocumentNodeStore store = new DocumentMK.Builder().setClusterId(1).
                memoryCacheSize(64 * 1024 * 1024).
                setMongoDB(connection.getDB()).getNodeStore();
        QueryEngineSettings qs = new QueryEngineSettings();
        qs.setFullTextComparisonWithoutIndex(true);
        return new Jcr(store).with(qs).createRepository();
    }
View Full Code Here

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

            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
TOP
Copyright © 2018 www.massapi.com. 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.