<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Wayne Graham&apos;s Blog</title>
			<link>http://swem.wm.edu/blogs/waynegraham/index.cfm</link>
			<description>ColdFusion Development for Academic Libraries</description>
			<language>en-us</language>
			<pubDate>Sun, 22 Nov 2009 17:01:42 -0500</pubDate>
			<lastBuildDate>Tue, 05 Aug 2008 09:50:00 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>wsgrah@wm.edu</managingEditor>
			<webMaster>wsgrah@wm.edu</webMaster>
			
			
			
			
			
			<item>
				<title>Open Source Facebook Application</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/8/5/Open-Source-Facebook-Application</link>
				<description>
				
				Over the last year our library has used its Facebook application to let students see where their friends are in the library and expose library resources to users without needing to go to another website. It&apos;s been used pretty heavily and there are a lot of folks in the library world who have asked to get the source. 

This summer Phil spent a couple of weeks rewriting the code to be a little easier to maintain. We reimplemented the code with Smarty and reimplemented the locational device to use FBJS instead of regenerating an image when someone clicked on the map (it&apos;s much faster now). 

If you need a starter app, check it out at &lt;a href=&quot;http://code.google.com/p/facebook-athenaeum/&quot;&gt;http://code.google.com/p/facebook-athenaeum/&lt;/a&gt;.

If you need a good book on writing Facebook Applications, check out my book, &lt;a href=&quot;http://apress.com/book/view/1430209690&quot;&gt;Facebook API Developers Guide&lt;/a&gt;.
				
				</description>
						
				
				<category>Programming</category>				
				
				<category>Facebook</category>				
				
				<category>PHP</category>				
				
				<pubDate>Tue, 05 Aug 2008 09:50:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/8/5/Open-Source-Facebook-Application</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Rotten Luck</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/6/17/Rotten-Luck</link>
				<description>
				
				I&apos;m currently at a conference at Lehigh University, and it&apos;s given me pause to really reconsider air travel. Every time I travel, seems something goes awry. Coming back from a conference in California about a month ago, the last leg of my flight was canceled because the plane needed a new tire, and all of Charlotte didn&apos;t have a tire for that particular aircraft. I could swallow that since the aircraft wasn&apos;t safe to fly, but the line to actually reschedule my flight took about 2 hours, and they couldn&apos;t get me back to Newport News (where my car was) until almost midnight the next day. Fortunately, my wife came to get me in Norfolk. I was significantly peeved to not choose US Airways for my next flight to Vegas that I was going on in the next couple of weeks.

Coming back from Las Vegas (on United), the company had issued some &quot;cost saving measures&quot; that meant that the pilots couldn&apos;t have the engines on before we boarded on the flight from Dulles to Richmond. It was hot that day, so they turned the fans on for us, which drained the auxiliary power, which meant the engines couldn&apos;t be started. Well, they brought some field units on, but after the first three didn&apos;t work, we disembarked the aircraft to wait for maintenance to bring a fourth unit from another unit to get the aircraft started.

In my latest trip (unfortunately back on US Airways), I got to Lehigh yesterday afternoon, but my bags only made it as far as Boston. I was first told my bags would be on the 4:00pm flight, but when I called at 6:30 to check, they told me they&apos;d be arriving at 7:00pm. I called at 9:00 to check, and they told me my bag would be delivered by midnight last night. Since I wasn&apos;t woken up by my phone last night, I called again this morning. I was informed that the delivery service began at 8:00am, and they had a 4 - 6 hour window for delivery. 

I&apos;m thinking that the next time I need to travel, Amtrak is looking a lot better...
				
				</description>
						
				
				<category>General</category>				
				
				<pubDate>Tue, 17 Jun 2008 06:23:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/6/17/Rotten-Luck</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Thumpers!</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/5/21/Thumpers</link>
				<description>
				
				Just received two of Sun&apos;s 24TB Sun Fire x4500 Thumper boxes! The plan (at least right now) is to run SMB and NFS shares so the folks in our media studios can actually put their info on something a bit more stable than the local macs. We have a triple-speed network switch between the Macs and our server room (though they I haven&apos;t seen any computers here that can actually handle data that fast), but it should be pretty zippy. We&apos;ll also be able to consolidate the storage (hopefully) of our institutional repository and staff file storage. 

We&apos;re also getting a 10Gig switch put in this December so we can surf Internet2 at super speed (or at least the folks working in the Integrated Graphics Lab will be able to send their jobs to the super computers faster)!  

