jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1089030 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/ main/java/org/apache/jackrabbit/core/value/ test/java/org/apache/jackrabbit/core/query/lucene/
Date Tue, 05 Apr 2011 13:22:30 GMT
Author: jukka
Date: Tue Apr  5 13:22:29 2011
New Revision: 1089030

URL: http://svn.apache.org/viewvc?rev=1089030&view=rev
Log:
JCR-2916: Avoid String.intern() when indexing

Patches by Alex Parvulescu

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IDFieldTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
Tue Apr  5 13:22:29 2011
@@ -482,13 +482,12 @@ abstract class AbstractIndex {
      * @throws IOException if the document cannot be added to the indexing
      *                     queue.
      */
-    @SuppressWarnings("unchecked")
     private Document getFinishedDocument(Document doc) throws IOException {
         if (!Util.isDocumentReady(doc)) {
             Document copy = new Document();
             // mark the document that reindexing is required
-            copy.add(new Field(FieldNames.REINDEXING_REQUIRED, "",
-                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+            copy.add(new Field(FieldNames.REINDEXING_REQUIRED, false, "",
+                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
             for (Fieldable f : doc.getFields()) {
                 Fieldable field = null;
                 Field.TermVector tv = getTermVectorParameter(f);
@@ -498,8 +497,8 @@ abstract class AbstractIndex {
                     // replace all readers with empty string reader
                     field = new Field(f.name(), new StringReader(""), tv);
                 } else if (f.stringValue() != null) {
-                    field = new Field(f.name(), f.stringValue(),
-                            stored, indexed, tv);
+                    field = new Field(f.name(), false, f.stringValue(), stored,
+                            indexed, tv);
                 } else if (f.isBinary()) {
                     field = new Field(f.name(), f.getBinaryValue(), stored);
                 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
Tue Apr  5 13:22:29 2011
@@ -159,7 +159,9 @@ public class IndexMigration {
                 for (Fieldable field : fields) {
                     String value = field.stringValue();
                     value = value.replace(oldSepChar, '[');
-                    doc.add(new Field(FieldNames.PROPERTIES, value, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
+                    doc.add(new Field(FieldNames.PROPERTIES, false, value,
+                            Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
+                            Field.TermVector.NO));
                 }
             }
             return doc;

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=1089030&r1=1089029&r2=1089030&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
Tue Apr  5 13:22:29 2011
@@ -16,6 +16,19 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import java.math.BigDecimal;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Executor;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
@@ -37,18 +50,6 @@ import org.apache.tika.parser.Parser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.NamespaceException;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.Executor;
-
 /**
  * Creates a lucene <code>Document</code> object from a {@link javax.jcr.Node}.
  */
@@ -217,8 +218,9 @@ public class NodeIndexer {
             // parent UUID
             if (node.getParentId() == null) {
                 // root node
-                doc.add(new Field(FieldNames.PARENT, "", Field.Store.YES,
-                        Field.Index.NOT_ANALYZED_NO_NORMS));
+                doc.add(new Field(FieldNames.PARENT, false, "",
+                        Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
+                        Field.TermVector.NO));
                 addNodeName(doc, "", "");
             } else if (node.getSharedSet().isEmpty()) {
                 addParentChildRelation(doc, node.getParentId());
@@ -228,8 +230,9 @@ public class NodeIndexer {
                     addParentChildRelation(doc, id);
                 }
                 // mark shareable nodes
-                doc.add(new Field(FieldNames.SHAREABLE_NODE, "",
-                        Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+                doc.add(new Field(FieldNames.SHAREABLE_NODE, false, "",
+                        Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
+                        Field.TermVector.NO));
             }
         } catch (NoSuchItemStateException e) {
             throwRepositoryException(e);
@@ -297,7 +300,8 @@ public class NodeIndexer {
     protected void addMVPName(Document doc, Name name) {
         try {
             String propName = resolver.getJCRName(name);
-            doc.add(new Field(FieldNames.MVP, propName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
Field.TermVector.NO));
+            doc.add(new Field(FieldNames.MVP, false, propName, Field.Store.NO,
+                    Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
         } catch (NamespaceException e) {
             // will never happen, prefixes are created dynamically
         }
@@ -415,7 +419,9 @@ public class NodeIndexer {
         } catch (NamespaceException e) {
             // will never happen
         }
-        doc.add(new Field(FieldNames.PROPERTIES_SET, fieldName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+        doc.add(new Field(FieldNames.PROPERTIES_SET, false, fieldName,
+                Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
+                Field.TermVector.NO));
     }
 
     /**
@@ -519,7 +525,7 @@ public class NodeIndexer {
             field.setOmitNorms(true);
             return field;
         } else {
-            return new Field(FieldNames.PROPERTIES,
+            return new Field(FieldNames.PROPERTIES, false,
                     FieldNames.createNamedValue(fieldName, internalValue),
                     Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
                     Field.TermVector.NO);
@@ -611,12 +617,13 @@ public class NodeIndexer {
         String uuid = internalValue.toString();
         doc.add(createFieldWithoutNorms(fieldName, uuid,
                 weak ? PropertyType.WEAKREFERENCE : PropertyType.REFERENCE));
-        doc.add(new Field(FieldNames.PROPERTIES,
-                FieldNames.createNamedValue(fieldName, uuid),
-                Field.Store.YES, Field.Index.NO, Field.TermVector.NO));
+        doc.add(new Field(FieldNames.PROPERTIES, false, FieldNames
+                .createNamedValue(fieldName, uuid), Field.Store.YES,
+                Field.Index.NO, Field.TermVector.NO));
         if (weak) {
-            doc.add(new Field(FieldNames.WEAK_REFS, uuid, Field.Store.NO,
-                    Field.Index.NOT_ANALYZED_NO_NORMS));
+            doc.add(new Field(FieldNames.WEAK_REFS, false, uuid,
+                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
+                    Field.TermVector.NO));
         }
     }
 
@@ -742,10 +749,8 @@ public class NodeIndexer {
             int idx = fieldName.indexOf(':');
             fieldName = fieldName.substring(0, idx + 1)
                     + FieldNames.FULLTEXT_PREFIX + fieldName.substring(idx + 1);
-            Field f = new Field(fieldName, stringValue,
-                    Field.Store.NO,
-                    Field.Index.ANALYZED,
-                    Field.TermVector.NO);
+            Field f = new Field(fieldName, true, stringValue, Field.Store.NO,
+                    Field.Index.ANALYZED, Field.TermVector.NO);
             f.setBoost(boost);
             doc.add(f);
 
@@ -816,10 +821,10 @@ public class NodeIndexer {
             // We would be able to store the field compressed or not depending
             // on a criterion but then we could not determine later is this field
             // has been compressed or not, so we choose to store it uncompressed
-            return new Field(FieldNames.FULLTEXT, value, Field.Store.YES,
+            return new Field(FieldNames.FULLTEXT, false, value, Field.Store.YES,
                     Field.Index.ANALYZED, tv);
         } else {
-            return new Field(FieldNames.FULLTEXT, value,
+            return new Field(FieldNames.FULLTEXT, false, value,
                     Field.Store.NO, Field.Index.ANALYZED, tv);
         }
     }
@@ -924,9 +929,9 @@ public class NodeIndexer {
                              InternalValue value) {
         long length = Util.getLength(value);
         if (length != -1) {
-            doc.add(new Field(FieldNames.PROPERTY_LENGTHS,
-                    FieldNames.createNamedLength(propertyName, length),
-                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+            doc.add(new Field(FieldNames.PROPERTY_LENGTHS, false, FieldNames
+                    .createNamedLength(propertyName, length), Field.Store.NO,
+                    Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
         }
     }
 
@@ -942,11 +947,16 @@ public class NodeIndexer {
                                String namespaceURI,
                                String localName) throws NamespaceException {
         String name = mappings.getPrefix(namespaceURI) + ":" + localName;
-        doc.add(new Field(FieldNames.LABEL, name, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+        doc.add(new Field(FieldNames.LABEL, false, name, Field.Store.NO,
+                Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
         // as of version 3, also index combination of namespace URI and local name
         if (indexFormatVersion.getVersion() >= IndexFormatVersion.V3.getVersion()) {
-            doc.add(new Field(FieldNames.NAMESPACE_URI, namespaceURI, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
-            doc.add(new Field(FieldNames.LOCAL_NAME, localName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+            doc.add(new Field(FieldNames.NAMESPACE_URI, false, namespaceURI,
+                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
+                    Field.TermVector.NO));
+            doc.add(new Field(FieldNames.LOCAL_NAME, false, localName,
+                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS,
+                    Field.TermVector.NO));
         }
     }
 
@@ -962,9 +972,9 @@ public class NodeIndexer {
     protected void addParentChildRelation(Document doc,
                                           NodeId parentId)
             throws ItemStateException, RepositoryException {
-        doc.add(new Field(
-                FieldNames.PARENT, parentId.toString(),
-                Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
+        doc.add(new Field(FieldNames.PARENT, false, parentId.toString(),
+                Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
+                Field.TermVector.NO));
         NodeState parent = (NodeState) stateProvider.getItemState(parentId);
         ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId());
         if (child == null) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Tue Apr  5 13:22:29 2011
@@ -1415,7 +1415,12 @@ public class SearchIndex extends Abstrac
                                 for (Fieldable fulltextField : fulltextFields) {
                                     doc.add(fulltextField);
                                 }
-                                doc.add(new Field(FieldNames.AGGREGATED_NODE_UUID, aggregate.getNodeId().toString(),
Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+                                doc.add(new Field(
+                                        FieldNames.AGGREGATED_NODE_UUID, false,
+                                        aggregate.getNodeId().toString(),
+                                        Field.Store.NO,
+                                        Field.Index.NOT_ANALYZED_NO_NORMS,
+                                        Field.TermVector.NO));
                             }
                         }
                         // make sure that fulltext fields are aligned properly
@@ -1463,8 +1468,13 @@ public class SearchIndex extends Abstrac
                                         termAttribute.setTermBuffer(value);
                                         doc.add(new Field(field.name(),
                                                 new SingletonTokenStream(value, (Payload)
payloadAttribute.getPayload().clone())));
-                                        doc.add(new Field(FieldNames.AGGREGATED_NODE_UUID,
-                                                parent.getNodeId().toString(), Field.Store.NO,
Field.Index.NOT_ANALYZED_NO_NORMS));
+                                        doc.add(new Field(
+                                                FieldNames.AGGREGATED_NODE_UUID,
+                                                false,
+                                                parent.getNodeId().toString(),
+                                                Field.Store.NO,
+                                                Field.Index.NOT_ANALYZED_NO_NORMS,
+                                                Field.TermVector.NO));
                                     }
                                 }
                             } finally {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
Tue Apr  5 13:22:29 2011
@@ -56,23 +56,25 @@ import org.apache.jackrabbit.util.ISO860
  * The following table specifies the internal format for every property type:
  * <pre>
  * <table>
- * <tr><b>PropertyType</b><td></td><td><b>Internal
Format</b></td></tr>
- * <tr>STRING<td></td><td>String</td></tr>
- * <tr>LONG<td></td><td>Long</td></tr>
- * <tr>DOUBLE<td></td><td>Double</td></tr>
- * <tr>DATE<td></td><td>Calendar</td></tr>
- * <tr>BOOLEAN<td></td><td>Boolean</td></tr>
- * <tr>NAME<td></td><td>Name</td></tr>
- * <tr>PATH<td></td><td>Path</td></tr>
- * <tr>URI<td></td><td>URI</td></tr>
- * <tr>DECIMAL<td></td><td>BigDecimal</td></tr>
- * <tr>BINARY<td></td><td>BLOBFileValue</td></tr>
- * <tr>REFERENCE<td></td><td>{@link NodeId}</td></tr>
+ * <tr><td><b>PropertyType</b></td><td><b>Internal
Format</b></td></tr>
+ * <tr><td>STRING</td><td>String</td></tr>
+ * <tr><td>LONG</td><td>Long</td></tr>
+ * <tr><td>DOUBLE</td><td>Double</td></tr>
+ * <tr><td>DATE</td><td>Calendar</td></tr>
+ * <tr><td>BOOLEAN</td><td>Boolean</td></tr>
+ * <tr><td>NAME</td><td>Name</td></tr>
+ * <tr><td>PATH</td><td>Path</td></tr>
+ * <tr><td>URI</td><td>URI</td></tr>
+ * <tr><td>DECIMAL</td><td>BigDecimal</td></tr>
+ * <tr><td>BINARY</td><td>BLOBFileValue</td></tr>
+ * <tr><td>REFERENCE</td><td>{@link NodeId}</td></tr>
  * </table>
  * </pre>
  */
 public class InternalValue extends AbstractQValue {
 
+    private static final long serialVersionUID = -7340744360527434409L;
+
     public static final InternalValue[] EMPTY_ARRAY = new InternalValue[0];
 
     private static final InternalValue BOOLEAN_TRUE = new InternalValue(true);

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
Tue Apr  5 13:22:29 2011
@@ -65,8 +65,8 @@ public class ChainedTermEnumTest extends
                 true, IndexWriter.MaxFieldLength.UNLIMITED);
         for (int i = 0; i < numTerms; i++) {
             Document doc = new Document();
-            doc.add(new Field("field", prefix + i,
-                    Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+            doc.add(new Field("field", true, prefix + i, Field.Store.NO,
+                    Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
             writer.addDocument(doc);
         }
         writer.close();

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IDFieldTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IDFieldTest.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IDFieldTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IDFieldTest.java
Tue Apr  5 13:22:29 2011
@@ -16,10 +16,11 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import junit.framework.TestCase;
+
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.lucene.document.Field;
-
-import junit.framework.TestCase;
+import org.apache.lucene.document.Field.TermVector;
 
 /**
  * <code>IDFieldTest</code>...
@@ -35,12 +36,27 @@ public class IDFieldTest extends TestCas
         time = System.currentTimeMillis() - time;
         System.out.println("IDField: " + time + " ms.");
 
-        time = System.currentTimeMillis();
+        for (int i = 0; i < 50; i++) {
+            createNodes(id.toString(), i % 2 == 0);
+        }
+    }
+
+    private void createNodes(String id, boolean useNewWay) {
+
+        long time = System.currentTimeMillis();
         for (int i = 0; i < 1000 * 1000; i++) {
-            new Field(FieldNames.UUID, id.toString(), Field.Store.YES,
-                    Field.Index.NOT_ANALYZED_NO_NORMS);
+            if (useNewWay) {
+                new Field(FieldNames.UUID, false, id, Field.Store.YES,
+                        Field.Index.NOT_ANALYZED_NO_NORMS, TermVector.NO);
+            } else {
+                new Field(FieldNames.UUID, id, Field.Store.YES,
+                        Field.Index.NOT_ANALYZED_NO_NORMS, TermVector.NO);
+            }
+
         }
         time = System.currentTimeMillis() - time;
-        System.out.println("Field: " + time + " ms.");
+        System.out.println(String.format("Field: %2s ms. new way? %b", time,
+                useNewWay));
+
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java?rev=1089030&r1=1089029&r2=1089030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
Tue Apr  5 13:22:29 2011
@@ -66,9 +66,14 @@ public class IndexMigrationTest extends 
 
     protected static Document createDocument(String name, String value) {
         Document doc = new Document();
-        doc.add(new Field(FieldNames.UUID, UUID.randomUUID().toString(), Field.Store.YES,
Field.Index.NO));
-        doc.add(new Field(FieldNames.PROPERTIES, createNamedValue14(name, value), Field.Store.NO,
Field.Index.NOT_ANALYZED));
-        doc.add(new Field(FieldNames.FULLTEXT_PREFIX + ":" + name, value, Field.Store.NO,
Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
+        doc.add(new Field(FieldNames.UUID, false, UUID.randomUUID().toString(),
+                Field.Store.YES, Field.Index.NO, Field.TermVector.NO));
+        doc.add(new Field(FieldNames.PROPERTIES, false, createNamedValue14(
+                name, value), Field.Store.NO, Field.Index.NOT_ANALYZED,
+                Field.TermVector.NO));
+        doc.add(new Field(FieldNames.FULLTEXT_PREFIX + ":" + name, true, value,
+                Field.Store.NO, Field.Index.ANALYZED,
+                Field.TermVector.WITH_POSITIONS_OFFSETS));
         return doc;
     }
 }



Mime
View raw message