Skip to content

Instantly share code, notes, and snippets.

@jeffcoughlin
Created December 7, 2012 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffcoughlin/4235035 to your computer and use it in GitHub Desktop.
Save jeffcoughlin/4235035 to your computer and use it in GitHub Desktop.
<!--- instantiate cfsolrlib --->
<cfset application.fapi.getContentType("configSolrServer").setupSolrLibrary() />
<cfset tickBegin = getTickCount() />
<cfset oSolrProContentType = application.fapi.getContentType("solrProContentType") />
<cfset stContentType.contentType = "TYPENAME" />
<cfset batchSize = 2000 />
<cflog application="true" file="aaa_farcrySolrPro" type="information" text="A_1. procTime: #getTickCount()-tickBegin# Date: #dateFormat(now(),"yyyy-mm-dd")# #timeFormat(now(),"hh:mm:ss")#" />
<cfset stResult = oSolrProContentType.getRecordsToIndex(typename = stContentType.contentType, batchSize = batchSize, builtToDate = "", bGetAllIds = false) />
<cfset lItemsInDB = replace(stResult.lItemsInDb, ",", " OR ", "all") />
<cflog application="true" file="aaa_farcrySolrPro" type="information" text="B_1. procTime: #getTickCount()-tickBegin# Date: #dateFormat(now(),"yyyy-mm-dd")# #timeFormat(now(),"hh:mm:ss")#" />
<cfset stRecords = oSolrProContentType.search(q = "typename:" & stContentType.contentType & " AND fcsp_sitename:" & application.applicationName & " AND -objectid:(" & lItemsInDB & ")", rows = 99999999, params = {"fl" = "objectid"}) />
<cflog application="true" file="aaa_farcrySolrPro" type="information" text="C_1. procTime: #getTickCount()-tickBegin# Date: #dateFormat(now(),"yyyy-mm-dd")# #timeFormat(now(),"hh:mm:ss")#" />
<cfoutput>
<strong>Count:</strong> #arrayLen(stRecords.results)#<br />
<strong>process took:</strong> #getTickCount()-tickBegin# ms
</cfoutput>
<cfabort />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment