Page 1 of 1
Find webservice - Usage of AND,OR Logical operators
PostPosted:Thu Mar 13, 2014 6:57 pm
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?
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Fri Mar 14, 2014 8:27 am
by jllort
Actually search only implements "AND" operator.
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Fri Mar 14, 2014 5:20 pm
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.
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Sat Mar 15, 2014 7:01 pm
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.
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Sun Mar 16, 2014 5:55 am
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.
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Tue Mar 18, 2014 5:47 am
by Raphel
Can you provide confirmation whether OpenKM provides support searching with NOT operator or it has been discontinued like the OR operator search?
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Wed Mar 19, 2014 7:36 pm
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 ).
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Thu Mar 20, 2014 5:33 am
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?
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Sun Mar 23, 2014 5:54 am
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 allOKMSearch.getInstance().findSimpleQuery(null, "\"literal phrase\"")
Note the protected \" inside the string.
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Sun Mar 23, 2014 1:32 pm
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?
Re: Find webservice - Usage of AND,OR Logical operators
PostPosted:Tue Mar 25, 2014 8:44 am
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.