• Find webservice - Usage of AND,OR Logical operators

  • 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.
 #28093  by Raphel
 
Hi,
I am implementing full text search on the files in OKM repository using Find webservice. I need to implement search criteria like 'Fetch documents containing all of the specified words', 'Fetch documents containing any of the specified words',etc. To achieve this, I need to specify multiple search texts separated by AND, OR logical operators. How to specify this using the Find webservice?
 #28102  by Raphel
 
Hi,

I am not able to understand your reply. Do you mean that the search only supports 'AND' operator(which means it supports the 'Search documents containing all of the search text') and it does not support 'OR' operator(which means it does not support the 'Search documents containing any of the search text').
Also if you can provide examples of specifying multiple search texts with 'AND' operator with the 'Find' webservice using QueryParams, it'll be highly appreciated.
 #28111  by jllort
 
Yes it only support "AND" operator. Really and operator are pre-supposed to any query for example if you do a query by content like:
content -> weather* word*
Internally is evaluated as any document with content words starting with weather and word

In older versions we got OR logic, but after upgrade from 5.x to 6.x had been discontinued. We thought for some search is better build your own implementation.
 #28113  by Raphel
 
Hi,

From your reply what I understand is OpenKM supports a variation of exact phrase match as the AND operator search. For example, if I have a document with a list of country names say, 'Germany Spain France England Hungary Finland Romania Russia Belgium Portugal'. If my search text was 'Spain France' or 'Spa* Fra*', OpenKM will return this document as a match. But if wanted to search like 'Spain' and 'Finland'(searching for the existence of both 'Spain' and 'Finland' within the document) or 'Germany England', OpenKM search will not return this document as a match.

Please let me know if my understanding is correct and whether this is the expected behavior of OpenKM Find webservice. Also, please confirm if OpenKM search also does not support NOT operator search like the OR operator.
 #28136  by jllort
 
By deafault comes only with and, that means if you this query 'Germany Spain France England Hungary Finland Romania Russia Belgium Portugal' documents must contains all the word otherside will not match. About NOT operator, is not included. As I explained the default implementation only considers NOT. Other search types should be customized ( OR and NOT combinations are not trivial logic and depending the kind of query you want to use combination of AND OR NOT can not be easilly shown and understood by end user ).
 #28141  by Raphel
 
Hi,

Thanks for the update. From your reply, my understanding is that OpenKM supports only 'AND' operator based search and the other types of searches based on 'OR' and 'NOT' operator is not supported.

One final query on how OpenKM supports the AND based search. Suppose if I am making a search for the text 'Spain France', the search returns two documents with the following content.
Doc 1 - 'Germany Spain France England Hungary Finland Romania Russia Belgium Portugal'
Doc 2 - 'Germany Spain England Hungary France Finland Romania Russia Belgium Portugal'

Note in the first document 'Spain France' occur as the given search text, while in the second document 'Spain', 'France' both are found but not as consecutive text. Now as per the AND operator search, I understand that OpenKM searches for the occurrences of both 'Spain' 'France' tokens and return all the documents containing these two tokens irrespective of whether they occur as consecutive text or not.

Suppose if my requirement is to find only the documents in which the tokens appear as consecutive text(Exact Phrase Search), how do I achieve it?
In the above example , if my search text was 'Spain France', my expectation is only the first document should be returned as the Exact Phrase Search.
Is there any way to specify this using OpenKM's Find webservice to match the exact phrase?
 #28171  by pavila
 
I think this question has been already answered in another post. Currently, the only way to search for a "literal phrase" is using the "Simple Search" (from OpenKM User Interface) or by API:
Code: Select all
OKMSearch.getInstance().findSimpleQuery(null, "\"literal phrase\"")
Note the protected \" inside the string.
 #28174  by Raphel
 
Hi,
Thanks for the update. Now I have another problem. We are using community edition of OpenKM and use okm-ws-client-aws-6.2.jar, which basically exposes the webservices to access OpenKM repository services. But I find the 'findSimpleQuery' is part of the 'com.openkm.api' package and this is not available in the jar that we use. I tried to search for any jar containing these classes, but without any luck. Can you provide information on whether this is available for community edition and how to get the jar containing OpenKM core and API packages?
 #28183  by jllort
 
please post this question in other post,do not merge several questions in same post otherwise generate confusion to other readers. Thanks for your comprehension.

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.