Ok, that’s just fine what you are doing then. If you want more functionality wrapped around fetching the documents, that the right way to go, you’re doing well!
You’ve not shared the FQL for the Index or the UDF, so it cannot be diagnosed directly. The UDF will of course receive just the id. Does the Index require the full Ref? So, are you providing the index the correct information?
If the term for the index is { field: ['data', 'ranking'] }
then you need to provide it Ref(Collection("Ranking"), "282953512300577285")
, not just "282953512300577285"
.
This from the other post, makes me think that the error might be from providing the wrong input for the term? But you’ll need to confirm how you are calling the Index.
You can test from the dashboard. But instead of using String
as input, select FQL
and type Ref(Collection("Ranking"), "282953512300577285")
directly and hopefully you’ll see results for the index.