[
https://issues.apache.org/jira/browse/OAK-4170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Reschke updated OAK-4170:
--------------------------------
Fix Version/s: 1.6
> QueryEngine adding invalid property restriction for fulltext query
> ------------------------------------------------------------------
>
> Key: OAK-4170
> URL: https://issues.apache.org/jira/browse/OAK-4170
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: query
> Reporter: Chetan Mehrotra
> Assignee: Thomas Mueller
> Priority: Minor
> Fix For: 1.6, 1.5.3
>
> Attachments: OAK-4170-v1.patch
>
>
> QueryEngine inserts a property restriction of "is not null" for any property
> used in fulltext constraint. For e.g. for query
> {noformat}
> select * from [nt:unstructured] where
> CONTAINS([jcr:content/metadata/comment], 'december')
> {noformat}
> A property restriction would be added for {{jcr:content/metadata/comment}}.
> However currently due to bug in {{FulltextSearchImpl}} [1] the property name
> generated is {{comment/jcr:content/metadata}}.
> {code}
> @Override
> public void restrict(FilterImpl f) {
> if (propertyName != null) {
> if (f.getSelector().equals(selector)) {
> String p = propertyName;
> if (relativePath != null) {
> p = PathUtils.concat(p, relativePath);
> }
> p = normalizePropertyName(p);
> restrictPropertyOnFilter(p, f);
> }
> }
>
> f.restrictFulltextCondition(fullTextSearchExpression.currentValue().getValue(Type.STRING));
> }
> {code}
> This happens because {{relativePath}} is passed as second param to
> {{PathUtils.concat}}. It should be first param
> [1]
> https://github.com/apache/jackrabbit-oak/blob/1.4/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java#L275-L286
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)