get nodeRefs from tag name

cancel
Showing results for 
Search instead for 
Did you mean: 
kpatel
Active Member

get nodeRefs from tag name

Jump to solution

Hi,

Greetings of the day!

currently, I am using alfresco 5.0d.

I want a list of noderef from tag name within a particular folder.

So for that, I am using tagging service.

TaggingService().findTaggedNodes(node.getStoreRef(), ISO9075.encode(tag), node);

its working fine, but its working on Lucene query. So every time I am not get updated data.

I am decreasing cron time to 2 seconds

alfresco.cron=0/2 * * * * ? *

But still i am not getting updated response.
So is there other way to get this updated response.
Thanks in advance.

1 Solution

Accepted Solutions
jayesh_prajapat
Established Member

Re: get nodeRefs from tag name

Jump to solution

Adding to previous reply,
Solr indexing works independent based on cron expression you configure. You will only receive data in query response after it get indexed. it means real time search using solr query is not possible.

Alfresco provide multiple way to perform search. CMIS does search in DB hence it can be used to search transaction data too (here are configuration steps). You need to be mindful using right predicate. If you use right predicate in where, it will perform search in DB otherwise it will take support of indexes. Refer https://docs.alfresco.com/community5.0/concepts/intrans-metadata-query.html

View solution in original post

5 Replies
mehe
Senior Member II

Re: get nodeRefs from tag name

Jump to solution

I think that you would have to live with the eventual consistency when using solr based queries. Maybe the transactional metadata queries can help in this case - but you‘d have to reconfigure Alfresco (db Indexes) for this...

Transactional metadata query | Alfresco Documentation 

jayesh_prajapat
Established Member

Re: get nodeRefs from tag name

Jump to solution

Adding to previous reply,
Solr indexing works independent based on cron expression you configure. You will only receive data in query response after it get indexed. it means real time search using solr query is not possible.

Alfresco provide multiple way to perform search. CMIS does search in DB hence it can be used to search transaction data too (here are configuration steps). You need to be mindful using right predicate. If you use right predicate in where, it will perform search in DB otherwise it will take support of indexes. Refer https://docs.alfresco.com/community5.0/concepts/intrans-metadata-query.html

kpatel
Active Member

Re: get nodeRefs from tag name

Jump to solution

hi Jayesh Prajapati

Thank you so much for your valuable reply.

can I use this query for getting test folder noderef in CMIS?

select *
from cmis:document
where contains('PATH:"/app:company_home/st:sites/cm:abc/cm:documentLibrary/cm:ffb203a9a92f469c97c1e461549cb932/cm:audit/cm:_x0030_0002016/cm:_x0032_5dbfe00f48b436f82fcadb1de76935b/cm:Test"')

searchService()
.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_CMIS_ALFRESCO, querty);

this query gives me data from a direct database?

Please suggest me.

Thanks in Advance.

jayesh_prajapat
Established Member

Re: get nodeRefs from tag name

Jump to solution

Hi KPatel _

If I am not wrong, contains predicate will not search on DB. It will take help of index. 

jayesh_prajapat
Established Member

Re: get nodeRefs from tag name

Jump to solution

Hi KPatel _


Hope you try following too,

NodeRef companyHome = getCompanyHome();
String path = "company_home/sites/abc/documentLibrary/ffb203a9a92f469c97c1e461549cb932/audit/_x0030_0002016/_x0032_5dbfe00f48b436f82fcadb1de76935b/Test";
List<String> pathElements = Arrays.asList(StringUtils.split(path, '/'));
NodeRef templateRef = fileFolderService.resolveNamePath(companyHome, pathElements).getNodeRef();


I'm not to sure about path you mentioned but I've used it in one of my project to resolved folder path.