You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2008/04/07 11:02:27 UTC

svn commit: r645417 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/query/ main/java/org/apache/jackrabbit/core/query/lucene/ test/java/org/apache/jackrabbit/core/query/ test/java/o...

Author: mreutegg
Date: Mon Apr  7 02:02:19 2008
New Revision: 645417

URL: http://svn.apache.org/viewvc?rev=645417&view=rev
Log:
JCR-1104: JSR 283 support (work in progress)
- length query

Added:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertyMetaData.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingletonTokenStream.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/LengthTest.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/_2.cfs   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/deletable   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/segments   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/indexes   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/5a/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/5a/9a/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/5a/9a/d0fcc7f542bbb435bcb9ed30a2e2.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/ca/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/ca/fe/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/ca/fe/babecafebabecafebabecafebabe.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/de/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/de/ad/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/de/ad/beefcafebabecafebabecafebabe.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/names.properties   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/namespaces.properties   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/workspace.xml   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/_0.cfs   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments.gen   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_1   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_3   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/indexes   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/c9/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/c9/bb/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/ca/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/ca/fe/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/ca/fe/babecafebabecafebabecafebabe.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/de/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/de/ad/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/de/ad/beefcafebabecafebabecafebabe.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/names.properties   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/namespaces.properties   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/workspace.xml   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/c9/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/c9/bb/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/ca/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/ca/fe/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/ca/fe/babecafebabecafebabecafebabe.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/de/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/de/ad/
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/de/ad/beefcafebabecafebabecafebabe.n   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/names.properties   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/namespaces.properties   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/workspace.xml   (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldNames.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexFormatVersion.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/TestAll.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SearchManager.java Mon Apr  7 02:02:19 2008
@@ -338,6 +338,15 @@
 
     }
 
+    //------------------------< for testing only >------------------------------
+
+    /**
+     * @return the query handler implementation.
+     */
+    public QueryHandler getQueryHandler() {
+        return handler;
+    }
+
     //---------------< EventListener interface >--------------------------------
 
     public void onEvent(EventIterator events) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java Mon Apr  7 02:02:19 2008
@@ -131,6 +131,15 @@
         return qomFactory;
     }
 
