You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Dominique Jäggi (JIRA)" <ji...@apache.org> on 2019/05/21 10:47:00 UTC

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

     [ https://issues.apache.org/jira/browse/JCR-4055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominique Jäggi reassigned JCR-4055:
------------------------------------

    Assignee:     (was: Dominique Jäggi)

>  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
>            Priority: Major
>
> 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
(v7.6.3#76005)