Package org.apache.jackrabbit.oak.spi.query

Examples of org.apache.jackrabbit.oak.spi.query.IndexRow


    public PropertyValue currentProperty(String propertyName) {
        boolean relative = propertyName.indexOf('/') >= 0;
        if (cursor == null) {
            return null;
        }
        IndexRow r = currentRow;
        if (r == null) {
            return null;
        }
        String path = r.getPath();
        if (path == null) {
            return null;
        }
        Tree t = getTree(path);
        if (relative) {
View Full Code Here


        filter.restrictProperty("prop", Operator.EQUAL,
                PropertyValues.newString("val"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
        assertNotNull("first returned item should not be null", next);
        assertEquals("newnode", next.getPath());
        assertFalse(cursor.hasNext());
    }
View Full Code Here

        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
        assertNotNull("first returned item should not be null", next);
        assertEquals("/", next.getPath());
        assertNotNull(next.getValue("foo"));
        assertEquals(PropertyValues.newString("[bar]"), next.getValue("foo"));
        assertFalse(cursor.hasNext());
    }
View Full Code Here

        filter.restrictProperty("prop", Operator.EQUAL,
                PropertyValues.newString("val"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
        assertNotNull("first returned item should not be null", next);
        assertEquals("/newnode", next.getPath());
        assertFalse(cursor.hasNext());
    }
View Full Code Here

        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
        assertNotNull("first returned item should not be null", next);
        assertEquals("/", next.getPath());
        assertNotNull(next.getValue("foo"));
        assertEquals(PropertyValues.newString("[bar]"), next.getValue("foo"));
        assertFalse(cursor.hasNext());
    }
View Full Code Here

            pathCursor.remove();
        }

        @Override
        public IndexRow next() {
            final IndexRow pathRow = pathCursor.next();
            return new IndexRow() {

                @Override
                public String getPath() {
                    return pathRow.getPath();
                }

                @Override
                public PropertyValue getValue(String columnName) {
                    // overlay the score
                    if (QueryImpl.JCR_SCORE.equals(columnName)) {
                        return PropertyValues.newDouble(currentRow.score);
                    }
                    return pathRow.getValue(columnName);
                }
               
            };
        }
View Full Code Here

        public IndexRow next() {
            if (i < results.size()) {
                final SolrDocument doc = results.get(i);
                i++;
                return new IndexRow() {
                    @Override
                    public String getPath() {
                        return String.valueOf(doc.getFieldValue(
                                configuration.getPathField()));
                    }
View Full Code Here

            pathCursor.remove();
        }

        @Override
        public IndexRow next() {
            final IndexRow pathRow = pathCursor.next();
            return new IndexRow() {

                @Override
                public String getPath() {
                    return pathRow.getPath();
                }

                @Override
                public PropertyValue getValue(String columnName) {
                    // overlay the score
                    if (QueryImpl.JCR_SCORE.equals(columnName)) {
                        return PropertyValues.newDouble(currentRow.score);
                    }
                    return pathRow.getValue(columnName);
                }
               
            };
        }
View Full Code Here

        filter.restrictProperty("prop", Operator.EQUAL,
                PropertyValues.newString("val"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
        assertNotNull("first returned item should not be null", next);
        assertEquals("/newnode", next.getPath());
        assertFalse(cursor.hasNext());
    }
View Full Code Here

        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
        assertNotNull("first returned item should not be null", next);
        assertEquals("/", next.getPath());
        assertNotNull(next.getValue("foo"));
        assertEquals(PropertyValues.newString("[bar]"), next.getValue("foo"));
        assertFalse(cursor.hasNext());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.query.IndexRow

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.