Page 1 of 1
complex query on metadata
PostPosted:Thu Jul 29, 2021 9:21 am
by rmdd
Hello,
I used the java SDK and i need to search documents through metadata.
I need to perform search like meta1=ABC AND (meta2=X OR meta2=Y)
It seems not possible to do that with the API (OKMWebservices.search.find)
Is it possible to use the lucene syntax to achive this ? (OKMWebservices.search.findByQuery)
it works well with the basic parameters but i cant find the way to use it with the metadata.
Thanks for your help
Re: complex query on metadata
PostPosted:Sat Jul 31, 2021 5:14 pm
by jllort
OR query can only be used from lucene search queries. In OpenKM professional edition we have direct support for this kind of queries from the UI ( currently not available from CE ) maybe this section of the documentation of the professional edition can give some clue
https://docs.openkm.com/kcenter/view/ok ... eries.html
If share the current query can take a look.
Re: complex query on metadata
PostPosted:Tue Aug 03, 2021 9:14 am
by rmdd
Hello,
Thanks for the info, i used escape chars for metadata so now the query syntax is correct. But the result is wrong.
We use OpenKM version 7.1.24 (found in the UI interface)
We use sdk4j 3.15 to perform queries.
The lucene syntax works for basic properties but not for metadata :
something like : name:abcd_ACD_* OR name:abcd_OUF_* --> works perfectly
but : okp.dm.doc_cat:ACD --> returns nothing (i've results using the UI interface with REST)
Any ideas ?
Thanks
Re: complex query on metadata
PostPosted:Sat Aug 07, 2021 6:59 am
by jllort
As a customer take advantage of using OpenKM customer support for professional edition. If it is not clear for you how to access professional support website, please ask to your sales manager agent.
You should add wildcard at the end okp.dm.doc_cat:ACD ( in this query you are searching for exact workd ACD ) as okp.dm.doc_cat:ACD* ( will search for word what start with ACD )
Re: complex query on metadata
PostPosted:Thu Aug 12, 2021 8:31 am
by rmdd
Hello,
the syntax okp\:dm.doc_cat:value works.
Also with the "AND" and "OR" operators.
Thanks