You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Masanobu Horiyama (JIRA)" <ji...@apache.org> on 2007/08/01 00:09:53 UTC
[jira] Created: (JCR-1045) jcr:contains does not return substrings
with apostrophes
jcr:contains does not return substrings with apostrophes
--------------------------------------------------------
Key: JCR-1045
URL: https://issues.apache.org/jira/browse/JCR-1045
Project: Jackrabbit
Issue Type: Bug
Components: query
Reporter: Masanobu Horiyama
I am able to query for a node which has a property that contains the string "Jackrabbit's" with the following:
//*[jcr:contains(@title,'Jackrabbit\''s')]";
However, a substring search does not return any results:
//*[jcr:contains(@title,'*Jackrabbit\''s*')]
Please advise.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JCR-1045) jcr:contains does not return substrings
with apostrophes
Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marcel Reutegger resolved JCR-1045.
-----------------------------------
Resolution: Invalid
If you are looking for an exact substring then you should rather use the jcr:like function:
//*[jcr:like(@title,'%Jackrabbit''s%')]
please also note that you do not necessarily have to escape the single quote in the string literal.
The query:
//*[jcr:contains(@title,'*Jackrabbit\''s*')]
does not return results because the analyzer in jackrabbit does some basic stemming on the text content. That is, the text "Jackrabbit's" is fulltext indexed as a single term "jackrabbit" the 's is cut off. While this works fine with the first example you provided it does not when you use wild cards in a jcr:contains function. In that case the query term is only lower-cased but does not run through the analyzer. Hence, the 's is not cut off in that case and the term will not match the indexed text.
> jcr:contains does not return substrings with apostrophes
> --------------------------------------------------------
>
> Key: JCR-1045
> URL: https://issues.apache.org/jira/browse/JCR-1045
> Project: Jackrabbit
> Issue Type: Bug
> Components: query
> Reporter: Masanobu Horiyama
>
> I am able to query for a node which has a property that contains the string "Jackrabbit's" with the following:
> //*[jcr:contains(@title,'Jackrabbit\''s')]";
> However, a substring search does not return any results:
> //*[jcr:contains(@title,'*Jackrabbit\''s*')]
> Please advise.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.