You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2016/11/09 09:39:58 UTC

[jira] [Commented] (JCR-4055) Have AuthorizableQueryManager Support Named search with ignorecase

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

angela commented on JCR-4055:
-----------------------------

[~krachit13@gmail.com], thanks for your report. just a quick initial question back: what happened to the attached patch you were referring to in the initial description?

please note, that I adjusted the components by adding {{jackrabbit-api}}. any changes there would also require extra implementation work and testing in jackrabbit oak.

>  Have AuthorizableQueryManager Support Named search with ignorecase
> -------------------------------------------------------------------
>
>                 Key: JCR-4055
>                 URL: https://issues.apache.org/jira/browse/JCR-4055
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-jcr-commons
>    Affects Versions: 2.8
>            Reporter: Rachit Kumar
>            Assignee: angela
>
> Usecase :
> We need to make search on Name and AuthorizableId while searching for users. Hence we used the 'named'[0] token while creating the json. But we realized that 'named' token doesn't support the ignore case feature due to which our search is failing. Can you please include an option to enable/disable the ignore case functionality.
> I have found a similar jira[1] reported earlier for the sort option.
> Sample Query :
> select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and contains([rep:principalName], 'rohan.raj@sandisk.com*')
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and contains([cq:first-name], 'rohan.raj@sandisk.com*')
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and contains([cq:last-name], 'rohan.raj@sandisk.com*')
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and contains([profile/givenName], 'rohan.raj@sandisk.com*')
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and contains([profile/familyName], 'rohan.raj@sandisk.com*')
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and [rep:authorizableId] like 'rohan.raj@sandisk.com'
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and [rep:principalName] like 'rohan.raj@sandisk.com'
> union select [jcr:path], [jcr:score], * from [rep:Authorizable] as a where isdescendantnode(a, '/home') and name(a) like 'rohan.raj@sandisk.com'
> order by lower([rep:principalName]
> The name(a) like 'rohan.raj@sandisk.com' doesn't honor the ignorecase.
> Sample Calling :
> public Iterator<Authorizable> execute(final String query) throws RepositoryException, IOException {
>   try {
>     return userManager.findAuthorizables(new Query(){
>       public <T>void build(      QueryBuilder<T> builder){
>         try {
>           builder.setLimit(0,MAX_RESULT_COUNT);
>           new QueryTranslator<T>(builder).translate(query);
>         }
>  catch (        IOException e) {
>           throw new IllegalArgumentException(e);
>         }
>       }
>     }
> );
>   }
>  catch (  IllegalArgumentException e) {
>     Throwable cause=e.getCause();
>     if (cause instanceof IOException) {
>       throw (IOException)cause;
>     }
>  else {
>       throw e;
>     }
>   }
> }
> [0] https://docs.adobe.com/content/docs/en/aem/6-0/develop/ref/javadoc/org/apache/jackrabbit/api/security/user/QueryBuilder.html#nameMatches(java.lang.String)
> [1] https://issues.apache.org/jira/browse/JCR-3845



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)