Search API - include structured metadata in results?

Comments

6 comments

  • Avatar
    Francis Tagbo

    Hi John,

    In using the CLI, you can use the option -f or --with_field. Here is the example command for your case:

    cld search -f context "tags=dogs"

    OR

    cld search --with_field context "tags=dogs"

    You can learn more about this in the documentation:
    https://cloudinary.com/documentation/cloudinary_cli#search

    Please note that in your screenshot, the resource does not have the tag "dogs" so it won't be in the search result.

    Hope this helps, please let me know if you have further questions

    Regards,
    Francis

    1
    Comment actions Permalink
  • Avatar
    Francis Tagbo

    Hi John,

    To include the contextual metadata in the search result, you can include with_field('context'). Then for structured metadata, you can include with_field('metadata'). Please let me know how it goes.

    Regards,
    Francis

    0
    Comment actions Permalink
  • Avatar
    John Egan

    Thanks Francis,

    when I run a command like this: 

    cld search "tags=dogs with_field('context')"

    I get the exact same results as I do with this command:

    cld search tags=dogs

    For each matching asset, I'm hoping the results will include any values added here:

    0
    Comment actions Permalink
  • Avatar
    John Egan

    Thanks Francis - I was struggling a bit with the syntax, this should help :) 

    0
    Comment actions Permalink
  • Avatar
    John Egan

    I can confirm that this worked exactly as I hoped. Thanks for your patience Francis. 

    0
    Comment actions Permalink
  • Avatar
    Francis Tagbo

    You're welcome, John! Glad I could help :)

    0
    Comment actions Permalink

Please sign in to leave a comment.