{"rows": [
#set($view = $context.getRequestParameter("view"))
#if ($searcher && $view)
	#set ($details = $searcher.getDetailsForView($view, $user))
	#set ($size = $details.size())
#end
#foreach ($res in $autocomplete.getPageOfHits())
#if( $velocityCount > 1 ),#end
#set($label = $searcherManager.getLabel($searcher,$res))
#if($details)
{
#foreach( $detail in $details)
#set($val = "$detail.id")
#if($val == "name") "name": "$label" #else "$detail.id": "$!{res.get($val)}" #end #if($velocityCount != $size),#end
#end
}
#else
{"id": "$res.get('id')", "name": "$label", "sourcepath" : "$res.sourcepath", "view" : "$view"}
#end
#end
]
}