anchor.diff:  					<cfset console(cfcatch)>
   				</cfcatch>
   			</cftry>
  -		</cfif>
  +		</cfif> --->
   		<!--- Decide on the key --->
  -		<cfif the_file EQ "">
  +		<!--- <cfif the_file EQ "">
   			<cfset var thekey = qry.id>
   		<cfelse>
   			<cfset var thekey = the_file>
   		</cfif>
   		<!--- Set key properly --->
  -		<cfset QuerySetcell( qry, "thekey", thekey ) />
  +		<cfset QuerySetcell( qry, "thekey", thekey ) /> --->
  +		<cfset QuerySetcell( qry, "thekey", qry.id ) />
   		<!--- Return --->
   		<cfreturn qry />
   	</cffunction>
  
positive.code: 	<!--- Query records to remove --->
  	<cffunction name="_removeFromIndex" access="private" output="false">
  		<cfargument name="qryrecords" required="true" type="query">
  		<!--- Log --->
  		<cfset console("#now()# ---------------------- Removing #qryrecords.recordcount# records from index")>
  		<!--- Group hosts --->
  		<cfset var _hosts = ListRemoveDuplicates(valuelist(arguments.qryrecords.host_id)) />
  		<!--- Loop over hosts --->
  		<cfloop list="#_hosts#" delimiters="," index="host_id">
  		<!--- Simple remove records in Lucene. Id is the key --->
  			<cfscript>
  				args = {
  					query : arguments.qryrecords,
  					collection : "#host_id#",
  					key : "id"
  				};
  				results = CollectionIndexdelete( argumentCollection=args );
  			</cfscript>
  		</cfloop>
  		<!--- Log --->
  		<cfset console("#now()# ---------------------- Finished removing #qryrecords.recordcount# records from index")>
  
negative.code: 			<cfset var qry = "">
  			<!--- Query --->
  			<cfquery datasource="#application.razuna.datasource#" name="qry">
  			SELECT img_id as id, 'img' as type, host_id
  			FROM raz1_images
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			UNION ALL
  			SELECT vid_id as id, 'vid' as type, host_id
  			FROM raz1_videos
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			UNION ALL
  			SELECT aud_id as id, 'aud' as type, host_id
  			FROM raz1_audios
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			UNION ALL
  			SELECT file_id as id, 'doc' as type, host_id
  			FROM raz1_files
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			<cfif Listfindnocase(arguments.prefix,"raz2_") NEQ 0>
  			UNION ALL
  			SELECT img_id as id, 'img' as type, host_id
  			FROM raz2_images
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			UNION ALL
  			SELECT vid_id as id, 'vid' as type, host_id
  			FROM raz2_videos
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			UNION ALL
  			SELECT aud_id as id, 'aud' as type, host_id
  			FROM raz2_audios
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			UNION ALL
  			SELECT file_id as id, 'doc' as type, host_id
  			FROM raz2_files
  			WHERE lower(in_trash) = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="t">
  			AND is_indexed = <cfqueryparam cfsqltype="cf_sql_varchar" value="1">
  			</cfif>
  			</cfquery>
  
  			<!--- SELECT id, type, host_id
  			FROM lucene --->
  
  			<!--- Only continue if records are found --->
  			<cfif qry.recordcount NEQ 0>
  				<!--- Log --->
  