Find users with Lucene query using QName
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2011 09:49 AM
Hi all,
I'm trying to get the list of all users belonging to a certain group using a Lucene query.
Placing it into Alfresco Node Browser as:
I correctly obtain all the users for that group.
But when trying to use it into the Alfresco debugger as:
I get this error:
Thanks a lot!!!
I'm trying to get the list of all users belonging to a certain group using a Lucene query.
Placing it into Alfresco Node Browser as:
TYPE:"cm:person" AND @cm\:userName:"*" AND QNAME:"sys:system/sys:authorities/cm:GROUP_USR_0000011046/*"
I correctly obtain all the users for that group.
But when trying to use it into the Alfresco debugger as:
search.luceneSearch("workspace://SpacesStore","TYPE:\"cm:person\" AND @cm\\:userName:\"*\" AND QNAME:\"sys:system/sys:authorities/cm:GROUP_USR_0000011046/*\"","@cm:userName",true)%
I get this error:
- Wrapped org.alfresco.error.AlfrescoRuntimeException: 07230052 Failed to execute search: TYPE:"cm

Thanks a lot!!!
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2011 05:15 AM
Hi
I am not sure why you have your issue:
But the clause
@cm\:userName:"*" has no point as the property is mandatory for the type.
and you are abusing QNAME.
It happens to be implemented as PATH:"//<QNAME>" - you would be better using PATH as you are not just using a qname - then you cna avoid the "//" at the start.
Andy
I am not sure why you have your issue:
But the clause
@cm\:userName:"*" has no point as the property is mandatory for the type.
and you are abusing QNAME.
It happens to be implemented as PATH:"//<QNAME>" - you would be better using PATH as you are not just using a qname - then you cna avoid the "//" at the start.
Andy

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2011 05:17 AM
Hi
Are you using the same query language?
What is the full exception?
Andy
Are you using the same query language?
What is the full exception?
Andy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2011 09:13 AM
Hi,
the strange thing is that trying with both QName and Path it works on the node browser.
But it doesn't with alfresco debugger.
Moreover the message I provided is the only message I obtain from alfresco debugger.
What am I doing wrong?
Which is the correct way to write the lucene query?
Thanks.
the strange thing is that trying with both QName and Path it works on the node browser.
But it doesn't with alfresco debugger.
Moreover the message I provided is the only message I obtain from alfresco debugger.
What am I doing wrong?
Which is the correct way to write the lucene query?
Thanks.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2011 11:10 AM
Hi,
I'm sorry I have no idea what's wrong with the syntax so I may not be useful at all but…
Is there a good reason why you're not using:
instead of a lucene query?
I'm sorry I have no idea what's wrong with the syntax so I may not be useful at all but…
Is there a good reason why you're not using:
people.getMembers(people.getGroup("GROUP_USR_0000011046"));
instead of a lucene query?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2011 10:47 AM
Thank you for your reply.
The main reason I would like to use a Lucene query is to have a "one-shot" response.
Moreover this approach would be more flexible, especially when comes out the need of changing the query criteria.
I can't yet figure out why the search works well with the Alfresco node browser but not in debugger/code….
The main reason I would like to use a Lucene query is to have a "one-shot" response.
Moreover this approach would be more flexible, especially when comes out the need of changing the query criteria.
I can't yet figure out why the search works well with the Alfresco node browser but not in debugger/code….
