• Find webservice not working with SDK4J

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #29986  by Raphel
 
Hi ,
I am using SDK4J version 1.0 and trying to perform full text search with 'Find' webservice to return documents containing the search text. Following is the code snippet I have used.
Code: Select all
	public List<QueryResult> searchDocs(String searchText) throws Exception{
	    OKMWebservices okmWebservices = OKMWebservicesFactory.newInstance(OKM_ENDPOINT_URL, FileHandlingPropertiesUtil.getProperty("USERNAME"),
					FileHandlingPropertiesUtil.getProperty("PASSWORD"));			
		List<QueryResult> resultList = null;
		QueryParams queryParams = new QueryParams();
	try{
		String docPath = "/okm:root/Integ/Award_Integ/";

		queryParams.setPath(docPath);
		queryParams.setContent(searchText);
		queryParams.setDomain(1);

		resultList = okmWebservices.find(queryParams);
	} catch (Exception e) {
		log.error("Exception : "+ CommonUtil.writeErrorLog(e));
	} 
	return resultList;
	}
The search text used returns valid result if I perform the same search using OpenKM repository GUI. But when I perform the same search through our application, using the above code, it is returning empty result. This used to work with Open KM 6.2 without SDK4J. But after replacing with SDK4J, the full text search using 'Find' webservice is not working.
Please let me know if I am missing anything here.

I have tried with 'FindByContent' and that is also failing.
 #30004  by jllort
 
1- does the user have enought grants to see the results ?
2- From UI you're using findPaginatedMethod

Is not a SDK problem, seems filtering by path does not like in this OpenKM version. If you remove queryParams.setPath(docPath); will go right ( also you can test in UI and you will observate the same, when you set the path, query does not going right ).

Your code will be more correct with:
Code: Select all
qp.setDomain(QueryParams.DOCUMENT);
 #30045  by connect2selva
 
I face the same issue, Im able to see the results in List<QueryResult> in find method, But Node object inside QueryResult is coming as null, But 'getExcerpt' returns the values which matched with OpenKM UI. What could be the issue How can I resolve it. My snippet below

I tried with both findPaginated and find. Both are returning results with null Node. I have tried the same user as UI, So he has the privilege for the file
Code: Select all
       QueryParams queryParams = new QueryParams();
		queryParams.setContent("cnumb4");
		queryParams.setDomain(QueryParams.DOCUMENT);

List<QueryResult> resultList = okmWebservices.find(queryParams);
for (QueryResult qr : resultList)
		{
//			Node doc = qr.getNode(); //Node is coming as Null
//			System.out.println(doc.getUuid());
			System.out.println(qr.getExcerpt());
		}
It works when I tried for http://demo.openkm.com/OpenKM, But it doesn't work for our OpenKM server. Do we need to do anything on the server to get the node properly.

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.