Search in sources :

Example 36 with QueryEngineSettings

use of org.apache.jackrabbit.oak.query.QueryEngineSettings in project jackrabbit-oak by apache.

the class PropertyIndexLookupTest method createFilter.

private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
    NodeTypeInfoProvider nodeTypes = new NodeStateNodeTypeInfoProvider(root);
    NodeTypeInfo type = nodeTypes.getNodeTypeInfo(nodeTypeName);
    SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
    return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
}
Also used : FilterImpl(org.apache.jackrabbit.oak.query.index.FilterImpl) NodeTypeInfo(org.apache.jackrabbit.oak.query.ast.NodeTypeInfo) SelectorImpl(org.apache.jackrabbit.oak.query.ast.SelectorImpl) QueryEngineSettings(org.apache.jackrabbit.oak.query.QueryEngineSettings) NodeStateNodeTypeInfoProvider(org.apache.jackrabbit.oak.query.NodeStateNodeTypeInfoProvider) NodeTypeInfoProvider(org.apache.jackrabbit.oak.query.ast.NodeTypeInfoProvider) NodeStateNodeTypeInfoProvider(org.apache.jackrabbit.oak.query.NodeStateNodeTypeInfoProvider)

Example 37 with QueryEngineSettings

use of org.apache.jackrabbit.oak.query.QueryEngineSettings in project jackrabbit-oak by apache.

the class PropertyIndexTest method createFilter.

private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
    NodeTypeInfoProvider nodeTypes = new NodeStateNodeTypeInfoProvider(root);
    NodeTypeInfo type = nodeTypes.getNodeTypeInfo(nodeTypeName);
    SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
    return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
}
Also used : FilterImpl(org.apache.jackrabbit.oak.query.index.FilterImpl) NodeTypeInfo(org.apache.jackrabbit.oak.query.ast.NodeTypeInfo) SelectorImpl(org.apache.jackrabbit.oak.query.ast.SelectorImpl) QueryEngineSettings(org.apache.jackrabbit.oak.query.QueryEngineSettings) NodeStateNodeTypeInfoProvider(org.apache.jackrabbit.oak.query.NodeStateNodeTypeInfoProvider) NodeTypeInfoProvider(org.apache.jackrabbit.oak.query.ast.NodeTypeInfoProvider) NodeStateNodeTypeInfoProvider(org.apache.jackrabbit.oak.query.NodeStateNodeTypeInfoProvider)

Example 38 with QueryEngineSettings

use of org.apache.jackrabbit.oak.query.QueryEngineSettings in project jackrabbit-oak by apache.

the class WhiteboardUtilsTest method queryMBean.

@Test
public void queryMBean() throws Exception {
    MBeanServer server = ManagementFactory.getPlatformMBeanServer();
    Oak oak = new Oak().with(server);
    Whiteboard wb = oak.getWhiteboard();
    QueryEngineSettings settings = new QueryEngineSettings();
    regs.add(WhiteboardUtils.registerMBean(wb, QueryEngineSettingsMBean.class, settings, "query", "settings"));
    assertNotNull(server.getObjectInstance(new ObjectName("org.apache.jackrabbit.oak:type=query,name=settings")));
}
Also used : QueryEngineSettings(org.apache.jackrabbit.oak.query.QueryEngineSettings) Oak(org.apache.jackrabbit.oak.Oak) MBeanServer(javax.management.MBeanServer) QueryEngineSettingsMBean(org.apache.jackrabbit.oak.api.jmx.QueryEngineSettingsMBean) ObjectName(javax.management.ObjectName) Test(org.junit.Test)

Example 39 with QueryEngineSettings

use of org.apache.jackrabbit.oak.query.QueryEngineSettings in project jackrabbit-oak by apache.

the class CugImportBaseTest method before.

@Before
public void before() throws Exception {
    ConfigurationParameters config = getConfigurationParameters();
    SecurityProvider securityProvider = CugSecurityProvider.newTestSecurityProvider(config);
    QueryEngineSettings queryEngineSettings = new QueryEngineSettings();
    queryEngineSettings.setFailTraversal(true);
    Jcr jcr = new Jcr();
    jcr.with(securityProvider);
    jcr.with(queryEngineSettings);
    repo = jcr.createRepository();
    adminSession = repo.login(new SimpleCredentials(UserConstants.DEFAULT_ADMIN_ID, UserConstants.DEFAULT_ADMIN_ID.toCharArray()));
    adminSession.getRootNode().addNode(TEST_NODE_NAME, NodeTypeConstants.NT_OAK_UNSTRUCTURED);
    adminSession.save();
}
Also used : SimpleCredentials(javax.jcr.SimpleCredentials) QueryEngineSettings(org.apache.jackrabbit.oak.query.QueryEngineSettings) SecurityProvider(org.apache.jackrabbit.oak.spi.security.SecurityProvider) Jcr(org.apache.jackrabbit.oak.jcr.Jcr) ConfigurationParameters(org.apache.jackrabbit.oak.spi.security.ConfigurationParameters) Before(org.junit.Before)

Example 40 with QueryEngineSettings

use of org.apache.jackrabbit.oak.query.QueryEngineSettings in project jackrabbit-oak by apache.

the class AbstractRepositoryTest method initJcr.

protected Jcr initJcr(Jcr jcr) {
    QueryEngineSettings qs = new QueryEngineSettings();
    qs.setFullTextComparisonWithoutIndex(true);
    jcr.with(BundlingConfigInitializer.INSTANCE);
    return jcr.withAsyncIndexing().with(qs);
}
Also used : QueryEngineSettings(org.apache.jackrabbit.oak.query.QueryEngineSettings)

Aggregations

QueryEngineSettings (org.apache.jackrabbit.oak.query.QueryEngineSettings)49 SelectorImpl (org.apache.jackrabbit.oak.query.ast.SelectorImpl)29 FilterImpl (org.apache.jackrabbit.oak.query.index.FilterImpl)29 Test (org.junit.Test)24 QueryIndex (org.apache.jackrabbit.oak.spi.query.QueryIndex)17 LinkedList (java.util.LinkedList)14 NodeStateNodeTypeInfoProvider (org.apache.jackrabbit.oak.query.NodeStateNodeTypeInfoProvider)12 NodeTypeInfo (org.apache.jackrabbit.oak.query.ast.NodeTypeInfo)12 NodeTypeInfoProvider (org.apache.jackrabbit.oak.query.ast.NodeTypeInfoProvider)12 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)10 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)5 Cursor (org.apache.jackrabbit.oak.spi.query.Cursor)4 Before (org.junit.Before)4 SimpleCredentials (javax.jcr.SimpleCredentials)3 DefaultSolrConfiguration (org.apache.jackrabbit.oak.plugins.index.solr.configuration.DefaultSolrConfiguration)3 OakSolrConfiguration (org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfiguration)3 OakSolrConfigurationProvider (org.apache.jackrabbit.oak.plugins.index.solr.configuration.OakSolrConfigurationProvider)3 SolrServerProvider (org.apache.jackrabbit.oak.plugins.index.solr.server.SolrServerProvider)3 ConfigurationParameters (org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)3 SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)3