jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1299597 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
Date Mon, 12 Mar 2012 09:46:29 GMT
Author: alexparvulescu
Date: Mon Mar 12 09:46:29 2012
New Revision: 1299597

URL: http://svn.apache.org/viewvc?rev=1299597&view=rev
Log:
JCR-3253 Set omit term freq positions flag on parent field in the index

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java

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=1299597&r1=1299596&r2=1299597&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 Mar 12 09:46:29 2012
@@ -217,9 +217,11 @@ public class NodeIndexer {
             // parent UUID
             if (node.getParentId() == null) {
                 // root node
-                doc.add(new Field(FieldNames.PARENT, false, "",
+                Field parent = new Field(FieldNames.PARENT, false, "",
                         Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
-                        Field.TermVector.NO));
+                        Field.TermVector.NO);
+                parent.setOmitTermFreqAndPositions(true);
+                doc.add(parent);
                 addNodeName(doc, "", "");
             } else if (node.getSharedSet().isEmpty()) {
                 addParentChildRelation(doc, node.getParentId());
@@ -955,9 +957,11 @@ public class NodeIndexer {
     protected void addParentChildRelation(Document doc,
                                           NodeId parentId)
             throws ItemStateException, RepositoryException {
-        doc.add(new Field(FieldNames.PARENT, false, parentId.toString(),
-                Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS,
-                Field.TermVector.NO));
+        Field parentField = new Field(FieldNames.PARENT, false,
+                parentId.toString(), Field.Store.YES,
+                Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO);
+        parentField.setOmitTermFreqAndPositions(true);
+        doc.add(parentField);
         NodeState parent = (NodeState) stateProvider.getItemState(parentId);
         ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId());
         if (child == null) {



Mime
View raw message