Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.6.21
-
None
-
None
Description
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:
SELECT [rep:facet(tmp:tags)] FROM [tmp:document] AS d WHERE (isdescendantnode([d], [/docsFolder]))
- 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