cfObjective 2011 Presentation: Advanced Solr - Going Beyond the Basics of cfsearch

Last month I gave my presentation on some advanced solr use with ColdFusion at cf.objective() 2011.

Sorry for posting my files so late. I always like to post detailed comments in each demo file (explaining what's going on and how I walked through my demonstrations). I just needed to find the time to sit down for a couple hours and write them up. I also cleaned up the code a little better (based on feedback from the audience afterward) and I also styled the pagination used in the last demo (as well as a few other minor styling touches here and there).

Make sure to view the readme.txt file in order to set it up correctly for use. Basically you just need to edit your solr.xml file and tell it where your collection files are (takes 2 min). Then after restarting solr the demo will start working. I explain this in more detail with troubleshooting tips as well in the readme.txt file.

Also please note that I purposefully used bad coding practices and tried to keep the code needed to review inside of each demo file so that it's easy to follow for all audiences (sorry, no frameworks here :).

Download the presentation demo files here (2.4MB zip file). I didn't bother with the slides since they pretty much just jump right into the demos.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Kurt Wiersma's Gravatar Thank you for posting this. I had been patiently waiting since I am about to work on project with Solr. The example code was very helpful to see the different options to pass to Solr.
#1 by Kurt Wiersma | 6/8/11 12:13 PM
Jeff Coughlin's Gravatar Thanks Kurt. There's actually much much more Solr can do. I've been reading a lot about it and playing around with lots of code samples. I submitted a topic to discuss it for the Adobe MAX CF Unconference. Hopefully it will be accepted. If not, I'll maybe do a recording presentation and more code samples in a couple months once I've wrapped my head around some more stuff.
#2 by Jeff Coughlin | 6/8/11 12:25 PM
Merritt Chapman's Gravatar Thanks Kurt. Looking forward to your Unconference session at MAX this year
#3 by Merritt Chapman | 7/5/11 12:08 AM
Mike's Gravatar Hi Jeff,

Thank you for the presentation. I have a couple of (hopefully not that stupid) questions:
1. If I want to use your example with other db structure I have to manually create the schema and solrconfig xml files and provide the columns in the table(s)
2. If I need to provide highlighted context how would I change the xml files

Thank you so much
#4 by Mike | 9/20/11 11:28 AM
Mike's Gravatar one more question:
do you have a quick example of how to index files (pdf, doc etc)

#5 by Mike | 9/20/11 2:11 PM
Jeff Coughlin's Gravatar @Mike,

1. Yes, you'll need to add the fields you want to the schema.xml (or use dynamic fields in the schema.xml).
2. For highlighting, you want to use the hl parameter (and you'll have to make a couple small changes to the code).
3. I don't have an example of indexing files for Solr 1.4.1, sorry. I do for Solr 3.5 though (which isn't much different). Under the hood Solr uses Tika. I don't like the way Solr uses it though (not very efficient with memory). Personally I've been using javaloader and loading Tika that way and passing the files to the file parser directly (this is helpful when sending batches of files to be parsed).
#6 by Jeff Coughlin | 4/11/12 8:39 AM

BlogCFC by Raymond Camden | RSS | Contact Blog Owner