complex query on metadata

Do you want to create a native client or integrate with third party applications: webservices are the solution.
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.
Post Reply
rmdd
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Thu Jul 29, 2021 9:14 am

complex query on metadata

Post 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
jllort
Moderator
Moderator
Posts: 11566
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: complex query on metadata

Post 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.
rmdd
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Thu Jul 29, 2021 9:14 am

Re: complex query on metadata

Post 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
jllort
Moderator
Moderator
Posts: 11566
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: complex query on metadata

Post 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 )
rmdd
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Thu Jul 29, 2021 9:14 am

Re: complex query on metadata

Post by rmdd »

Hello,

the syntax okp\:dm.doc_cat:value works.
Also with the "AND" and "OR" operators.

Thanks
Post Reply