&lt;img src=&quot;http://www.sun.com/images/k3/k3_sunfirex4500_1.jpg&quot; /&gt;
				
				</description>
						
				
				<category>Server</category>				
				
				<category>Solaris</category>				
				
				<pubDate>Wed, 21 May 2008 09:37:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/5/21/Thumpers</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Computer Graphics</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/4/17/Computer-Graphics</link>
				<description>
				
				As I mentioned in my last post, I&apos;ve been silent for a while. I&apos;ve had a major project in deploying some institutional repository software (&lt;a href=&quot;http://www.dspace.org&quot;&gt;DSpace&lt;/a&gt;) to collect the &lt;a href=&quot;http://dspace.swem.wm.edu&quot;&gt;research that students here at William and Mary&lt;/a&gt; are doing in a  systematic way. Generally this is deployed with more than one person...but you do what you need to do to finish a project ;)

The other major time consuming project has been my idea that taking computer graphics would be fun. Just a short footnote about me, I&apos;m a former historian who got into computers during graduate school. Anyway, the College hired John Van Rosendale, who among other things, funded NVidia to develop those wonderful drivers for Linux when he was at the NSF. I was pretty geeked about the class, and talked with John before the semester started. He said that while I didn&apos;t have the math background (his idea of &quot;basic math&quot; is advanced calculus and linear algebra) or the programming background (he wanted us to use C/C++), that I would just have to learn that stuff. 

Our first programming assignment (after about a month of linear algebra and vector math review) was to create a wireframe barn in OpenGL. This was the first time I had worked with C/C++ (most of my &quot;real&quot; programming has been in Java), so developing the Vector and Matrix classes to do all the perspective transformations took a little longer than I had expected. After that, generating views using OpenGL line primitives was a snap. 

All was good until I got to the second part of the assignment...a non-recursive ray tracer that implemented Gouraud and Phong lighting models on a pyramid. After several weeks of messing with the code and getting no where, I wanted to drop the course. John wouldn&apos;t let me, and got me through line-triangle intersections using barycentric coordinates. It didn&apos;t look like much at the time, really just a square, but it was a great (though very frustrating) introduction to ray-object intersections, coordinate systems, barycentric coordinate calculations, and lighting models.

Immediately after this, our first project was to implement from scratch, a recursive ray tracer that handled reflection, refraction, specular hightlights, and shading for a scene of spheres on a checkerboard floor. I got the specular highlights and shadows pretty quickly, but had a hard time with refraction (well, I guess I also had a problem with RGB because I was going from 0 to 255 instead of 0 to 1, but that was just a bug). 

When all was said and done, I learned a lot in this course and realized how brilliant folks like Ed Catmull (Pixar) are when they were inventing this stuff back in the 1970s!

Anyway, here are a couple of samples of the images I produced using my ray tracing engine. Each has has reflective and refractive surfaces with a maximum recursion depth of 5 with a cylinder texture-mapped with a sky image. Each image took just over a minute to render on a dual quad-core Xeon @ 3.2 GHz.

&lt;a href=&quot;http://swem.wm.edu/blogs/waynegraham/images/scene1.png&quot; border=&quot;0&quot;&gt;&lt;img src=&quot;http://swem.wm.edu/blogs/waynegraham/images/scene1-thumb.png&quot; /&gt;&lt;/a&gt;

&lt;a href=&quot;http://swem.wm.edu/blogs/waynegraham/images/scene2.png&quot; border=&quot;0&quot;&gt;&lt;img src=&quot;http://swem.wm.edu/blogs/waynegraham/images/scene2-thumb.png&quot; /&gt;&lt;/a&gt;
				
				</description>
						
				
				<category>graphics</category>				
				
				<pubDate>Thu, 17 Apr 2008 20:27:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/4/17/Computer-Graphics</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Bit Torrents</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/4/17/Bit-Torrents</link>
				<description>
				
				I&apos;ve been offline for a while (and there are a flurry of posts about that coming up), but I had a very strange thing happen yesterday. Earlier this year, I published the &lt;a href=&quot;http://apress.com/book/view/1430209690&quot;&gt;Facebook API Developer&apos;s Guide&lt;/a&gt;. It seems to be selling reasonably well on Amazon...even broke the top 100 computer books for a couple of days. 

Being it&apos;s a book on Facebook, I&apos;ve had a few folks add me as a friend and shoot me messages and ask some questions. It all seemed pretty cool, until yesterday. I got a note from a person in Tunisia who added me as a friend and asked a question. I sent a response thanking him for purchasing my book, and this is where I was a little taken aback. In fact, this was his exact response:

&lt;quote&gt;well, to be honest with you i got your book from a torrent site, i would have bought it if i wasnt living in Tunisia, I hope this won&apos;t affect anything :)&lt;/quote&gt;  

I didn&apos;t quite know what to say. He was nice enough to send the link to the torrent site, and apparently there are 41 seeders and 3 leechers. 

At first, I was thinking of trying to get the site to remove the link, but I&apos;ve been around long enough to know that doesn&apos;t really stop anything. I have say that I&apos;m still scratching my head on this one. I&apos;m not sure if I&apos;m flattered that there are people that think its worth stealing, offended that someone would under the pretense of purchasing my intellectual property ask a question (could have just asked, I&apos;m a pretty nice guy), or mad that he stiffed me a 20% commission on a book.

