• complex query on metadata

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
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.
 #52674  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
 #52684  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.
 #52688  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
 #52696  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 )
 #52711  by rmdd
 
Hello,

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

Thanks

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.