Hello,
I need to have a custom javascript for which I need to serach some document name from csv. if the name exist returns true else false.
I can loop thorugh the csv but facing issue where I need to serach the doucment by name. I am trying to use lucene search. Below is the part which I am trying.
/////////////////////////
var found= "testAlfrescoDoc.pdf";
var nodes = search.luceneSearch("@name:found");
logger.log("nodes =" + nodes);
////////////////////////////////
But the above is returning blank. Any help in this would be really appreciated.
Solved! Go to Solution.
This '@name:found" will be simply considered as string. You need to append the variable value.
Try, see if it works :
var found= "testAlfrescoDoc.pdf"; var nodes = search.luceneSearch("@name:"+found); logger.log("nodes =" + nodes);
This '@name:found" will be simply considered as string. You need to append the variable value.
Try, see if it works :
var found= "testAlfrescoDoc.pdf"; var nodes = search.luceneSearch("@name:"+found); logger.log("nodes =" + nodes);
In an additional suggestion I recommend to stop using lucenseSearch and switch to the query function in the search root object, using the query language fts-alfresco. lucene is a legacy query language still technically available in Alfresco, but no longer receiving any enhancements / improvements since around version 4.2 - only CMIS and FTS are the officially supported / recommended query languages.
Thanks for pointing this out
It has worked now.
Hi @afaust ,
We are still using Alfresco 4.2. So was using this lucene serach.
Soon we would be moving to 5.2.x . Thanks for your suggestion . Is there any knowledge hub where I can find few examples of query-language fts-alfresco. This would help us in future when our migration to latest Alfresco would complete.
Regards,
Soumya
Even in 4.2 lucene is already legacy and has not received some of the improvements added to 4.2 with regards to search. E.g. lucene search is not able to use transactional metadata queries which were introduced in 4.2
FTS is well documented in the official Alfresco documentation and most tutorials I have seen in the last couple of years.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.