10-03-2020 07:47 AM
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.
10-03-2020 04:18 PM
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);
10-03-2020 04:18 PM
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);
10-05-2020 03:38 AM
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.
10-05-2020 04:32 AM
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
10-05-2020 04:42 AM
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.
10-05-2020 04:28 AM
Thanks for pointing this out
It has worked now.
Explore our Alfresco products with the links below. Use labels to filter content by product module.