Page 1 of 1

OKMSearch using OR operator in openkm6.2.5

PostPosted:Thu Dec 12, 2013 9:34 am
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.

Re: OKMSearch using OR operator in openkm6.2.5

PostPosted:Fri Dec 13, 2013 12:24 pm
by jllort
Actually is only implemented AND, should make some in source code for it.