+    //------------------------< testing only >----------------------------------
+
+    /**
+     * @return the query handler implementation.
+     */
+    QueryHandler getQueryHandler() {
+        return searchMgr.getQueryHandler();
+    }
+
     //---------------------------< internal >-----------------------------------
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldNames.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldNames.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldNames.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldNames.java Mon Apr  7 02:02:19 2008
@@ -83,6 +83,25 @@
     public static final String AGGREGATED_NODE_UUID = "_:AGGR_NODE_UUID".intern();
 
     /**
+     * Name of the field that contains the lengths of properties. The lengths
+     * are encoded using {@link #createNamedLength(String, long)}.
+     */
+    public static final String PROPERTY_LENGTHS = "_:PROPERTY_LENGTHS".intern();
+
+    /**
+     * Returns a named length for use as a term in the index. The named length
+     * is of the form: <code>propertyName</code> + '[' +
+     * {@link LongField#longToString(long)}.
+     *
+     * @param propertyName a property name.
+     * @param length the length of the property value.
+     * @return the named length string for use as a term in the index.
+     */
+    public static String createNamedLength(String propertyName, long length) {
+        return propertyName + '[' + LongField.longToString(length);
+    }
+
+    /**
      * Returns a named value for use as a term in the index. The named
      * value is of the form: <code>fieldName</code> + '\uFFFF' + value
      *

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexFormatVersion.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexFormatVersion.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexFormatVersion.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexFormatVersion.java Mon Apr  7 02:02:19 2008
@@ -17,18 +17,30 @@
 package org.apache.jackrabbit.core.query.lucene;
 
 import java.util.Collection;
+import java.io.IOException;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.TermPositions;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
 
 /**
- * This class indicates the lucene index format that is used. Version 1 formats
- * do not have the <code>PROPERTIES_SET</code> lucene fieldname and queries
- * assuming this format also run on newer versions. When the index is recreated
- * from scratch, the Version 2 format will automatically be used. This format is
- * faster certain queries, so if the index does not contain
- * <code>PROPERTIES_SET</code> fieldname and re-indexing is an option, this is
- * advisable. Existing indexes are not automatically upgraded to a newer
- * version!
+ * This class indicates the lucene index format that is used.
+ * <ul>
+ * <li><b>Version 1</b> is the initial index format, which is used for Jackrabbit
+ * releases 1.0 to 1.3.x. Unless a re-index happens upgraded Jackrabbit
+ * instances will still use this version.</li>
+ * <li><b>Version 2</b> is the index format introduced with Jackrabbit 1.4.x. It
+ * adds a <code>PROPERTIES_SET</code> field which contains all property names of
+ * a node. This speeds up queries that check the existence of a property.</li>
+ * <li><b>Version 3</b> is the index format introduced with Jackrabbit 1.5.x. It
+ * adds support for length queries using the newly added
+ * <code>PROPERTY_LENGTHS</code> field. Furthermore a Payload is added to
+ * <code>PROPERTIES</code> fields to indicate the property type.</li>
+ * </ul>
+ * Please note that existing indexes are not automatically upgraded to a newer
+ * version! If you want to take advantage of a certain 'feature' in an index
+ * format version you need to re-index the repository.
  */
 public class IndexFormatVersion {
 
@@ -38,11 +50,16 @@
     public static final IndexFormatVersion V1 = new IndexFormatVersion(1);
 
     /**
-     * V2 is the index format for Jackrabbit releases >= 1.4
+     * V2 is the index format for Jackrabbit releases 1.4.x
      */
     public static final IndexFormatVersion V2 = new IndexFormatVersion(2);
 
     /**
+     * V3 is the index format for Jackrabbit releases >= 1.5
+     */
+    public static final IndexFormatVersion V3 = new IndexFormatVersion(3);
+
+    /**
      * The used version of the index format
      */
     private final int version;
@@ -75,13 +92,44 @@
      * @return the index format version of the index used by the given
      * index reader.
      */
-    public static IndexFormatVersion getVersion(IndexReader indexReader) {
-        Collection fields = indexReader.getFieldNames(IndexReader.FieldOption.ALL);
-        if (fields.contains(FieldNames.PROPERTIES_SET)
-                || indexReader.numDocs() == 0) {
+    public static IndexFormatVersion getVersion(IndexReader indexReader)
+            throws IOException {
+        Collection fields = indexReader.getFieldNames(
+                IndexReader.FieldOption.ALL);
+        if (hasPayloads(indexReader) || indexReader.numDocs() == 0) {
+            return IndexFormatVersion.V3;
+        } else if (fields.contains(FieldNames.PROPERTIES_SET)) {
             return IndexFormatVersion.V2;
         } else {
             return IndexFormatVersion.V1;
         }
+    }
+
+    /**
+     * @param reader the index reader.
+     * @return <code>true</code> if the {@link FieldNames#PROPERTIES} fields
+     *         contain payloads; <code>false</code> otherwise.
+     * @throws IOException if an error occurs while reading from the index.
+     */
+    public static boolean hasPayloads(IndexReader reader) throws IOException {
+        TermPositions tp = reader.termPositions();
+        try {
+            TermEnum terms = reader.terms(
+                    new Term(FieldNames.PROPERTIES, ""));
+            try {
+                if (terms.next() && terms.term().field() == FieldNames.PROPERTIES) {
+                    tp.seek(terms);
+                    if (tp.next()) {
+                        tp.nextPosition();
+                        return tp.isPayloadAvailable();
+                    }
+                }
+            } finally {
+                terms.close();
+            }
+        } finally {
+            tp.close();
+        }
+        return false;
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java Mon Apr  7 02:02:19 2008
@@ -91,7 +91,7 @@
  * Implements a query builder that takes an JQOM and creates a lucene {@link
  * org.apache.lucene.search.Query} tree that can be executed on an index.
  */
-public class JQOM2LuceneQueryBuilder implements QOMTreeVisitor {
+public class JQOM2LuceneQueryBuilder implements QOMTreeVisitor, QueryObjectModelConstants {
 
     /**
      * Logger for this class
@@ -400,9 +400,59 @@
         throw new UnsupportedOperationException("not yet implemented");
     }
 
-    public Object visit(LengthImpl node, Object data) {
-        // TODO: implement
-        throw new UnsupportedOperationException("not yet implemented");
+    public Object visit(LengthImpl node, Object data) throws Exception {
+        if (version.getVersion() < IndexFormatVersion.V3.getVersion()) {
+            throw new InvalidQueryException("Length operator is only " +
+                    "available with index version >= 3. Please re-index " +
+                    "repository and execute query again.");
+        }
+        PropertyValueImpl pv = (PropertyValueImpl) node.getPropertyValue();
+        String propName = npResolver.getJCRName(pv.getPropertyQName());
+        if (data instanceof ComparisonImpl) {
+            ComparisonImpl comp = (ComparisonImpl) data;
+            int operator = comp.getOperator();
+            Value v = (Value) ((StaticOperandImpl) comp.getOperand2()).accept(this, data);
+            String namedLength = FieldNames.createNamedLength(propName, v.getLong());
+
+            switch (operator) {
+                case OPERATOR_EQUAL_TO:
+                    return new TermQuery(new Term(FieldNames.PROPERTY_LENGTHS, namedLength));
+                case OPERATOR_GREATER_THAN:
+                    Term lower = new Term(FieldNames.PROPERTY_LENGTHS, namedLength);
+                    Term upper = new Term(FieldNames.PROPERTY_LENGTHS,
+                            FieldNames.createNamedLength(propName, Long.MAX_VALUE));
+                    return new RangeQuery(lower, upper, false);
+                case OPERATOR_GREATER_THAN_OR_EQUAL_TO:
+                    lower = new Term(FieldNames.PROPERTY_LENGTHS, namedLength);
+                    upper = new Term(FieldNames.PROPERTY_LENGTHS,
+                            FieldNames.createNamedLength(propName, Long.MAX_VALUE));
+                    return new RangeQuery(lower, upper, true);
+                case OPERATOR_LESS_THAN:
+                    lower = new Term(FieldNames.PROPERTY_LENGTHS,
+                            FieldNames.createNamedLength(propName, -1));
+                    upper = new Term(FieldNames.PROPERTY_LENGTHS, namedLength);
+                    return new RangeQuery(lower, upper, false);
+                case OPERATOR_LESS_THAN_OR_EQUAL_TO:
+                    lower = new Term(FieldNames.PROPERTY_LENGTHS,
+                            FieldNames.createNamedLength(propName, -1));
+                    upper = new Term(FieldNames.PROPERTY_LENGTHS, namedLength);
+                    return new RangeQuery(lower, upper, true);
+                case OPERATOR_LIKE:
+                    throw new InvalidQueryException("Like operator cannot be used with length operand");
+                case OPERATOR_NOT_EQUAL_TO:
+                    Query all = Util.createMatchAllQuery(propName, version);
+                    BooleanQuery b = new BooleanQuery();
+                    b.add(all, BooleanClause.Occur.SHOULD);
+                    b.add(new TermQuery(new Term(FieldNames.PROPERTY_LENGTHS, namedLength)),
+                            BooleanClause.Occur.MUST_NOT);
+                    return b;
+                default:
+                    throw new InvalidQueryException(
+                            "Unknown operator " + operator);
+            }
+        } else {
+            throw new UnsupportedOperationException("not yet implemented");
+        }
     }
 
     /**
@@ -452,34 +502,34 @@
             String prefix = stringValue.substring(0, stringValue.indexOf(':') + 1);
 
             switch (operator) {
-                case QueryObjectModelConstants.OPERATOR_EQUAL_TO:
+                case OPERATOR_EQUAL_TO:
                     return new TermQuery(new Term(FieldNames.LABEL, stringValue));
-                case QueryObjectModelConstants.OPERATOR_GREATER_THAN:
+                case OPERATOR_GREATER_THAN:
                     Term lower = new Term(FieldNames.LABEL, stringValue);
                     Term upper = new Term(FieldNames.LABEL,
                             prefix + "\uFFFF");
                     return new RangeQuery(lower, upper, false);
-                case QueryObjectModelConstants.OPERATOR_GREATER_THAN_OR_EQUAL_TO:
+                case OPERATOR_GREATER_THAN_OR_EQUAL_TO:
                     lower = new Term(FieldNames.LABEL, stringValue);
                     upper = new Term(FieldNames.LABEL,
                             prefix + "\uFFFF");
                     return new RangeQuery(lower, upper, true);
-                case QueryObjectModelConstants.OPERATOR_LESS_THAN:
+                case OPERATOR_LESS_THAN:
                     lower = new Term(FieldNames.LABEL, prefix);
                     upper = new Term(FieldNames.LABEL, stringValue);
                     return new RangeQuery(lower, upper, false);
-                case QueryObjectModelConstants.OPERATOR_LESS_THAN_OR_EQUAL_TO:
+                case OPERATOR_LESS_THAN_OR_EQUAL_TO:
                     lower = new Term(FieldNames.LABEL, prefix);
                     upper = new Term(FieldNames.LABEL, stringValue);
                     return new RangeQuery(lower, upper, true);
-                case QueryObjectModelConstants.OPERATOR_LIKE:
+                case OPERATOR_LIKE:
                     if (stringValue.equals("%")) {
                         return new MatchAllDocsQuery();
                     } else {
                         return new WildcardQuery(FieldNames.LABEL,
                                 null, stringValue);
                     }
-                case QueryObjectModelConstants.OPERATOR_NOT_EQUAL_TO:
+                case OPERATOR_NOT_EQUAL_TO:
                     MatchAllDocsQuery all = new MatchAllDocsQuery();
                     BooleanQuery b = new BooleanQuery();
                     b.add(all, BooleanClause.Occur.SHOULD);
@@ -529,37 +579,37 @@
             String propName = npResolver.getJCRName(node.getPropertyQName());
             String text = FieldNames.createNamedValue(propName, stringValue);
             switch (operator) {
-                case QueryObjectModelConstants.OPERATOR_EQUAL_TO:
+                case OPERATOR_EQUAL_TO:
                     return new TermQuery(new Term(FieldNames.PROPERTIES, text));
-                case QueryObjectModelConstants.OPERATOR_GREATER_THAN:
+                case OPERATOR_GREATER_THAN:
                     Term lower = new Term(FieldNames.PROPERTIES, text);
                     Term upper = new Term(FieldNames.PROPERTIES,
                             FieldNames.createNamedValue(propName, "\uFFFF"));
                     return new RangeQuery(lower, upper, false);
-                case QueryObjectModelConstants.OPERATOR_GREATER_THAN_OR_EQUAL_TO:
+                case OPERATOR_GREATER_THAN_OR_EQUAL_TO:
                     lower = new Term(FieldNames.PROPERTIES, text);
                     upper = new Term(FieldNames.PROPERTIES,
                             FieldNames.createNamedValue(propName, "\uFFFF"));
                     return new RangeQuery(lower, upper, true);
-                case QueryObjectModelConstants.OPERATOR_LESS_THAN:
+                case OPERATOR_LESS_THAN:
                     lower = new Term(FieldNames.PROPERTIES,
                             FieldNames.createNamedValue(propName, ""));
                     upper = new Term(FieldNames.PROPERTIES, text);
                     return new RangeQuery(lower, upper, false);
-                case QueryObjectModelConstants.OPERATOR_LESS_THAN_OR_EQUAL_TO:
+                case OPERATOR_LESS_THAN_OR_EQUAL_TO:
                     lower = new Term(FieldNames.PROPERTIES,
                             FieldNames.createNamedValue(propName, ""));
                     upper = new Term(FieldNames.PROPERTIES, text);
                     return new RangeQuery(lower, upper, true);
-                case QueryObjectModelConstants.OPERATOR_LIKE:
+                case OPERATOR_LIKE:
                     if (stringValue.equals("%")) {
-                        return new MatchAllQuery(propName);
+                        return Util.createMatchAllQuery(propName, version);
                     } else {
                         return new WildcardQuery(FieldNames.PROPERTIES,
                                 propName, stringValue);
                     }
-                case QueryObjectModelConstants.OPERATOR_NOT_EQUAL_TO:
-                    MatchAllQuery all = new MatchAllQuery(propName);
+                case OPERATOR_NOT_EQUAL_TO:
+                    Query all = Util.createMatchAllQuery(propName, version);
                     BooleanQuery b = new BooleanQuery();
                     b.add(all, BooleanClause.Occur.SHOULD);
                     b.add(new TermQuery(new Term(FieldNames.PROPERTIES, text)),
@@ -721,6 +771,8 @@
             } else {
                 return new CaseTermQuery.Lower(query.getTerm());
             }
+        } else if (query.getTerm().field() == FieldNames.PROPERTIES_SET) {
+            return query;
         } else {
             throw new InvalidQueryException(
                     "Upper/LowerCase not supported on field "

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java Mon Apr  7 02:02:19 2008
@@ -343,6 +343,11 @@
             default:
                 throw new IllegalArgumentException("illegal internal value type");
         }
+
+        // add length
+        if (indexFormatVersion.getVersion() >= IndexFormatVersion.V3.getVersion()) {
+            addLength(doc, fieldName, value);
+        }
     }
 
     /**
@@ -440,7 +445,8 @@
      * @param internalValue The value for the field to add to the document.
      */
     protected void addBooleanValue(Document doc, String fieldName, Object internalValue) {
-        doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), false));
+        doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(),
+                PropertyType.BOOLEAN));
     }
 
     /**
@@ -449,16 +455,27 @@
      *
      * @param fieldName     The name of the field to add
      * @param internalValue The value for the field to add to the document.
-     * @param store         <code>true</code> if the value should be stored,
-     *                      <code>false</code> otherwise
+     * @param propertyType  the property type.
      */
     protected Field createFieldWithoutNorms(String fieldName,
-            String internalValue, boolean store) {
-        Field field = new Field(FieldNames.PROPERTIES,
-                FieldNames.createNamedValue(fieldName, internalValue),
-                store ? Field.Store.YES : Field.Store.NO, Field.Index.NO_NORMS,
-                Field.TermVector.NO);
-        return field;
+                                            String internalValue,
+                                            int propertyType) {
+        if (indexFormatVersion.getVersion()
+                >= IndexFormatVersion.V3.getVersion()) {
+            Field field = new Field(FieldNames.PROPERTIES,
+                    new SingletonTokenStream(
+                            FieldNames.createNamedValue(fieldName, internalValue),
+                            propertyType)
+                    );
+            field.setOmitNorms(true);
+            return field;
+        } else {
+            Field field = new Field(FieldNames.PROPERTIES,
+                    FieldNames.createNamedValue(fieldName, internalValue),
+                    Field.Store.NO, Field.Index.NO_NORMS,
+                    Field.TermVector.NO);
+            return field;
+        }
     }
 
     /**
@@ -476,7 +493,8 @@
     protected void addCalendarValue(Document doc, String fieldName, Object internalValue) {
         Calendar value = (Calendar) internalValue;
         long millis = value.getTimeInMillis();
-        doc.add(createFieldWithoutNorms(fieldName, DateField.timeToString(millis), false));
+        doc.add(createFieldWithoutNorms(fieldName, DateField.timeToString(millis),
+                PropertyType.DATE));
     }
 
     /**
@@ -490,7 +508,8 @@
      */
     protected void addDoubleValue(Document doc, String fieldName, Object internalValue) {
         double doubleVal = ((Double) internalValue).doubleValue();
-        doc.add(createFieldWithoutNorms(fieldName, DoubleField.doubleToString(doubleVal), false));
+        doc.add(createFieldWithoutNorms(fieldName, DoubleField.doubleToString(doubleVal),
+                PropertyType.DOUBLE));
     }
 
     /**
@@ -504,7 +523,8 @@
      */
     protected void addLongValue(Document doc, String fieldName, Object internalValue) {
         long longVal = ((Long) internalValue).longValue();
-        doc.add(createFieldWithoutNorms(fieldName, LongField.longToString(longVal), false));
+        doc.add(createFieldWithoutNorms(fieldName, LongField.longToString(longVal),
+                PropertyType.LONG));
     }
 
     /**
@@ -519,7 +539,11 @@
     protected void addReferenceValue(Document doc, String fieldName, Object internalValue) {
         UUID value = (UUID) internalValue;
         String uuid = value.toString();
-        doc.add(createFieldWithoutNorms(fieldName, uuid, true));
+        doc.add(createFieldWithoutNorms(fieldName, uuid,
+                PropertyType.REFERENCE));
+        doc.add(new Field(FieldNames.PROPERTIES,
+                FieldNames.createNamedValue(fieldName, uuid),
+                Field.Store.YES, Field.Index.NO, Field.TermVector.NO));
     }
 
     /**
@@ -539,7 +563,8 @@
         } catch (NamespaceException e) {
             // will never happen
         }
-        doc.add(createFieldWithoutNorms(fieldName, pathString, false));
+        doc.add(createFieldWithoutNorms(fieldName, pathString,
+                PropertyType.PATH));
     }
 
     /**
@@ -594,7 +619,8 @@
 
         // simple String
         String stringValue = (String) internalValue;
-        doc.add(createFieldWithoutNorms(fieldName, stringValue, false));
+        doc.add(createFieldWithoutNorms(fieldName, stringValue,
+                PropertyType.STRING));
         if (tokenized) {
             if (stringValue.length() == 0) {
                 return;
@@ -632,7 +658,8 @@
             Name qualiName = (Name) internalValue;
             String normValue = mappings.getPrefix(qualiName.getNamespaceURI())
                     + ":" + qualiName.getLocalName();
-            doc.add(createFieldWithoutNorms(fieldName, normValue, false));
+            doc.add(createFieldWithoutNorms(fieldName, normValue,
+                    PropertyType.NAME));
         } catch (NamespaceException e) {
             // will never happen
         }
@@ -745,5 +772,31 @@
         } else {
             return indexingConfig.getNodeBoost(node);
         }
+    }
+
+    /**
+     * Adds a {@link FieldNames#PROPERTY_LENGTHS} field to <code>document</code>
+     * with a named length value.
+     *
+     * @param doc          the lucene document.
+     * @param propertyName the property name.
+     * @param value        the internal value.
+     */
+    protected void addLength(Document doc,
+                             String propertyName,
+                             InternalValue value) {
+        long length;
+        if (value.getType() == PropertyType.BINARY) {
+            length = value.getBLOBFileValue().getLength();
+        } else if (value.getType() == PropertyType.NAME
+                || value.getType() == PropertyType.PATH) {
+            // TODO https://jsr-283.dev.java.net/issues/show_bug.cgi?id=464
+            return;
+        } else {
+            length = value.toString().length();
+        }
+        doc.add(new Field(FieldNames.PROPERTY_LENGTHS,
+                FieldNames.createNamedLength(propertyName, length),
+                Field.Store.NO, Field.Index.NO_NORMS));
     }
 }

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertyMetaData.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertyMetaData.java?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertyMetaData.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertyMetaData.java Mon Apr  7 02:02:19 2008
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.lucene;
+
+/**
+ * <code>PropertyMetaData</code> encapsulates the payload byte array and
+ * provides methods to access the property meta data.
+ */
+public final class PropertyMetaData {
+
+    /**
+     * The property type.
+     */
+    private final int propertyType;
+
+    /**
+     * Creates a new PropertyMetaData with the given <code>propertyType</code>.
+     *
+     * @param propertyType the property type.
+     */
+    public PropertyMetaData(int propertyType) {
+        this.propertyType = propertyType;
+    }
+
+    /**
+     * @return the property type.
+     * @see javax.jcr.PropertyType
+     */
+    public int getPropertyType() {
+        return propertyType;
+    }
+
+    /**
+     * Creates a <code>PropertyMetaData</code> from a byte array.
+     *
+     * @param data the payload data array.
+     * @return a <code>PropertyMetaData</code> from a byte array.
+     */
+    public static PropertyMetaData fromByteArray(byte[] data) {
+        return new PropertyMetaData(data[0]);
+    }
+
+    /**
+     * @return returns a byte array representation of this PropertyMetaData for
+     *         use as a lucene token payload.
+     */
+    public byte[] toByteArray() {
+        return new byte[]{(byte) propertyType};
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertyMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingletonTokenStream.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingletonTokenStream.java?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingletonTokenStream.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingletonTokenStream.java Mon Apr  7 02:02:19 2008
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.lucene;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.index.Payload;
+
+/**
+ * <code>SingletonTokenStream</code> implements a token stream that wraps a
+ * single value with a given property type. The property type is stored as a
+ * payload on the single returned token.
+ */
+public final class SingletonTokenStream extends TokenStream {
+
+    /**
+     * The single token to return.
+     */
+    private Token t;
+
+    /**
+     * Creates a new SingleTokenStream with the given value and a property
+     * <code>type</code>.
+     *
+     * @param value the string value that will be returned with the token.
+     * @param type the JCR property type.
+     */
+    public SingletonTokenStream(String value, int type) {
+        super();
+        t = new Token(value, 0, value.length());
+        t.setPayload(new Payload(new PropertyMetaData(type).toByteArray()));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Token next() {
+        try {
+            return t;
+        } finally {
+            t = null;
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingletonTokenStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java Mon Apr  7 02:02:19 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.core.query.lucene.IndexFormatVersion;
+import org.apache.jackrabbit.core.query.lucene.SearchIndex;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.query.QueryManager;
+
+/**
+ * <code>IndexFormatVersionTest</code> checks if the various index format
+ * versions are correctly read from the index.
+ */
+public class IndexFormatVersionTest extends AbstractJCRTest {
+
+    public void testVersionOne() throws RepositoryException {
+        checkIndexFormatVersion("index-format-v1", IndexFormatVersion.V1);
+    }
+
+    public void testVersionTwo() throws RepositoryException {
+        checkIndexFormatVersion("index-format-v2", IndexFormatVersion.V2);
+    }
+
+    public void testVersionThree() throws RepositoryException {
+        checkIndexFormatVersion("index-format-v3", IndexFormatVersion.V3);
+    }
+
+    private void checkIndexFormatVersion(String wspName,
+                                         IndexFormatVersion version)
+            throws RepositoryException {
+        Session session = helper.getSuperuserSession(wspName);
+        try {
+            QueryManager qm = session.getWorkspace().getQueryManager();
+            QueryHandler handler = ((QueryManagerImpl) qm).getQueryHandler();
+            SearchIndex index = (SearchIndex) handler;
+            assertEquals("Wrong index format", version.getVersion(),
+                    index.getIndexFormatVersion().getVersion());
+        } finally {
+            session.logout();
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java Mon Apr  7 02:02:19 2008
@@ -58,6 +58,7 @@
         suite.addTestSuite(IndexingAggregateTest.class);
         suite.addTestSuite(AxisQueryTest.class);
         suite.addTestSuite(ConcurrentQueryTest.class);
+        suite.addTestSuite(IndexFormatVersionTest.class);
 
         return suite;
     }

Added: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/LengthTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/LengthTest.java?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/LengthTest.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/LengthTest.java Mon Apr  7 02:02:19 2008
@@ -0,0 +1,288 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.qom;
+
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+import javax.jcr.PropertyType;
+import javax.jcr.query.QueryResult;
+import javax.jcr.query.InvalidQueryException;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Calendar;
+
+/**
+ * <code>LengthTest</code> performs tests with the Query Object Model length
+ * operand.
+ */
+public class LengthTest extends AbstractQOMTest {
+
+    private Node node;
+
+    private ValueFactory vf;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        node = testRootNode.addNode(nodeName1, testNodeType);
+        testRootNode.save();
+        vf = superuser.getValueFactory();
+    }
+
+    protected void tearDown() throws Exception {
+        node = null;
+        vf = null;
+        super.tearDown();
+    }
+
+    public void testStringLength() throws RepositoryException {
+        node.setProperty(propertyName1, "abc");
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+    
+    public void testBinaryLength() throws RepositoryException {
+        byte[] data = "abc".getBytes();
+        node.setProperty(propertyName1, new ByteArrayInputStream(data));
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+
+    public void testLongLength() throws RepositoryException {
+        node.setProperty(propertyName1, 123);
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+
+    public void testDoubleLength() throws RepositoryException {
+        node.setProperty(propertyName1, Math.PI);
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+
+    public void testDateLength() throws RepositoryException {
+        node.setProperty(propertyName1, Calendar.getInstance());
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+
+    public void testBooleanLength() throws RepositoryException {
+        node.setProperty(propertyName1, false);
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+
+    public void testNameLength() throws RepositoryException {
+        // TODO
+    }
+
+    public void testPathLength() throws RepositoryException {
+        // TODO
+    }
+
+    public void testReferenceLength() throws RepositoryException, NotExecutableException {
+        try {
+            if (!node.isNodeType(mixReferenceable)) {
+                node.addMixin(mixReferenceable);
+                node.save();
+            }
+        } catch (RepositoryException e) {
+            throw new NotExecutableException("Cannot add mix:referenceable to node");
+        }
+        node.setProperty(propertyName1, node);
+        node.save();
+        checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
+    }
+
+    public void testWeakReferenceLength() throws RepositoryException {
+        // TODO
+    }
+
+    public void testURILength() throws RepositoryException {
+        // TODO
+    }
+
+    public void testDecimalLength() throws RepositoryException {
+        // TODO
+    }
+
+    public void testLike() throws RepositoryException {
+        try {
+            executeQuery(propertyName1, OPERATOR_LIKE, 1);
+            fail("Must throw InvalidQueryException when like operator is used with length operand");
+        } catch (InvalidQueryException e) {
+            // expected
+        }
+    }
+
+    //------------------------< conversion tests >------------------------------
+
+    public void testLengthStringLiteral() throws RepositoryException {
+        node.setProperty(propertyName1, "abc");
+        node.save();
+
+        String length = String.valueOf(node.getProperty(propertyName1).getLength());
+        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(length));
+    }
+
+    public void testLengthBinaryLiteral() throws RepositoryException {
+        node.setProperty(propertyName1, "abc");
+        node.save();
+
+        String length = String.valueOf(node.getProperty(propertyName1).getLength());
+        InputStream in = new ByteArrayInputStream(length.getBytes());
+        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(in));
+    }
+
+    public void testLengthDoubleLiteral() throws RepositoryException {
+        node.setProperty(propertyName1, "abc");
+        node.save();
+
+        double length = node.getProperty(propertyName1).getLength();
+        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(length));
+    }
+
+    public void testLengthDateLiteral() throws RepositoryException {
+        node.setProperty(propertyName1, "abc");
+        node.save();
+
+        Calendar length = Calendar.getInstance();
+        length.setTimeInMillis(node.getProperty(propertyName1).getLength());
+        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(length));
+    }
+
+    public void testLengthBooleanLiteral() throws RepositoryException {
+        try {
+            executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(false));
+            fail("Boolean literal cannot be converted to long");
+        } catch (InvalidQueryException e) {
+            // expected
+        }
+    }
+
+    public void testLengthNameLiteral() throws RepositoryException {
+        try {
+            executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(
+                    propertyName1, PropertyType.NAME));
+            fail("Name literal cannot be converted to long");
+        } catch (InvalidQueryException e) {
+            // expected
+        }
+    }
+
+    public void testLengthPathLiteral() throws RepositoryException {
+        try {
+            executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(
+                    node.getPath(), PropertyType.PATH));
+            fail("Path literal cannot be converted to long");
+        } catch (InvalidQueryException e) {
+            // expected
+        }
+    }
+
+    public void testLengthReferenceLiteral() throws RepositoryException, NotExecutableException {
+        try {
+            if (!node.isNodeType(mixReferenceable)) {
+                node.addMixin(mixReferenceable);
+                node.save();
+            }
+        } catch (RepositoryException e) {
+            throw new NotExecutableException("Cannot add mix:referenceable to node");
+        }
+        try {
+            executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(node));
+            fail("Reference literal cannot be converted to long");
+        } catch (InvalidQueryException e) {
+            // expected
+        }
+    }
+
+    public void testLengthWeakReferenceLiteral() throws RepositoryException {
+        // TODO
+    }
+
+    public void testLengthURILiteral() throws RepositoryException {
+        // TODO
+    }
+
+    public void testLengthDecimalLiteral() throws RepositoryException {
+        // TODO
+    }
+
+    //------------------------< internal helpers >------------------------------
+
+    private void checkOperators(String propertyName,
+                                long length) throws RepositoryException {
+        checkLength(propertyName, OPERATOR_EQUAL_TO, length, true);
+        checkLength(propertyName, OPERATOR_EQUAL_TO, length - 1, false);
+
+        checkLength(propertyName, OPERATOR_GREATER_THAN, length - 1, true);
+        checkLength(propertyName, OPERATOR_GREATER_THAN, length, false);
+
+        checkLength(propertyName, OPERATOR_GREATER_THAN_OR_EQUAL_TO, length, true);
+        checkLength(propertyName, OPERATOR_GREATER_THAN_OR_EQUAL_TO, length + 1, false);
+
+        checkLength(propertyName, OPERATOR_LESS_THAN, length + 1, true);
+        checkLength(propertyName, OPERATOR_LESS_THAN, length, false);
+
+        checkLength(propertyName, OPERATOR_LESS_THAN_OR_EQUAL_TO, length, true);
+        checkLength(propertyName, OPERATOR_LESS_THAN_OR_EQUAL_TO, length - 1, false);
+
+        checkLength(propertyName, OPERATOR_NOT_EQUAL_TO, length - 1, true);
+        checkLength(propertyName, OPERATOR_NOT_EQUAL_TO, length, false);
+    }
+
+    private void checkLength(String propertyName,
+                             int operator,
+                             long length,
+                             boolean matches) throws RepositoryException {
+        Node[] result;
+        if (matches) {
+            result = new Node[]{node};
+        } else {
+            result = new Node[0];
+        }
+        checkResult(executeQuery(propertyName, operator, length), result);
+    }
+
+    private QueryResult executeQuery(String propertyName,
+                                     int operator,
+                                     long length) throws RepositoryException {
+        Value v = vf.createValue(length);
+        return executeQuery(propertyName, operator, v);
+    }
+
+    private QueryResult executeQuery(String propertyName,
+                                     int operator,
+                                     Value length) throws RepositoryException {
+        return qomFactory.createQuery(
+                qomFactory.selector(testNodeType, "s"),
+                qomFactory.and(
+                        qomFactory.childNode("s", testRoot),
+                        qomFactory.comparison(
+                                qomFactory.length(
+                                        qomFactory.propertyValue(
+                                                "s", propertyName)),
+                                operator,
+                                qomFactory.literal(length))
+
+                ), null, null).execute();
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/LengthTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/TestAll.java?rev=645417&r1=645416&r2=645417&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/TestAll.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/TestAll.java Mon Apr  7 02:02:19 2008
@@ -32,6 +32,7 @@
         suite.addTestSuite(BindVariableValueTest.class);
         suite.addTestSuite(ChildNodeTest.class);
         suite.addTestSuite(DescendantNodeTest.class);
+        suite.addTestSuite(LengthTest.class);
         suite.addTestSuite(NodeNameTest.class);
         suite.addTestSuite(PropertyExistenceTest.class);
         suite.addTestSuite(QueryObjectModelFactoryTest.class);

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/_2.cfs
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/_2.cfs?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/_2.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/deletable
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/deletable?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/deletable
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/segments
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/segments?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/_0/segments
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/indexes
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/indexes?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/index/indexes
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/5a/9a/d0fcc7f542bbb435bcb9ed30a2e2.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/5a/9a/d0fcc7f542bbb435bcb9ed30a2e2.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/5a/9a/d0fcc7f542bbb435bcb9ed30a2e2.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/ca/fe/babecafebabecafebabecafebabe.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/ca/fe/babecafebabecafebabecafebabe.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/ca/fe/babecafebabecafebabecafebabe.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/de/ad/beefcafebabecafebabecafebabe.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/de/ad/beefcafebabecafebabecafebabe.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/items/de/ad/beefcafebabecafebabecafebabe.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/names.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/names.properties?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/names.properties (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/names.properties Mon Apr  7 02:02:19 2008
@@ -0,0 +1,5 @@
+#string index
+#Wed Apr 02 18:14:08 CEST 2008
+root=1
+system=0
+unstructured=2

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/names.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/namespaces.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/namespaces.properties?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/namespaces.properties (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/namespaces.properties Mon Apr  7 02:02:19 2008
@@ -0,0 +1,6 @@
+#string index
+#Mon Apr 07 10:28:09 CEST 2008
+http\://www.jcp.org/jcr/1.0=1
+internal=0
+http\://www.jcp.org/jcr/nt/1.0=2
+=3

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/namespaces.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/workspace.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/workspace.xml?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/workspace.xml (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/workspace.xml Mon Apr  7 02:02:19 2008
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+<Workspace name="index-format-v1">
+
+  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+    <param name="path" value="${wsp.home}" />
+  </FileSystem>
+
+  <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
+
+  <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+    <param name="path" value="${wsp.home}/index" />
+  </SearchIndex>
+</Workspace>
+

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v1/workspace.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/_0.cfs
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/_0.cfs?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/_0.cfs
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments.gen
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments.gen?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments.gen
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_1
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_1?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_1
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_3
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_3?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/_0/segments_3
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/indexes
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/indexes?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/index/indexes
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/ca/fe/babecafebabecafebabecafebabe.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/ca/fe/babecafebabecafebabecafebabe.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/ca/fe/babecafebabecafebabecafebabe.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/de/ad/beefcafebabecafebabecafebabe.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/de/ad/beefcafebabecafebabecafebabe.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/items/de/ad/beefcafebabecafebabecafebabe.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/names.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/names.properties?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/names.properties (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/names.properties Mon Apr  7 02:02:19 2008
@@ -0,0 +1,5 @@
+#string index
+#Wed Apr 02 18:21:04 CEST 2008
+root=1
+system=0
+unstructured=2

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/names.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/namespaces.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/namespaces.properties?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/namespaces.properties (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/namespaces.properties Mon Apr  7 02:02:19 2008
@@ -0,0 +1,6 @@
+#string index
+#Mon Apr 07 10:40:50 CEST 2008
+http\://www.jcp.org/jcr/1.0=1
+internal=0
+http\://www.jcp.org/jcr/nt/1.0=2
+=3

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/namespaces.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/workspace.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/workspace.xml?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/workspace.xml (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/workspace.xml Mon Apr  7 02:02:19 2008
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+<Workspace name="index-format-v2">
+
+  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+    <param name="path" value="${wsp.home}" />
+  </FileSystem>
+
+  <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager" />
+
+  <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+    <param name="path" value="${wsp.home}/index" />
+  </SearchIndex>
+</Workspace>
+

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v2/workspace.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/c9/bb/26c0edf0408b8ab22e88c1edc593.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/ca/fe/babecafebabecafebabecafebabe.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/ca/fe/babecafebabecafebabecafebabe.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/ca/fe/babecafebabecafebabecafebabe.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/de/ad/beefcafebabecafebabecafebabe.n
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/de/ad/beefcafebabecafebabecafebabe.n?rev=645417&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/items/de/ad/beefcafebabecafebabecafebabe.n
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/names.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/names.properties?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/names.properties (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/names.properties Mon Apr  7 02:02:19 2008
@@ -0,0 +1,5 @@
+#string index
+#Wed Apr 02 18:21:04 CEST 2008
+root=1
+system=0
+unstructured=2

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/names.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/namespaces.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/namespaces.properties?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/namespaces.properties (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/namespaces.properties Mon Apr  7 02:02:19 2008
@@ -0,0 +1,6 @@
+#string index
+#Mon Apr 07 10:40:50 CEST 2008
+http\://www.jcp.org/jcr/1.0=1
+internal=0
+http\://www.jcp.org/jcr/nt/1.0=2
+=3

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/namespaces.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/workspace.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/workspace.xml?rev=645417&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/workspace.xml (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/workspace.xml Mon Apr  7 02:02:19 2008
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+<Workspace name="index-format-v3">
+
+  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+    <param name="path" value="${wsp.home}" />
+  </FileSystem>
+
+  <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager" />
+
+  <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+    <param name="path" value="${wsp.home}/index" />
+  </SearchIndex>
+</Workspace>
+

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/repository/workspaces/index-format-v3/workspace.xml
------------------------------------------------------------------------------
    svn:eol-style = native