Skip to main content

Search API : chaining items together

Comments

5 comments

  • Official comment
    Millie Axelrod

    Hi,

    Currently we do not support search of subfolders via the API. Search of subfolders can be done via the main search box in Cloudinary's Media Library UI. 

    We have added this feature request to our Roadmap and will update this thread with any progress.

     

  • Shirly Manor

    You can try our search API. For example:



    cloudinary.v2.search
    .expression('resource_type:image AND folder:review/* AND public_id:review/sample/dog*')
    .sort_by('public_id','desc')
    .max_results(30)
    .execute().then(result=>console.log(result));
    0
  • Carmendata

    Hi Shirly, given your example, say I don't know what subdirectory dog is in, all I know is its in review/ somewhere. How would you structure that ? 

    because I've tried

    resource_type:image AND folder:review/* AND public_id:*dog*
    resource_type:image AND folder:review/* AND public_id:review/*dog*

    Neither seem to work - or they disregard the folder part. 

    0
  • Rinat Biton

    Hi , 

    Here is a sample code : 

     

    resource_type:image AND folder=review/* AND filename:dog

     

    Hope that helps 

    0
  • Carmendata

    Hi there. Thanks for the feedback. However still struggling. I want to be able to do partial searches on public_id and folders. 

    This doesn't seem possible. 

    if I have a file path like /animal/mammal/dog/alife.jpg  . I just want to do a search where the folder or public id contains the word dog. I don't know path beforehand.

    folder:dog does not work public_id:dog does not work, folder:*dog* does not work public_id:*dog* does not work.

    According to the docs `folder:sample // any path that contains sample` this does not seem to be true. It seems to be any path that starts with sample. 

    1

Post is closed for comments.