These constraints are indeed not the ids that should be shown but a legacy context mechanism for setting some associations 'automagically'. You can read about it here but I would not recommend using it now, and anyway it's not relevant to your current issue.
What you're trying to achieve is not so straightforward now. What you could do is create a container entity that associates with the entity of your search results, create an instance of this entity and set the associations and then show a dataview of your container entity and show a datagrid over the association you just filled.
A different way would be to fill your datagrid using a microflow source and return the objects in your microflow (optionally through a java action) but there are some restrictions in what you can do with grids filled by microflows.