Examples of FullTextExpression


Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

        // where b.y is null" - in this case the selector b
        // must not use an index condition on "y is null"
        // (".. is null" must be written as "not .. is not null").
        if (queryConstraint != null) {
            queryConstraint.restrict(f);
            FullTextExpression ft = queryConstraint.getFullTextConstraint(this);
            f.setFullTextConstraint(ft);
        }
        if (selectorCondition != null) {
            selectorCondition.restrict(f);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

        SolrQuery solrQuery = new SolrQuery();
        setDefaults(solrQuery);

        StringBuilder queryBuilder = new StringBuilder();

        FullTextExpression ft = filter.getFullTextConstraint();
        if (ft != null) {
            queryBuilder.append(getFullTextQuery(ft));
            queryBuilder.append(' ');
        } else if (filter.getFulltextConditions() != null) {
            Collection<String> fulltextConditions = filter.getFulltextConditions();
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

                fullTextString.append('(');
                for (int i = 0; i < or.list.size(); i++) {
                    if (i > 0 && i < or.list.size()) {
                        fullTextString.append(" OR ");
                    }
                    FullTextExpression e = or.list.get(i);
                    String orTerm = getFullTextQuery(e);
                    fullTextString.append(orTerm);
                }
                fullTextString.append(')');
                fullTextString.append(' ');
                return true;
            }

            @Override
            public boolean visit(FullTextAnd and) {
                fullTextString.append('(');
                for (int i = 0; i < and.list.size(); i++) {
                    if (i > 0 && i < and.list.size()) {
                        fullTextString.append(" AND ");
                    }
                    FullTextExpression e = and.list.get(i);
                    String andTerm = getFullTextQuery(e);
                    fullTextString.append(andTerm);
                }
                fullTextString.append(')');
                fullTextString.append(' ');
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

    @Test @Ignore("As of OAK-622 this should no longer be used. Removing later.")
    public void costFullTextConstraint() {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeState root = InitialContent.INITIAL_CONTENT;
        Filter filter = EasyMock.createNiceMock(Filter.class);
        FullTextExpression fte = EasyMock.createNiceMock(FullTextExpression.class);
        EasyMock.expect(filter.getFullTextConstraint()).andReturn(fte).anyTimes();
        EasyMock.replay(fte);
        EasyMock.replay(filter);

        assertEquals("if it contains FullText we don't serve", Double.POSITIVE_INFINITY,
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

        return Sets.intersection(s1, s2);
    }
   
    @Override
    public FullTextExpression getFullTextConstraint(SelectorImpl s) {
        FullTextExpression f1 = constraint1.getFullTextConstraint(s);
        FullTextExpression f2 = constraint2.getFullTextConstraint(s);
        if (f1 == null || f2 == null) {
            // the full-text index can not be used for conditions of the form
            // "contains(a, 'x') or b=123"
            return null;
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

        return result;
    }
   
    @Override
    public FullTextExpression getFullTextConstraint(SelectorImpl s) {
        FullTextExpression f1 = constraint1.getFullTextConstraint(s);
        FullTextExpression f2 = constraint2.getFullTextConstraint(s);
        if (f1 == null) {
            return f2;
        } else if (f2 == null) {
            return f1;
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

        // where b.y is null" - in this case the selector b
        // must not use an index condition on "y is null"
        // (".. is null" must be written as "not .. is not null").
        if (queryConstraint != null) {
            queryConstraint.restrict(f);
            FullTextExpression ft = queryConstraint.getFullTextConstraint(this);
            f.setFullTextConstraint(ft);
        }
        if (selectorCondition != null) {
            selectorCondition.restrict(f);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

    public double getCost(Filter filter, NodeState root) {
        if (!isLive(root)) {
            // unusable index
            return Double.POSITIVE_INFINITY;
        }
        FullTextExpression ft = filter.getFullTextConstraint();
        if (ft == null) {
            // no full-text condition: don't use this index,
            // as there might be a better one
            return Double.POSITIVE_INFINITY;
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

        return null;
    }

    @Override
    public String getPlan(Filter filter, NodeState root) {
        FullTextExpression ft = filter.getFullTextConstraint();
        Set<String> relPaths = getRelativePaths(ft);
        if (relPaths.size() > 1) {
            return new MultiLuceneIndex(filter, root, relPaths).getPlan();
        }
        String parent = relPaths.size() == 0 ? "" : relPaths.iterator().next();
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.fulltext.FullTextExpression

    @Override
    public Cursor query(Filter filter, NodeState root) {
        if (!isLive(root)) {
            throw new IllegalStateException("Lucene index is not live");
        }
        FullTextExpression ft = filter.getFullTextConstraint();
        Set<String> relPaths = getRelativePaths(ft);
        if (relPaths.size() > 1) {
            return new MultiLuceneIndex(filter, root, relPaths).query();
        }
        String parent = relPaths.size() == 0 ? "" : relPaths.iterator().next();
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.