Still trying to figure this one out...
				
				</description>
						
				
				<category>Facebook</category>				
				
				<category>Copyright</category>				
				
				<pubDate>Thu, 17 Apr 2008 16:14:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/4/17/Bit-Torrents</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Facebook Developer API</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/3/18/Facebook-Developer-API</link>
				<description>
				
				It&apos;s been a long while since I posted anything here. Things have been a bit hectic with the launching of a new institutional repository service (using DSpace), taking a computer graphics course (linear algebra, ray tracing, scientific visualization, etc.), and finishing up my book on the &lt;a href=&quot;http://www.facebook.com/pages/Facebook-API-Developers-Guide/8672611380&quot;&gt;Facebook API&lt;/a&gt;. 

&lt;a href=&quot;http://www.amazon.com/gp/product/1430209690/&quot;&gt;
&lt;img src=&quot;http://ecx.images-amazon.com/images/I/51xMIn9ccGL._AA240_.jpg&quot; align=&quot;left&quot; border=&quot;0&quot;&gt;&lt;/a&gt;

This is the first book I&apos;ve written and I have to admit it was far more of a task than I had first thought it would be. Not that the subject matter was very dense, but there were at least four major changes in the API that required an almost total rewrite of the code base for the examples. There were even a couple of sections that had to get cut because Facebook &quot;fixed&quot; their code because of security and user concerns (plus a lot of folks &quot;abuse&quot; some of the things you could do with the API).  

There are some great Coldfusion resources for building Facebook applications in ColdFusion. The &quot;un-official&quot; ColdFusion client library for Facebook apps is at &lt;a href=&quot;http://www.nearpersonal.com/code/&quot;&gt;nearpersonal&lt;/a&gt;. There is also a RIAForge starter project for FBML (FBML is a tag based language for Facebook) named &lt;a href=&quot;http://fbmlstarter.riaforge.org/&quot;&gt;Facebook FBML Starter Kit&lt;/a&gt;.

So, if you&apos;re wanting a short book that highlights some of the more common elements of developing Facebook applications, be sure to check out my book!
				
				</description>
						
				
				<category>Facebook</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Tue, 18 Mar 2008 08:59:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2008/3/18/Facebook-Developer-API</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>SolColdfusion Update</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/31/SolColdfusion-Update</link>
				<description>
				
				I&apos;ve been knocked out by a really bad cold the last couple of weeks and I&apos;m just starting to get things back to normal. I did want to send a quick post on the status of the SolColdfusion project. After seeing Ray&apos;s Seeker project, it reminded me that I hadn&apos;t set up a project at RIAForge yet, so I took care of that last night. You can now access the official project at &lt;a href=&quot;http://solcoldfusion.riaforge.org/&quot;&gt;http://solcoldfusion.riaforge.org/&lt;/a&gt;.

Since the project site is up-and-running, I also submitted it to the Solr project &lt;a href=&quot;http://issues.apache.org/jira/browse/SOLR-404&quot;&gt;SOLR-404&lt;/a&gt; (I know it&apos;s a coincidence that it&apos;s number 404, but it makes me wonder if it&apos;s some type of bad omen ;) ...). Anyway, if you think the client should get included in the project, be sure to vote for it!

I&apos;ve also been working on a generic interface, much like Erik Hatcher&apos;s &lt;a href=&quot;http://wiki.apache.org/solr/Flare&quot;&gt;Solr Flare&lt;/a&gt;. It&apos;s been a bit slow coming as I&apos;ve not had a lot of time to work on these projects, but hopefully things will settle down shortly so I can devote a bit more time to them.
				
				</description>
						
				
				<category>Solr</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Wed, 31 Oct 2007 13:01:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/31/SolColdfusion-Update</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Solr Schema</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/5/Solr-Schema</link>
				<description>
				
				If you&apos;ve ever worked on a project that involved Coldfusion&apos;s bundled version of Verity, you&apos;ve no doubt run into the issue of trying to confine your fields into the structure that Verity imposes, and those custom fields are really precious in these instances. About 6 months ago, I ran into an issue with a search project where I had about 125,000 documents to index. Since we also wanted to be able to use the indexes for some other projects, I was a bit nervous to commit almost the entire allotment of indexable objects to one collection. This launched me into writing a custom search engine and indexer using Lucene and slapping Coldfusion around the responses to do things that Verity did. However, once the projects were complete, I never really got around to making it easy to use. It does cool stuff like search across multiple collections, context highlighting, relevancy calculations, term vector calculations, &quot;did you mean&quot;, etc. Essentially everything I think all good search engines need to be able to do. Something this system lacked was an easy way to define the fields that you wanted indexed (along with a knowledge of Java to actually make the changes). 

