cancel
Showing results for 
Search instead for 
Did you mean: 

get nodeRefs from tag name

kpatel
Confirmed Champ
Confirmed Champ

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 ACCEPTED ANSWER

jayesh_prajapat
Star Contributor
Star Contributor

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 answer in original post

5 REPLIES 5

mehe
Elite Collaborator
Elite Collaborator

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
Star Contributor
Star Contributor

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

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.

Hi KPatel _

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

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.