Jackrabbit 2.0.0
I'm AND'ing a FullTextSearch constraint with a DescendantNode
constraint. If I use the root node as the path to the descendent node
constraint, i.e. if I use "/", then it works. However, if I specify
the path to one of my own application defined nodes in the repository,
the return set is empty. Note, I have even used the path to retrieve
the node, with session.getNode(), to verify that my path was correct.
I even used that node's .getPath() to provide the value to the
constraint factory, still nothing.
Here's my code. Can anyone spot an error? Or explain the behavour to
me. I kind of think it's a bug . . .
//prepare the full text search constraint
ValueFactory valueFactory = session.getValueFactory();
Value target = valueFactory.createValue(queryString);
Literal queryStringLiteral = qomFactory.literal(target);
Constraint fullTextSearchConstraint =
qomFactory.fullTextSearch("mySelector", null, queryStringLiteral );
//prepare the root folder constraint
Constraint rootFolderConstraint =
qomFactory.descendantNode("mySelector", "/group one/documents/my
folder" );
//AND the two constraints
And textQueryAndRootFolderConstraints = qomFactory.and(
fullTextSearchConstraint, rootFolderConstraint );
//build query and execute
QueryObjectModel queryObjectModel = qomFactory.createQuery(
allDocsSelector, textQueryAndRootFolderConstraints, null, null);
QueryResult results = queryObjectModel.execute();