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 "Davide Giannella (JIRA)" <ji...@apache.org> on 2016/06/10 10:35:22 UTC
[jira] [Closed] (OAK-4170) QueryEngine adding invalid property
restriction for fulltext query
[ https://issues.apache.org/jira/browse/OAK-4170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davide Giannella closed OAK-4170.
---------------------------------
Bulk close for 1.5.3
> 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.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)