Forum Discussion

peterlu's avatar
peterlu
Champion
8 years ago

Search API for meta data (not moderation custom tag)

Hi All,

 

We know that there is a API v1 to get/set/reset the meta data

/messages/id/${messageId}/metadata/key/${metakey}/(get/set/reset)

reset = delete the metakey

 

We try to do a search api query (/search/messages/...) that will match keywords from post subject title and also the posts need to have that metakey (or even better to match a certain value of the metakey)

 

Is this possible? Any API example?

 

I think meta database is set up differently, it may not be optimised for a search query? Or do we need to ask Lithium Support to help set it up?

 

Anyone has done that before?

 

Thanks

 

Peter

 

 

  • Ok, it looks like I have to use Lithium built-in custom tag (attribute tag) from mod tools. I can get/set/reset the key. API v2 supports custom tag in where statement (only for the key)

5 Replies

  • peterlu- You can perform search on metadata as well.

     

     

    select * from messages where meta_data_name matches "metadatavalue"

    Please check this thread.

     

  • peterlu- Lithium support is needed to add the custom metadata but not for the API's. Metadata API will work if the Metadata is already added.

     

  • peterlu's avatar
    peterlu
    Champion
    8 years ago
    TariqHussain Lithium Support has told me that custom meta is not supported in API v2. They have added the meta key for me. I have tried the query, no luck. So I am thinking of using modbar custom tag now, since it is supported in API v2, but it only supports the meta key search, not the value, according to the doc.
  • Ok, it looks like I have to use Lithium built-in custom tag (attribute tag) from mod tools. I can get/set/reset the key. API v2 supports custom tag in where statement (only for the key)