2
votes

I want to fine All content with specific aspect and property value in alfresco. I am trying to traverse All contents in alfresco repository. But Its taking to much time because there are huge number of contents in repository.

So I am thinking to use Crawler, but using crawler I am only able to traverse content with specific content type.

So can we use it for specific Aspect with specific property value?

Or is there any other faster way to do this?

Please help..

Thanks in Advance...

1
What's wrong with doing a quick search using the Alfresco built-in search service? Should give you an answer in under a second!Gagravarr

1 Answers

1
votes

The problem with searching with Lucene/FTS/etc is the fact that permission checking exists. There is a workaround obviously, meaning, you could do a series or smaller queries - in stead of a single large one - but I always found this cumbersome.

My favorite way to get around this is to query the database itself, get the ids/nodeRefs out to a separate table or something like that - then do whatever I need to do with that as a starting point.

For example:

select count(*) from alf_node join alf_node_aspects
on alf_node.id = alf_node_aspects.node_id
join alf_qname
on alf_node_aspects.qname_id = alf_qname.id
where alf_qname.local_name = 'yourAspectName' and
alf_node.store_id = 6;