Thomas Mueller created OAK-3589:
-----------------------------------
Summary: Property index with declaringNodeTypes sometimes used by
mistake
Key: OAK-3589
URL: https://issues.apache.org/jira/browse/OAK-3589
Project: Jackrabbit Oak
Issue Type: Bug
Components: query
Reporter: Thomas Mueller
Assignee: Thomas Mueller
A property index with declaringNodeTypes is sometimes used where it must not be
used. Example:
{noformat}
/oak:index/testIndex (oak:QueryIndexDefinition)
declaringNodeTypes = ['oak:QueryIndexDefinition'] (Name)
propertyNames = ['testProp'] (Name)
type = 'property'
x (nt:unstructured)
testProp = '1234'
query:
/jcr:root//element(*, oak:QueryIndexDefinition)[./x/@testProp="1234"]
{noformat}
(please note there should be more nodes, so that index is used for the query
and not traversal).
The problem is that the index is used, even thought the property is not in the
node itself (of type oak:QueryIndexDefinition), but in a child node (with a
different node type).
The the index is used, and the result is empty. If the index is disabled, then
traversal is used (or another index), and the correct result is returned.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)