The ability to create any number of fields to index in different ways (along with faceting) is a real strong point of Solr. Not only can you add fields and choose how that data is analyzed, you can create your own field types that process the information in your index the way you want them to be. 

This is done in the $SOLR_HOME/config/schema.xml file. The first section (&amp;lt;types&gt;) defines the types of fields that you will be using, and how Solr should process them with Lucene. If you look at some of the fieldtypes, you&apos;ll get an idea of what&apos;s possible. For instance, the fieldtype for &quot;string&quot; is an untokenized field that doesn&apos;t normalize the fields and sorts missing information last. 

&lt;code&gt;
&lt;fieldtype name=&quot;string&quot; class=&quot;solr.StrField&quot; sortMissingLast=&quot;true&quot; omitNorms=&quot;true&quot;/&gt;
&lt;/code&gt;

However, if you need a more robust fieldtype, look at the fieldtype for &quot;text&quot;. This uses a whitespace tokenizer (splits words with whitespace) and uses the stopwords defined in the stopwords.txt file. It does some other processing (filters words, converts them to lowercase, runs a porter stemmer, and then removes duplicates). This fieldtype also defines what to do when a query is passed to it (uses the same filters). This is slightly different than the defined &quot;textTight&quot; which does not perform any further analysis on the text when being queried. You&apos;ll probably find that most of these work for most instances, but if you need to, you can build your own fieldtype that has very specific indexing and query filters.

The next section contains the actual fields you want to use in the aptly named &quot;fields&quot; element. This is where you actually define the fields that will be in your index, the type of analysis to perform on the field, if it should be indexed, stored, have term vectors, or be multivalued (have multiple instances of the same field in the index). 

Let&apos;s say you&apos;re wanting to develop an indexing schema for books (hey, I work in a library). At a very basic level, you&apos;d want a field for an id, title, author, reviews, and a set of topics (or tags). Your fields element would contain something along the lines of:

&lt;code&gt;
&lt;field name=&quot;id&quot; type=&quot;string&quot; indexed=&quot;true&quot; stored=&quot;true&quot;/&gt;
&lt;field name=&quot;title&quot; type=&quot;text&quot; indexed=&quot;true&quot; stored=&quot;true&quot; termVectors=&quot;true&quot; /&gt;
&lt;field name=&quot;titleStr&quot; type=&quot;string&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;true&quot;/&gt;
&lt;field name=&quot;author&quot; type=&quot;text&quot; indexed=&quot;true&quot; stored=&quot;true&quot;termVectors=&quot;true&quot; /&gt;
&lt;field name=&quot;authorStr&quot; type=&quot;string&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;true&quot;/&gt;
&lt;field name=&quot;review&quot; type=&quot;text&quot; indexed=&quot;true&quot; stored=&quot;true&quot; multiValued=&quot;true&quot;/&gt;
&lt;field name=&quot;topic&quot; type=&quot;text&quot; indexed=&quot;true&quot; stored=&quot;true&quot; multiValued=&quot;true&quot; termVectors=&quot;true&quot;/&gt;
&lt;field name=&quot;topicStr&quot; type=&quot;string&quot; indexed=&quot;true&quot; stored=&quot;false&quot; multiValued=&quot;true&quot;/&gt;
&lt;/code&gt;

You&apos;ll notice that I have a couple of extra fields for title, author, and topic, these are for the faceting info and are just untokenized fields to make the calculations for facets a little more efficient.

Now, we&apos;re almost done with creating the schema. We just need to declare a unique key, default search field, and default search operator. 

&lt;code&gt;
&lt;uniqueKey&gt;id&lt;/uniqueKey&gt;
&lt;defaultSearchField&gt;title&lt;/defaultSearchField&gt;
&lt;solrQueryParser defaultOperator=&quot;OR&quot;/&gt;
&lt;/code&gt;

Remember when I made the fields with the &quot;Str&quot; suffix? We can use a really cool feature of Solr called a &quot;copyField&quot; that literally copies the information from one field to another.

&lt;code&gt;
&lt;copyField source=&quot;author&quot; dest=&quot;authorStr&quot;/&gt;
&lt;copyField source=&quot;title&quot; dest=&quot;titleStr&quot;/&gt;
&lt;copyField source=&quot;topic&quot; dest=&quot;topicStr&quot;/&gt;
&lt;/code&gt;

It&apos;s worth mentioning here that Solr indexes are not databases! While there are some similarities in the way that Solr allows you to add, update, select, store, and delete information from the index, Solr isn&apos;t an RDBMS. I&apos;ve seen a few discussions where there is some confusion as to why Solr can&apos;t do the equivalent of a stored procedure, or some other function of a database. 

Now, your index server is ready to receive documents to search against. The server, in with the above example as the schema, will expect information to be in the following format:

