• OKMSearch using OR operator in openkm6.2.5

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #27446  by akv2502
 
As requested I am opening a separate post for this problem.
I am having the below code (earllier written in xpath)
Code: Select all
searchQuery.append("(jcr:like(@"+candidateObjectType+",'"+ candidateNumberString +"') and ");
searchQuery.append("jcr:like(@"+componentObjectType+",'%"+ componentNumberString +"%')) or ");
I would want to implement this in openkm6.2.5, for which I have written the code as : I am using OKMSearch.find(String token, QueryParams params)
Code: Select all
entryObj = new QueryParams.Properties.Entry();
entryObj.setKey(candidateObjectType);
entryObj.setValue(candidateNumberString);
propertyObj.getEntry().add(entryObj);

entryObj = new QueryParams.Properties.Entry();
entryObj.setKey(componentObjectType);
entryObj.setValue(componentNumberString);
propertyObj.getEntry().add(entryObj);
But in this, the queries will always return results in AND condition. Is there a way that I can use OR condition by setting queryParams.setOperator("or");
This doesnt work as the queryparams always take in AND operator.

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.