Skip to Content
0
Jul 14, 2020 at 03:29 PM

Flexible search query to fetch all existing Medias from a Media Container

1023 Views Last edit Jul 14, 2020 at 03:39 PM 6 rev

I want to fetch all media present in media container using a flexible search query. I tried with this query

select {M.pk} from {Media AS M JOIN MediaContainer2MediaRel AS REL ON {REL.target}={M.PK} JOIN MediaContainer as MC ON {REL.source}={MC.PK}} WHERE {MC.qualifier} like '%OHTHH1_plp_container%'

I ended up with this error

Exception message : cannot search unknown field 'TableField(name='target',langPK='null',type=MediaContainer2MediaRel)' within type MediaContainer2MediaRel unless you disable checking , infoMap=TypeInfoMap for type = 8796093448274 code = MediaContainer2MediaRel superType = 8796093055058 itemTable = null ....

Please provide a solution for how to query to fetch all medias present in a media container.