Page 1 of 1
Search by property group using web services
PostPosted:Thu May 08, 2014 12:15 am
by matt81
Hi,
I am trying to search by Property group attributes. I have a custom Proeprty group with a date field, and I am trying to search with date range, however it is not filtering properly. Do you know if this can be achieved.
This is what I use:
Code: Select all $param = array(
'content' => '',
'dashboard' => true,
'domain' => 1, // DOCUMENT = 1; FOLDER = 2; MAIL = 4;
'id' => 0,
'properties' => array("grpName" => 'okg:dates', "key" => "okp:dates.expdate", "value" => "20140507000000"));
$find = http://localhost:8080/OpenKM/services/OKMSearch?wsdl->find(array('token' => $token, 'params' => $param));
This can be achieved from OpenKM itself easily, see attachment.
Thanks
Re: Search by property group using web services
PostPosted:Sat May 10, 2014 8:58 am
by jllort
You want to filtering these metadata between date 1 to date 2 or what are you doing now what seems equals. In case between the format is "yyyyMMddHHmmss,yyyyMMddHHmmss" where first is date from and second date to
Re: Search by property group using web services
PostPosted:Mon May 12, 2014 12:05 am
by matt81
Thanks for your reply, you have clarified the date format for me.
Can you tell me how I can search with date range. At the moment as you mentioned it is comparing equal, and that doesn't work with dates, you cannnot compare dates that way.
How can I search between 2 dates, when I use the following format it doesn't return anything. Do I have to use other attributes for searching like
queryName or
statementQuery:
Code: Select all'properties' => array("entry"=> array( 'key' => "okp:edms.expdate",
'value' => "20140507000000", "20140508000000")),
Thanks
Re: Search by property group using web services
PostPosted:Tue May 13, 2014 11:07 pm
by matt81
Do you have any suggestions for me, I have tried it using stamentQuery, however no results are displayed, see below:
Code: Select all $param = array(
'content' => '',
'dashboard' => false,
'domain' => 1, // DOCUMENT = 1; FOLDER = 2; MAIL = 4;
'id' => 1,
'properties' => array(),
"statementQuery" => "SELECT * FROM `OKM_NODE_PROPERTY`",
"statementType" => "sql");
Re: Search by property group using web services
PostPosted:Thu May 15, 2014 3:45 am
by matt81
Any reply???
Re: Search by property group using web services
PostPosted:Sat May 17, 2014 7:54 am
by jllort
I do not understand what are you trying to do here with
Code: Select all"statementQuery" => "SELECT * FROM `OKM_NODE_PROPERTY`",
"statementType" => "sql"
Are you trying to do queries with what ?
Re: Search by property group using web services
PostPosted:Sun May 18, 2014 11:02 pm
by matt81
Yes I am trying to make an SQL query on property meta data, but nothing is returned. I have placed that SQL as an example, this is the one I use, see below:
Code: Select allSELECT * FROM `OKM_NODE_PROPERTY` where `NPG_NODE` = '0bfa13dc-750a-45ff-9cae-b783212974a1' and `NPG_NAME` = 'okp:test.date' and `NPG_VALUE` between '20140506000000' and '20140508000000'
It is not returning anything, when I try to execute this in Database it returns records. What is the problem do you know? Why is it not returning anything, am I doing anything wrong?
Please let me know.
Re: Search by property group using web services
PostPosted:Mon May 19, 2014 10:49 pm
by matt81
So I am trying to search for all documents by meta data property called Expiry date. I need to search between 2 dates. Reading about it the only way that it can be done is by executing SQL statement using statementQuery. See above. Can you please let me know how can I achieve this, I have been stuck on it for over a week.
Re: Search by property group using web services
PostPosted:Tue May 20, 2014 10:57 pm
by matt81
Can I get a reply please, I know you gus are busy but I have been stuck on this issue for over a week.
Much appreciated. Thanks
Re: Search by property group using web services
PostPosted:Wed May 21, 2014 9:44 pm
by jllort
The way for doing this kind of search is what I explained in previous post:
Code: Select allproperties' => array("entry"=> array( 'key' => "okp:edms.expdate",
'value' => "20140507000000,20140508000000")),
That will do a query with one metadata field okp:edms.expdate what is date type, between two dates
"20140507000000,20140508000000".
Sorry for bab written, in last post I think I've done a mistake, the idea is a String with two dates (yyyyMMddhhmmss) separated by coma like "20140507000000,20140508000000"
Re: Search by property group using web services
PostPosted:Thu May 22, 2014 4:09 am
by matt81
Thanks a lot, that worked. You made my day!
Re: Search by property group using web services
PostPosted:Sat Mar 21, 2015 5:55 pm
by tsagar
jllort wrote:The way for doing this kind of search is what I explained in previous post:
Code: Select allproperties' => array("entry"=> array( 'key' => "okp:edms.expdate",
'value' => "20140507000000,20140508000000")),
That will do a query with one metadata field okp:edms.expdate what is date type, between two dates "20140507000000,20140508000000".
Sorry for bab written, in last post I think I've done a mistake, the idea is a String with two dates (yyyyMMddhhmmss) separated by coma like "20140507000000,20140508000000"
Thanks Jillort, your reply to Matt's question helped me in resolving my issue with respect to finding the document based on dates.