You'll need to handle the global event DocumentEvents.GetContent.Execute
(more info here).
And then you can add a custom field to the search index using code like this:
if (e.Node.IsLink)
{
e.SearchDocument.Add(
"linked",
"true");
}
I use this to mark linked docs (the -NodeLinkedNodeID:[0 TO 999999999]
doesn't work for me correctly).
You can also test different queries using Luke