Author: nzamosenchuk
Date: 2009-12-22 11:01:28 -0500 (Tue, 22 Dec 2009)
New Revision: 1146
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
Log:
EXOJCR-325: merge with JBC branch. THIS COMMIT RESTORES FIXED VERSION OF
LUCENEQUERYBUILDER, WHICH WAS REWRITTEN BY OLDER VERSION FROM JBC BRANCH.
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2009-12-22
15:42:52 UTC (rev 1145)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2009-12-22
16:01:28 UTC (rev 1146)
@@ -775,18 +775,27 @@
}, null);
QPath relPath = node.getRelativePath();
+
+ InternalQName propName;
+
if (node.getOperation() == QueryConstants.OPERATION_SIMILAR)
{
// this is a bit ugly:
// add the name of a dummy property because relPath actually
// references a property. whereas the relPath of the similar
// operation references a node
- relPath = QPath.makeChildPath(relPath, Constants.JCR_PRIMARYTYPE);
+ //relPath = QPath.makeChildPath(relPath, Constants.JCR_PRIMARYTYPE);
+ propName = Constants.JCR_PRIMARYTYPE;
}
+ else
+ {
+ propName = relPath.getName();
+ }
+
String field = "";
try
{
- field = resolver.createJCRName(relPath.getName()).getAsString();
+ field = resolver.createJCRName(propName).getAsString();
}
catch (NamespaceException e)
{
@@ -795,7 +804,7 @@
}
// support for fn:name()
- InternalQName propName = relPath.getName();
+ //InternalQName propName = relPath.getName();
if (propName.getNamespace().equals(NS_FN_URI) &&
propName.getName().equals("name()"))
{
if (node.getValueType() != QueryConstants.TYPE_STRING)
@@ -1053,7 +1062,7 @@
}
}
- if (relPath.getEntries().length > 1)
+ if (relPath != null && relPath.getEntries().length > 1)
{
// child axis in relation
QPathEntry[] elements = relPath.getEntries();
Show replies by date