&lt;code&gt;
&lt;doc&gt;
	&lt;field name=&quot;id&quot;&gt;1&lt;/field&gt;
	&lt;field name=&quot;title&quot;&gt;Solr Rocks!&lt;/field&gt;
	&lt;field name=&quot;author&quot;&gt;Barr, Foo&lt;/field&gt;
	&lt;field name=&quot;review&quot;&gt;This book rocks!&lt;/field&gt;
	&lt;field name=&quot;review&quot;&gt;This book is horrible!&lt;/field&gt;
	&lt;field name=&quot;topic&quot;&gt;information retrieval systems&lt;/field&gt;
	&lt;field name=&quot;topic&quot;&gt;xml&lt;/field&gt;
	&lt;field name=&quot;topic&quot;&gt;search&lt;/field&gt;
	&lt;field name=&quot;topic&quot;&gt;apache foundation&lt;/field&gt;
&lt;/doc&gt;
&lt;/code&gt;

Next week when I get some time, I&apos;ll write about creating facet queries...
				
				</description>
						
				
				<category>Apache</category>				
				
				<category>Solr</category>				
				
				<category>ColdFusion</category>				
				
				<category>XML</category>				
				
				<pubDate>Fri, 05 Oct 2007 13:27:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/5/Solr-Schema</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Solr and Coldfusion -- Setting Up</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/5/Solr-and-Coldfusion--Setting-Up</link>
				<description>
				
				To get up and running with Solr, you&apos;ll need some type of Servlet container. Typically when folks start talking about servlet containers, they&apos;re talking about &lt;a href=&quot;http://tomcat.apache.org/&quot;&gt;Tomcat&lt;/a&gt; or &lt;a href=&quot;http://jetty.mortbay.org/&quot;&gt;Jetty&lt;/a&gt;. In fact, Solr comes with Jetty 6.1.3 (they haven&apos;t upgraded to 6.1.5 yet in the distribution). You may also hear about &lt;a href=&quot;http://www.caucho.com/&quot;&gt;Resin&lt;/a&gt;, but in my experience, it runs a bit slower than Jetty and Tomcat. As a small note, servlet containers are different than J2EE application servers like JRun, Geronimo, GlassFish, and JBoss (which use servlet containers like Tomcat and Jetty, but also have EJB containers and can handle other types of logic). If you have a J2EE application server running, you can easily use Solr, and if not, consider using Jetty or Tomcat as your container server.

Since your environment can be as varied as there are IT departments, I won&apos;t try to cover everything. Essentially you need to have at least the Java 1.5 JRE. However, I would &lt;strong&gt;strongly&lt;/strong&gt; suggest the most current &lt;a href=&quot;http://java.sun.com&quot;&gt;Java JDK (and not the JRE)&lt;/a&gt; as it has performance enhancements to run in server mode (with -server). If you don&apos;t already have this Java version installed on your server (assuming this is the same server running CF), don&apos;t worry, ColdFusion will still work if you install the required Java runtime. 

Essentially the process for deploying Solr, once you have a servlet container up-and-running is to drop the solr.war file into the webapps directory on the server. It won&apos;t do anything at this point as you need to set the configuration files for Solr. The easiest way to do this is copy the files from example/solr into a new directory (which I will refer to now as solr_home). 

You can tell Java about the home directory by setting the solr.solr.home (-Dsolr.sol.home), set the JNDI lookup (&quot;java:comp/env/solr/home&quot;), or just throw it into the JVM&apos;s working directory (the default path is ./solr). Now you just need to make sure everything is running. Just point your browser to http://&amp;lt;server&gt;:&amp;lt;port&gt;/solr/admin. You should then see the administration interface (you may need to restart your servlet container to get everything working properly), but it&apos;s not an administrative interface like you get in CFAdmin. This is more of an informational administration panel. You can make sure everything is running, that there are documents in your index is set up properly, check out the schema and configuration files, and thread information. Really the only thing you can administer here is the log level. 

For some more specific notes on intalling Solr in &lt;a href=&quot;http://wiki.apache.org/solr/SolrTomcat&quot;&gt;Tomcat&lt;/a&gt; and &lt;a href=&quot;http://wiki.apache.org/solr/SolrJetty&quot;&gt;Jetty&lt;/a&gt;, check out &lt;a href=&quot;http://wiki.apache.org/solr/SolrInstall&quot;&gt;Solr&apos;s wiki&lt;/a&gt;. In particular, if you&apos;re going to need multiple instances of Solr to run, pay attention to the sections on Multipe Solr apps on those wiki pages.
				
				</description>
						
				
				<category>Apache</category>				
				
				<category>Solr</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Fri, 05 Oct 2007 12:22:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/5/Solr-and-Coldfusion--Setting-Up</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Coldfusion Solr Client - SolColdfusion</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/4/Coldfusion-Solr-Client--SolColdfusion</link>
				<description>
				
				As I hinted at yesterday, I was close to having some code in the pipeline to abstract using Solr. I&apos;ve finished the initial code with the following built in. Here&apos;s a brief setup guide to start playing with the code.

