Forum Discussion

peterlu's avatar
peterlu
Champion
7 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)
  • 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)
  • 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.