Dawid Iwo Cokan created OAK-9606: ------------------------------------ Summary: NodeType index is not ignored for facets Key: OAK-9606 URL: https://issues.apache.org/jira/browse/OAK-9606 Project: Jackrabbit Oak Issue Type: Bug Components: search Affects Versions: 1.6.21 Reporter: Dawid Iwo Cokan
*Conditions:* Created 300 nodes of new _tmp:document_ type Added Lucene index for above Configured facets for one of property (_tmp:tag)_ for that node type *Steps:* * Prepare query to run: {code:java} SELECT [rep:facet(tmp:tags)] FROM [tmp:document] AS d WHERE (isdescendantnode([d], [/docsFolder])) {code} * Don't set limit on query *Expected:* Since there is index configured for that node the query engine should pick that index and should provide correct results *Current:* NodeType index is selected as least cost insetead and empty results is provided *Note:* * If limit is set on query then Lucene index is beating the other indexes and it works correctly * If _contains('*', d)_ is added to query, nodeType is ignored and lucene index is picked * If there will be too many documents present then Lucene index wins. This is because lucene index canot give higher cost than 1001 while nodeType is growing along with number of documents *Possible fix:* IMO the nodeType should be discarded whenever the query is having facets condition - as far as I could see the full text search condition is being checked Additionaly I am not sure why Query Engine takes care about limit for facets query. As per my understanding the limit has nothing do to in this case -- This message was sent by Atlassian Jira (v8.3.4#803005)