Examples of PropertyRestriction


Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

            // when using the LowCostLuceneIndexProvider
            // which is used for testing
        } else {
            qs.add(getFullTextQuery(ft, analyzer, reader));
        }
        PropertyRestriction pr = filter.getPropertyRestriction(NATIVE_QUERY_FUNCTION);
        if (pr != null) {
            String query = String.valueOf(pr.first.getValue(pr.first.getType()));
            QueryParser queryParser = new QueryParser(VERSION, "", analyzer);
            if (query.startsWith("mlt?")) {
                String mltQueryString = query.replace("mlt?", "");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

        StringBuilder buff = new StringBuilder("ordered");
        NodeState definition = plan.getDefinition();
        int depth = 1;
        boolean found = false;
        if (plan.getPropertyRestriction() != null) {
            PropertyRestriction pr = plan.getPropertyRestriction();
            String propertyName = PathUtils.getName(pr.propertyName);
            String operation = null;
            PropertyValue value = null;      
            // TODO support pr.list
            if (pr.first == null && pr.last == null) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

        String pathPrefix = plan.getPathPrefix();
        Iterable<String> paths = null;
        OrderedContentMirrorStoreStrategy strategy
                = OrderedPropertyIndexLookup.getStrategy(plan.getDefinition());
        int depth = 1;
        PropertyRestriction pr = plan.getPropertyRestriction();
        if (pr != null) {
            String propertyName = PathUtils.getName(pr.propertyName);
            depth = PathUtils.getDepth(pr.propertyName);
            paths = strategy.query(plan.getFilter(), propertyName,
                    plan.getDefinition(), pr, pathPrefix);
        }
        if (paths == null && sortOrder != null && !sortOrder.isEmpty()) {
            // we could be here if we have a query where the ORDER BY makes us play it.
            for (OrderEntry oe : sortOrder) {
                String propertyName = PathUtils.getName(oe.getPropertyName());
                depth = PathUtils.getDepth(oe.getPropertyName());
                paths = strategy.query(plan.getFilter(), propertyName,
                        plan.getDefinition(), new PropertyRestriction(), pathPrefix);
            }
        }

        if (paths == null) {
            // if still here then something went wrong.
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

        Set<String> bestValues = emptySet();
        int bestDepth = 1;

        if (matchesNodeTypes) {
            for (String property : properties) {
                PropertyRestriction restriction =
                        filter.getPropertyRestriction(property);
                int depth = 1;

                if (restriction == null) {
                    // no direct restriction, try one with a relative path
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

        } else {
            qs.add(getFullTextQuery(ft, analyzer, reader));
        }

        //Check if native function is supported
        PropertyRestriction pr = null;
        if (defn.hasFunctionDefined()) {
            pr = filter.getPropertyRestriction(defn.getFunctionName());
        }

        if (pr != null) {
            String query = String.valueOf(pr.first.getValue(pr.first.getType()));
            QueryParser queryParser = new QueryParser(VERSION, "", analyzer);
            if (query.startsWith("mlt?")) {
                String mltQueryString = query.replace("mlt?", "");
                if (reader != null) {
                    Query moreLikeThis = MoreLikeThisHelper.getMoreLikeThis(reader, analyzer, mltQueryString);
                    if (moreLikeThis != null) {
                        qs.add(moreLikeThis);
                    }
                }
            }
            else {
                try {
                    qs.add(queryParser.parse(query));
                } catch (ParseException e) {
                    throw new RuntimeException(e);
                }
            }
        } else if (nonFullTextConstraints) {
            addNonFullTextConstraints(qs, filter, reader, analyzer,
                    defn);
        }

        if (qs.size() == 0
                && plan.getSortOrder() != null) {
            //This case indicates that query just had order by and no
            //property restriction defined. In this case property
            //existence queries for each sort entry

            for (OrderEntry oe : plan.getSortOrder()) {
                PropertyRestriction orderRest = new PropertyRestriction();
                orderRest.propertyName = oe.getPropertyName();
                Query q = createQuery(orderRest, defn);
                if (q != null) {
                    qs.add(q);
                }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

            // when using the LowCostLuceneIndexProvider
            // which is used for testing
        } else {
            qs.add(getFullTextQuery(ft, analyzer, reader));
        }
        PropertyRestriction pr = filter.getPropertyRestriction(NATIVE_QUERY_FUNCTION);
        if (pr != null) {
            String query = String.valueOf(pr.first.getValue(pr.first.getType()));
            QueryParser queryParser = new QueryParser(VERSION, "", analyzer);
            if (query.startsWith("mlt?")) {
                String mltQueryString = query.replace("mlt?", "");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

            if (paths == null && sortOrder != null && !sortOrder.isEmpty()) {
                // we could be here if we have a query where the ORDER BY makes us play it.
                for (OrderEntry oe : sortOrder) {
                    String propertyName = PathUtils.getName(oe.getPropertyName());
                    if (lookup.isIndexed(propertyName, "/", null)) {
                        paths = lookup.query(null, propertyName, new PropertyRestriction());
                    }
                }
            }
            if (paths == null) {
                // if still here then something went wrong.
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

            // when using the LowCostLuceneIndexProvider
            // which is used for testing
        } else {
            qs.add(getFullTextQuery(ft, analyzer, reader));
        }
        PropertyRestriction pr = filter.getPropertyRestriction(NATIVE_QUERY_FUNCTION);
        if (pr != null) {
            String query = String.valueOf(pr.first.getValue(pr.first.getType()));
            QueryParser queryParser = new QueryParser(VERSION, "", analyzer);
            if (query.startsWith("mlt?")) {
                String mltQueryString = query.replace("mlt?", "");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

                // we could be here if we have a query where the ORDER BY makes us play it.
                for (OrderEntry oe : sortOrder) {
                    String propertyName = PathUtils.getName(oe.getPropertyName());
                    depth = PathUtils.getDepth(oe.getPropertyName());
                    if (lookup.isIndexed(propertyName, "/", null)) {
                        paths = lookup.query(filter, propertyName, new PropertyRestriction());
                    }
                }
            }
            if (paths == null) {
                // if still here then something went wrong.
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction

            // when using the LowCostLuceneIndexProvider
            // which is used for testing
        } else {
            qs.add(getFullTextQuery(ft, analyzer, reader));
        }
        PropertyRestriction pr = filter.getPropertyRestriction(NATIVE_QUERY_FUNCTION);
        if (pr != null) {
            QueryParser queryParser = new QueryParser(VERSION, "", analyzer);
            String query = String.valueOf(pr.first.getValue(pr.first.getType()));
            try {
                qs.add(queryParser.parse(query));
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.