Home
TeamSite
Quick Search MetaData GUID
System
What is the MetaData GUID for 'Quick Search' ? I checked in the api guide but, it was not there and I couldn't find it in the metadatacatalog in the db either. Thanks.
Find more posts tagged with
Comments
Spiff
Stacy:
Sorry, the GUID name is not that clear - it is completely historical. It is MBSession.GetMetaDataFullTextStringId.
Migrateduser
Hi Spiff,
Thanks for responding, I appreciate it. I ran that method and received the following value.
{F24FC776-00D2-4ED7-ADA3-9D5288B149A3}
However, I can't use that as a value when passing it to the FindAllAssets() method as I receive an error "The value passed in is not valid for the parameter." Ideas?
Here is the code.
Public Function MediaBin_SearchBySingleMetaData(i_strMetaDataID, i_strContainerGuid, i_strMetaDataValue) As Object
'=========================================================================
' Purpose : Search and return the asset by single metadata
'
' Input : i_strMetaDataID - MetaData Guid (Check api guide)
' i_strMetaDataValue - File name for used for search
' i_strContainerGuid - The MediaBin container guid
'
' History :
'-------------------------------------------------------------------------
' Date Developer Description
'-------------------------------------------------------------------------
' 2007-09-18 StacyHan Initial Creation
' Notes: 1 ) None.
'-------------------------------------------------------------------------
'=========================================================================
Dim objRoot As MBContainer
Dim objSearchCriteria As MBSearchCriteria
Dim objSearchConstraint As MBSearchConstraint
Dim colSearchResults As MBObjectCollection
Dim objMBImage As Object
Set objRoot = g_objMBSession.GetContainer(i_strContainerGuid)
Set objSearchConstraint = g_objMBSession.CreateMetaDataCompareSearchConstraint(i_strMetaDataID, SearchContains, i_strMetaDataValue)
Set objSearchCriteria = g_objMBSession.CreateConstraintSearchCriteria(objSearchConstraint)
Set colSearchResults = objRoot.FindAllAssets(objSearchCriteria)
If colSearchResults.Count > 0 Then
Set MediaBin_SearchBySingleMetaData = colSearchResults.Item(1)
End If
' Garbage collection
Set objMBImage = Nothing
Set colSearchResults = Nothing
Set objSearchConstraint = Nothing
Set objSearchCriteria = Nothing
Set objRoot = Nothing
End Function
Spiff
That GUID is for sure the right one. But I don't know why you are getting the 'not valid' error. I have used basically the same methods (for creating search constraint and criteria) to test Quick Search and it works for me.
What's the actual values of your SearchContains and i_strMetaDataValue variables?
Migrateduser
SearchContains is a MediaBin constant and i_strMetaDataValue is the file name. It could be anything. We have hex based naming conventions in MediaBin as we link the image to license/payments records in a different system. So file names commonly look like 8 character hex numbers such as 001BD844.jpg..
Maybe one of the developer guys will see this thread and educate both of us what I am doing wrong. ;-)
msrinivas
Before I get into understanding you code
did you try:
Running the same code with a different metadata field
Is quick search functioning properly on the server that you are communicating with
Spiff
Hi, Stacy,
This is Keshi. I knew SearchContains is a MediaBin constant. But what value are you sure that you are using? Also, have you tried to search for '001BD844' (without '.jpg') instead of the entire name?
Migrateduser
Try casting your value to the correct type... for example if the value is a file name, cast it using CStr( ).
Migrateduser
Also wanted to mention that you will see that error message if you try to sort on a "invalid" metadata type. This is a bug in the web client. The 4.6.1 version does not permit choosing a display column containing multi-valued metadata, as a sort column.
The bug was introduced in 4.5.3 when sorting of search results was moved to the server. Previously the client would just take the first value in a multi-valued metadata and use it for the sort. The server will return an error.