Similar documents from embed links

This is a follow up on this How does Prismic work out "Similar content"?

I'm having the same issue where I don't get any results when querying a similar item.

My custom type has a uid and an embed link to a Vimeo video. How would the similar work in this case? would it read from the embedded data coming from Vimeo? Do I need to add any RichText to be able to have similar items

Thank you!

Hey @levijesica, thanks for reaching out.

The similar predicate does not search within an Embed field, it only takes into account strings that come from Rich Text, Key Text, Select or UID fields.

Sam published a detailed list of how the similar predicate works that you can check out here:

Hi @Paulina! Thanks for pointing that out. So based on that publication, if I have a document with UID letter_a and a second document with UID letter_b, shouldn't be those considered similar?

Yes, it is one parameter taken into consideration. But again, it gives more priority to RichText content and its headings, if there are any.

that makes sense. In our case, we have a custom type that only has a uid and an embedded link and we use all info coming from the link so the only way to relate them, since you don't use the embedded data, is to use the UID. But again, taking the example I gave above, those 2 types don't come as related when querying through the Rest API. How long does it take to refresh?

I'm thinking, for the similar predicate in specific, using a UID field as the only parameter maybe is not enough. It would depend on your use case but you could build a different query. For example, you could combine the at and not predicates to retrieve all documents except one and limit the amount of documents response.