Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
asset search
siva2_2000
Hi Friends,
Need help in asset search. I am planning to use
function &Search_GetAssetIDsOnly($criteria)..
what could be the $criteria???
will this work???
Search_GetAssetIDsOnly('Author is "Sivakumar"');
please help me
Thanks in advance
shiva
Find more posts tagged with
Comments
siva2_2000
Friends,
have a look at these lines of code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$mName="Any Text";
$mID="{DD528FE2-19CE-471E-8DC1-9042F89422B1}";
$mValue="test";
$MBMetadata=array('mName'=>$mName,'mID'=>$mID,'mValue'=>$mValue);
$MBSearchConstraint=array('mMetadata'=>$MBMetadata,'mSearchOperator'=>'contains');
$rootCon =$soapProxyclient->GetRootContainer();
$MBSearchCriteria=array('mContainerID'=>$rootCon->mID,'mRecursive'=>true,'mSearchConstraints'=>$MBSearchConstraint,'mMaxHits'=>'10');
$Search_GetAssetIDsOnly=$soapProxyclient->Search_GetAssetIDsOnly($MBSearchCriteria);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Following are the Request and Response that i am getting
[[[[[Request]]]]]
POST /MediaBinWebService/MediaBinServer.asmx HTTP/1.0
Proxy-Authorization: Basic QWRtaW5pc3RyYXRvcjo=
Authorization: Basic QWRtaW5pc3RyYXRvcjo=
User-Agent: PEAR-SOAP 0.8.0RC2-devel
Host: 133.176.65.49
Content-Type: text/xml; charset=UTF-8
Content-Length: 885
SOAPAction: "
http://www.mediabin.com/Search_GetAssetIDsOnly"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns
OAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns
OAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="
http://www.mediabin.com"
>
<SOAP-ENV:Body>
<ns4
earch_GetAssetIDsOnly>
<ns4:criteria>
<ns4:mContainerID>{75D3B7B9-8963-4F77-9B6E-B1CD99B41C88}</ns4:mContainerID>
<ns4:mRecursive>true</ns4:mRecursive>
<ns4:mSearchConstraints>
<ns4:mMetadata>
<ns4:mName>Any Text</ns4:mName>
<ns4:mID>{DD528FE2-19CE-471E-8DC1-9042F89422B1}</ns4:mID>
<ns4:mValue>test</ns4:mValue></ns4:mMetadata>
<ns4:mSearchOperator>contains</ns4:mSearchOperator></ns4:mSearchConstraints>
<ns4:mMaxHits>10</ns4:mMaxHits></ns4:criteria></ns4
earch_GetAssetIDsOnly>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
[[[[[Response]]]]]
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 28 Oct 2004 01:08:40 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 522
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"><soap:Header><wsu:Timestamp
xmlns:wsu="
http://schemas.xmlsoap.org/ws/2002/07/utility"><wsu:Created>2004-10-28T01:08:40Z</wsu:Created><wsu:Expires>2004-10-28T01:13:40Z</wsu:Expires></wsu:Timestamp></soap:Header><soap:Body><Search_GetAssetIDsOnlyResponse
xmlns="
http://www.mediabin.com"
/></soap:Body></soap:Envelope>
Now, there is a 'test' mValue, but i am not getting the search results....
is there any otherway of doing it???
msnider
You can get the array of acceptable values for the search operator by a call to GetSearchableMetadata...for AnyText you'd get the following:
- <MBSearchableMetadata>
<mName>Any Text</mName>
<mID>{DD528FE2-19CE-471E-8DC1-9042F89422B1}</mID>
- <mFormat>
<mType>String</mType>
<mMaxStringLen>255</mMaxStringLen>
</mFormat>
- <mSearchOperators>
- <MBNameValuePair>
<mName>is exactly</mName>
<mValue>Equality</mValue>
</MBNameValuePair>
- <MBNameValuePair>
<mName>is not exactly</mName>
<mValue>Inequality</mValue>
</MBNameValuePair>
- <MBNameValuePair>
<mName>contains</mName>
<mValue>Contains</mValue>
</MBNameValuePair>
- <MBNameValuePair>
<mName>does not contain</mName>
<mValue>NotContains</mValue>
</MBNameValuePair>
- <MBNameValuePair>
<mName>starts with</mName>
<mValue>StartsWith</mValue>
</MBNameValuePair>
- <MBNameValuePair>
<mName>does not start with</mName>
<mValue>NotStartsWith</mValue>
</MBNameValuePair>
- <MBNameValuePair>
<mName>exists</mName>
<mValue>OpExists</mValue>
</MBNameValuePair>
</mSearchOperators>
</MBSearchableMetadata>
The MBNameValuePairs show the display name and the actual enum value...which is "contains\Contains" therefore try changing:
<ns4:mSearchOperator>contains</ns4:mSearchOperator></
to
<ns4:mSearchOperator>Contains</ns4:mSearchOperator></