Posted in ColdFusion | Posted on 08-13-2011 | 2,894 views
Attached to this blog entry you will find support for adding Solr support to your script based CFCs. These CFCs act like the other tag wrappers in ColdFusion 9 and should be saved to your <cfintall>/customtags/com/adobe/coldfusion folder. Please back up your base.cfc file first! The other files are new. Here's an example of how your code may look.
1<cfscript>
2c = new com.adobe.coldfusion.collection();
3c.create(collection="test2",path=server.coldfusion.rootdir & "/collections");
4
5idx = new com.adobe.coldfusion.index();
6//q is a query I made earlier
7r = idx.refresh(collection="test2",key="id",body="body",query=q,status=true);
8writeDump(var=r,label="refresh");
9
10mysearch = new com.adobe.coldfusion.search();
11res = mysearch.search(criteria="cfabort",collection="cfdocs",maxrows=5,status="true");
12</cfscript>
2c = new com.adobe.coldfusion.collection();
3c.create(collection="test2",path=server.coldfusion.rootdir & "/collections");
4
5idx = new com.adobe.coldfusion.index();
6//q is a query I made earlier
7r = idx.refresh(collection="test2",key="id",body="body",query=q,status=true);
8writeDump(var=r,label="refresh");
9
10mysearch = new com.adobe.coldfusion.search();
11res = mysearch.search(criteria="cfabort",collection="cfdocs",maxrows=5,status="true");
12</cfscript>
This code has been submitted to the CF engineering team for a future update, but it had not yet been heavily QAed. Use with caution.

