Is the index accessible in the UDF?

I want to use it this way.

select id from rt where ref(id) > 1;

I wonder if I can implement the above ref function, in which I query the data in the index according to the link information such as an id?

I can connect to the external service to query, but is it possible to query the index data directly in the UDF?

By the way, I’m going to use it on the rt index.

not quite clear what ref(id) will do.

You already could access any attribute values in UDF either either way as select id, id as i from idx where udf_call1(id)>1 and udf_call2(i)>1

Sorry, maybe I didn’t make it clear.

What I mean is that I want to implement a ref function that internally queries the data in the index based on the incoming id.

So my question is, how do I query the index data in this function?

sphinx_int64_t ref (SPH_UDF_INIT * init, SPH_UDF_ARGS * args, char * error_flag)

How do I find the index based on the value of args inside this function?
Is there an API to call?

inside UDF there is no way to know which index now is being processed

you might create feature request at Github to add index name to SPH_UDF_INIT function that got called on every index processing and get informed on issue progress

Well, thanks. I guess I’ll have to find some other solution.