First, you&apos;re going to need to grab the latest &lt;a href=&quot;http://www.apache.org/dyn/closer.cgi/lucene/solr/&quot;&gt;release version of Solr (currently 1.2)&lt;/a&gt;. The only real requirement to run this software is that you have a JRE of 1.5 or higher. Untar/zip the file somewhere convenient and open a command prompt. Get to the example directory in the apache-solr.1.2.x folder (cd &lt;path_to_solr&gt;/example). To start up the sample server running Jetty, just issue the following command:

&lt;code&gt;
java -jar start.jar
&lt;/code&gt;

This will start a new instance of the Solr server on your computer on port 8983. You can make sure this is running by navigating to &lt;a href=&quot;http://localhost:8983/solr&quot;&gt;http://localhost:8983/solr&lt;/a&gt; (NOTE: this is a link to your computer. If you get an error, it&apos;s because your computer isn&apos;t running an instance of Solr on port 8983). 

At this point, it&apos;s probably good to send you over to the Solr website to take a look at &lt;a href=&quot;http://lucene.apache.org/solr/tutorial.html&quot;&gt;their tutorial&lt;/a&gt;. Go ahead. I&apos;ll wait...

...

Great, you&apos;re back. 

You&apos;ve seen some basic inserting, deleting, and querying of Solr index data. You may have also noticed that there are clients for PHP, Ruby, Python, and Java...no ColdFusion. I want to do a little more testing on this before I submit the patch, but I&apos;ve added the initial code as an encosure here to do updating, deleting, and searching in Coldfusion.

The CFC SolColdfusion should be in the path org/apache/client (at least that&apos;s where I&apos;m putting in for the purposes of this initial demonstration). The initialization takes one required parameter (the Solr host) and then has two optional parameters (port and path). 

To set this up, create an instance with

