You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Vikas Saurabh (JIRA)" <ji...@apache.org> on 2017/03/07 12:48:38 UTC

[jira] [Commented] (OAK-5858) Lucene index may return the wrong result if path is excluded

    [ https://issues.apache.org/jira/browse/OAK-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15899375#comment-15899375 ] 

Vikas Saurabh commented on OAK-5858:
------------------------------------

Some points/comments following an offline conversation with [~tmueller]:
* The middle path mentioned above can still give incorrect results
* The common use-case to have excluded paths is to avoid some paths that are known to be bad - too much traffic without any usable results
** That case usually shouldn't guide the code that queries - it seems to me that this should remain a configuration option like the indices itself, OR
** May be we need to expose a utility syntax for code to declare the intent "I'm ok if you exclude some paths"
* Maybe, we should have separate exludePath flags for asserting exluded-and-exposed (code needs to be aware) and covert-exclude(just doesn't index, behaves as if it can answer everything)

> Lucene index may return the wrong result if path is excluded
> ------------------------------------------------------------
>
>                 Key: OAK-5858
>                 URL: https://issues.apache.org/jira/browse/OAK-5858
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Thomas Mueller
>             Fix For: 1.8
>
>
> If a query uses a Lucene index that has "excludedPaths", the query result may be wrong (not contain all matching nodes). This is case even if there is a property index available for the queried property. Example:
> {noformat}
> Indexes:
> /oak:index/resourceType/type = "property"
> /oak:index/lucene/type = "lucene"
> /oak:index/lucene/excludedPaths = ["/etc"]
> /oak:index/lucene/indexRules/nt:base/properties/resourceType
> Query:
> /jcr:root/etc//*[jcr:like(@resourceType, "x%y")]
> Index cost:
> cost for /oak:index/resourceType is 1602.0
> cost for /oak:index/lucene is 1001.0
> Result:
> (empty)
> Expected result:
> /etc/a
> /etc/b
> {noformat}
> Here, the lucene index is picked, even thought the query explicitly queries for /etc, and the lucene index has this path excluded.
> I think the lucene index should not be picked in case the index does not match the query path.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)