Fetching documents with some specified metadata value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2012 04:10 AM
Hi Alfresco-techies,
i am new to Alfresco. Hence my query may seem to be very basic.
My requirement is to fetch all the documents in a specific alfresco space ( and subspaces) whose metadata value satisfies certain desired value. ex. if document has documnetCreatedFor metadata/attribute and we want to retrieve the documents with documnetCreatedFor value as "Reference-Doc".
Can you let me know the process and query details ?
i am new to Alfresco. Hence my query may seem to be very basic.
My requirement is to fetch all the documents in a specific alfresco space ( and subspaces) whose metadata value satisfies certain desired value. ex. if document has documnetCreatedFor metadata/attribute and we want to retrieve the documents with documnetCreatedFor value as "Reference-Doc".
Can you let me know the process and query details ?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2012 01:22 PM
This is an example of a lucene query that achieves what you want starting in space "company home", this one is written for the javascripting environment:
You have to replace the short namespace with your dito (the "my").
The "//*" in the end of the Path expression instructs lucene to also look in subspaces. You should probably include a +ASPECT or +TYPE as well to reduce the search base.
Regards
/Erik
var nodes = search.luceneSearch("+PATH:\"/app:company_home//*\" +@my\\:documentCreatedFor:\"Reference-Doc\"");for each(var node in nodes) { logger.log(node.name + " (" + node.typeShort + "): ");}
You have to replace the short namespace with your dito (the "my").
The "//*" in the end of the Path expression instructs lucene to also look in subspaces. You should probably include a +ASPECT or +TYPE as well to reduce the search base.
Regards
/Erik
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 08:15 AM
Thanks Erik.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2013 07:24 AM
Hi Techies,
I want to add some custom metadata to epub files in Stored in Alfresco and want to fetch it using APIS, could any body suggest me a way to it,
I want to add some custom metadata to epub files in Stored in Alfresco and want to fetch it using APIS, could any body suggest me a way to it,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2013 09:38 AM
You can use cmis api.
![](/skins/images/C4B9070548353DBFB29577F0FA7263C6/responsive_peak/images/icon_anonymous_message.png)