&lt;code&gt;
&lt;cfset solr = createObject(&quot;component&quot;, &quot;org.apache.solr.client.SolColdfusion&quot;).init(&quot;http://localhost&quot;, &quot;8983&quot;, &quot;/solr&quot;) /&gt;
&lt;/code&gt;

Now, there are a lot of different parameters you can send to Solr to perform different queries. And, since some of these key names can repeat, I chose to implement sending these parameters as an array. So, let&apos;s set this up.

&lt;code&gt;
&lt;cfset params = arrayNew(1) /&gt;

&lt;cfset params[1][1] = &quot;indent&quot;&gt;
&lt;cfset params[1][2] = &quot;on&quot; /&gt;
&lt;cfset params[2][1] = &quot;wt&quot;&gt;
&lt;cfset params[2][2] = &quot;standard&quot; /&gt;
&lt;cfset params[3][1] = &quot;fl&quot; /&gt;
&lt;cfset params[3][2] = &quot;*,score&quot; /&gt;
&lt;cfset params[4][1] = &quot;qt&quot; /&gt;
&lt;cfset params[4][2] = &quot;standard&quot; /&gt;
&lt;cfset params[5][1] = &quot;wt&quot; /&gt;
&lt;cfset params[5][2] = &quot;standard&quot; /&gt;
&lt;/code&gt;

These parameters are basically what are the defaults that Solr will return back to you. If you want highlighting, you would need to add two additional row vectors with &apos;hl = on&apos; and &apos;hl.fl = &lt;comma_seperated_fields_to_highlight&gt;&apos;. 

Searching is straight forward, taking a query, the start row, number of rows to return, and the array of parameters:

&lt;code&gt;
&lt;cfset results = solr.search(&quot;*:*&quot;, 0, 10, params) /&gt;
&lt;/code&gt;

This searches all fields and all content and returns back an XML document with the search results in it.

&lt;code&gt;
&lt;cfdump var=&quot;#results#&quot; /&gt;
&lt;/code&gt;

In the result node, you&apos;ll see that Solr returns an xmlAttribute of &lt;code&gt;numFound&lt;/code&gt; of 0 (assuming you don&apos;t have anything in the index). Let&apos;s add an example document from the documents that come with Solr.

&lt;code&gt;
&lt;!--- Create a new sample document ---&gt;
&lt;cfxml variable=&quot;sample&quot;&gt;
&lt;doc&gt;
  &lt;field name=&quot;id&quot;&gt;F8V7067-APL-KIT&lt;/field&gt;
  &lt;field name=&quot;name&quot;&gt;Belkin Mobile Power Cord for iPod w/ Dock&lt;/field&gt;
  &lt;field name=&quot;manu&quot;&gt;Belkin&lt;/field&gt;
  &lt;field name=&quot;cat&quot;&gt;electronics&lt;/field&gt;
  &lt;field name=&quot;cat&quot;&gt;connector&lt;/field&gt;
  &lt;field name=&quot;features&quot;&gt;car power adapter, white&lt;/field&gt;
  &lt;field name=&quot;weight&quot;&gt;4&lt;/field&gt;
  &lt;field name=&quot;price&quot;&gt;19.95&lt;/field&gt;
  &lt;field name=&quot;popularity&quot;&gt;1&lt;/field&gt;
  &lt;field name=&quot;inStock&quot;&gt;false&lt;/field&gt;
&lt;/doc&gt;
&lt;/cfxml&gt;

&lt;!--- add this document to the index ---&gt;
&lt;cfset solr.add(sample) /&gt;
&lt;cfset solr.commit() /&gt;
&lt;cfset solr.optimize() /&gt;

&lt;!--- search for the newly added document ---&gt;
&lt;cfset results = solr.search(&quot;id:F8V7067-APL-KIT&quot;, 0, 10, params) /&gt;

&lt;cfdump var=&quot;#xmlParse(results)#&quot; /&gt;
&lt;/code&gt;

You&apos;ll notice I used a commit and optmize statement. Neither of these statements are necessary every time you add a document, but be aware that Solr caches documents and won&apos;t flush the new documents to disk unless you either commit the documents or the mergefactor setting you used in your solrconfig.xml file has been reached. 

Now, let&apos;s delete this document...

&lt;code&gt;
&lt;cfset solr.deleteById(&quot;F8V7067-APL-KIT&quot;) /&gt;
&lt;cfset solr.commit() /&gt;
&lt;/code&gt;

Don&apos;t forget to commit deletions to the index!

There&apos;ll be more soon (add multiple documents, delete by queries). In the mean time, try it out. If you have any comments, questions, concerns, whatever, let me know.
				
				</description>
						
				
				<category>Apache</category>				
				
				<category>Solr</category>				
				
				<category>Lucene</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Thu, 04 Oct 2007 15:19:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/4/Coldfusion-Solr-Client--SolColdfusion</guid>
				
				<enclosure url="http://swem.wm.edu/blogs/waynegraham/enclosures/solColdfusion.tar.gz" length="4698" type="application/x-gzip"/>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion and Solr</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/3/ColdFusion-and-Solr</link>
				<description>
				
				I&apos;ve spent the last few months working on some projects that didn&apos;t really have anything to do with ColdFusion (lots of Java and PHP). One of the projects I&apos;ve been working with (&lt;a href=&quot;http://www.vufind.org&quot;&gt;Vufind.org&lt;/a&gt;) uses &lt;a href=&quot;http://lucene.apache.org/solr/&quot;&gt;Solr&lt;/a&gt; as it&apos;s indexing/search engine. That&apos;s starting to get picked up by some pretty big companies (Netflix just relaunched their search using Solr this week). 

I&apos;ve been working with Solr in Java for a bit now, and I wanted to start to build an interface for using it as a search engine (my Lucene code is stuck in open source limbo) in Coldfusion. One of the cool things about Solr is that it returns results back through HTTP (in XML, JSON, or ruby). 

As soon as I get the code finished, I&apos;ll post it as a patch in Solr.
				
				</description>
						
				
				<category>Lucene</category>				
				
				<category>Solr</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Wed, 03 Oct 2007 15:38:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/10/3/ColdFusion-and-Solr</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>JVM Settings</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/8/31/JVM-Settings</link>
				<description>
				
				I ran across this great &lt;a href=&quot;http://blogs.sun.com/watt/resource/jvm-options-list.html&quot;&gt;compilation of JVM settings&lt;/a&gt; for the different versions of Java. Very useful for Java tuning!
				
				</description>
						
				
				<category>Java</category>				
				
				<pubDate>Fri, 31 Aug 2007 08:24:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/8/31/JVM-Settings</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Facebook API</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/6/14/Facebook-API</link>
				<description>
				
				I&apos;ve been kind of silent here as I&apos;ve been trying to keep this  blog at least somewhat focused on ColdFusion and I&apos;ve been doing development in some different languages as of late (Java, PHP, and Ruby). However, when Facebook released their API for developers, my summer assistant Phil started hacking away at it and we&apos;ve released our first app for Facebook: &lt;a href=&quot;http://apps.facebook.com/swemtools/&quot;&gt;SwemTools&lt;/a&gt;.

It does a couple of things, provides a search interface for both the online catalog and our website, news feeds, hours, and a bit of a neat application based on &lt;a href=&quot;http://swem.wm.edu/services/swemsignal/&quot;&gt;Swem Signal&lt;/a&gt; that was created by &lt;a href=&quot;http://wm.facebook.com/profile.php?id=7605710&quot;&gt;Tom MacWright&lt;/a&gt;. 

We&apos;re still working on the code for the Signals part, but the idea is that on a map of the library, you&apos;d be able to see where your friends are. Right now, you can see a dot where your friends are, but not who they are...but we&apos;re working on a solution for it. 

Anyway, if you&apos;re on &lt;a href=&quot;http://www.facebook.com&quot;&gt;Facebook&lt;/a&gt;, check it out...you can add me as a friend too.
				
				</description>
						
				
				<category>Programming</category>				
				
				<category>Facebook</category>				
				
				<pubDate>Thu, 14 Jun 2007 10:41:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/6/14/Facebook-API</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Modern Takes on Classic Art</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/6/11/Modern-Takes-on-Classic-Art</link>
				<description>
				
				I&apos;m a big fan of Rene Magritte&apos;s work (I have &lt;a href=&quot;http://en.wikipedia.org/wiki/Image:MagrittePipe.jpg&quot;&gt;&lt;i&gt;La trahison des images&lt;/i&gt;&lt;/a&gt; hanging in my office). I &lt;a href=&quot;http://www.threadless.com/product/543/This_is_not_a_Pipe#zoom&quot;&gt;ran across this shirt&lt;/a&gt;, and I&apos;m sure that Magritte would appreciate the update to his work.
				
				</description>
						
				
				<category>Just for fun</category>				
				
				<pubDate>Mon, 11 Jun 2007 15:09:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/6/11/Modern-Takes-on-Classic-Art</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Fun with PDFs</title>
				<link>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/5/17/Fun-with-PDFs</link>
				<description>
				
				I&apos;ve been working with a lot of PDF files lately for a few different projects (see &lt;a href=&quot;http://swem.wm.edu/beta/flathat/&quot;&gt;The FlatHat&lt;/a&gt; and &lt;a href=&quot;http://swem.wm.edu/beta/cards/&quot;&gt;Card Catalog&lt;/a&gt;). With our special collections cards, when you got a result back, Acrobat viewer would blow up the image to around 600%, making for a rather ugly image. For the FlatHat, I really wanted to be able to open a PDF and have the search terms highlighted, so I started hunting for ways to actually do this.

I&apos;ve been using &lt;a href=&quot;http://www.pdfbox.org&quot;&gt;PDFBox&lt;/a&gt; to extract text from our PDFs to index with Lucene, so I started there and they clued me in to Adobe&apos;s &lt;a href=&quot;http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf&quot;&gt;PDF Open Parameters&lt;/a&gt;. This really killed a few birds with one stone. 

&lt;more /&gt;

When I was working on the Flat Hat newspaper, I was originally only returning back the page that the search result was on. I had some misgivings about this (like what if the story was on more than one page), but being able to pass the search query from the engine into the PDF is really nice since the user doesn&apos;t have to search through the entire issue to find the the context they are searching for (e.g. &lt;a href=&quot;http://swem.wm.edu/beta/flathat/issues/fh19440301.pdf#search=%22whistle%20bait%22&amp;zoom=125&quot;&gt;whistle bait&lt;/a&gt; -- when I saw that term, I cracked up; definitely a different era). 

Basically, the PDF Open Parameters allow you to pass commands into a PDF to allow you to control how the PDF is opened. They&apos;re passed with a &quot;#&quot; after the filename (e.g. filename.pdf#zoom=100). You can string commands together with an ampersand (&amp;) with a few caveats:

&lt;ol&gt;
	&lt;li&gt;only one digit after a decimal is retained&lt;/li&gt;
	&lt;li&gt;parameters and their values can only be 32 total characters long&lt;/li&gt;
	&lt;li&gt;you can&apos;t use reserved characters (=, #, and &amp;) to escape special characters&lt;/li&gt;
	&lt;li&gt;if you turn bookmarks off for a PDF that had bookmarks showing, they won&apos;t go away until the PDF has been rendered&lt;/li&gt;
&lt;/ol&gt;

Anyway, here are some examples of what you can do:

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#page=3&quot;&gt;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#page=3&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#page=3&amp;zoom=150,250,100&quot;&gt;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#page=3&amp;zoom=150,250,100&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#pagemode=thumbs&quot;&gt;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#pagemode=thumbs&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#page=4&amp;view=fitH,100&quot;&gt;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#page=4&amp;view=fitH,100&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#pagemode=none&quot;&gt;http://swem.wm.edu/beta/flathat/issues/fh19391031.pdf#pagemode=none&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
				
				</description>
						
				
				<category>Lucene</category>				
				
				<category>PDF</category>				
				
				<pubDate>Thu, 17 May 2007 17:12:00 -0500</pubDate>
				<guid>http://swem.wm.edu/blogs/waynegraham/index.cfm/2007/5/17/Fun-with-PDFs</guid>
				
			</item>
			
		 	
			</channel></rss>