• Search by Folder

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #1346  by Dena
 
Hi there,

How would one search in a particular folder and the children thereof making use of the findByContent,findByKeywords and findByName methods.

Best Regards
Dena
 #1350  by pavila
 
Do you mean make search in a folder? This feature is not implemented actually.
 #1356  by Dena
 
Can I not use the findBystatement and use the XPath query to search in a particular folder. If possible can someone help me define the XPath query to do this.
 #1362  by pavila
 
Yes, of course. I was thinking in the Web User Interface. With XPath you can make powerful search.
 #1363  by Dena
 
Thanks, do you have an example of using XPath query that would do what I am looking for? I would really appreciate this.
 #1369  by pavila
 
In DirectSearchModule.java you can see how the XPath is constructed.
 #1374  by Dena
 
Thanks I will have a look
 #1377  by Dena
 
Hi there,

I have the following code which is supposed to search folder \"denzil\" which is a subfolder of the root folder (okm:root) for doc\'s that have keywords \"document\". However the search returns 0 records, when infact it should return 1 record. I would appreciate it if someone could assist me.

Best Regards
Dena

String username = \"denzil\";
String searchText = \"document\";

String search = \"/jcr:root/okm:root/\"+userName+\"//element(*,okm:document)[jcr:contains(@okm:keywords,\'\"+ searchText + \"\')] order by @jcr:score descending\";
 #1385  by pavila
 
I have make a test and works fine. Which version of OpenKM are you running?
 #1386  by Dena
 
Thanks I managed to sort out the problem, I added the following \"[1]\" to the query string. I read the JCR specification, they give great examples explaining the use of XPath for JCR.

String username = \"denzil\";
String searchText = \"document\";

String search = \"/jcr:root/okm:root/\"+userName+\"[1]//element(*,okm:document)[jcr:contains(@okm:keywords,\'\"+ searchText + \"\')] order by @jcrcore descending\";
 #1391  by pavila
 
I don\'t understand why you have to add this \"[1]\" ¿?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.