Geeks With Blogs
The Reluctant Blogger Blogging not because I have to, but because I want to

I spoke at CMAP’s monthly meeting last night on using the SOLR search service with your .NET application.  While a somewhat niche topic, a good crowd showed up and had a number of great questions.  I really enjoyed it and look forward to coming back to CMAP (probably their next code camp) and present again!

Slides

I’ve uploaded my slide deck to SlideShare.  Here’s the embedded slides and you can download the deck from there.

 

Sample Code

I’ve uploaded my code to GitHub.  You can get it from https://github.com/DavidHoerster/solrsearching .
I’ll also upload my configurations for the two collections (historicalQuotes and baseball) shortly.

 

Oops…Adding a Core

So in my excitement to present (or maybe it was all the caffeine), I forgot a simple step in setting up your Solr environment – creating a new collection.  It’s pretty simple to do, especially if you base your new collection on an existing one.

  • Let’s start with the default collection1 that’s present when you extract Solr.
  • Create a new directory at the same level as collection1 (probably under c:\solr\solr).  Call it baseball.
  • Copy the c:\solr\solr\collection1\conf directory to c:\solr\solr\baseball
  • Open c:\solr\solr\baseball\schema.xml in your favorite text editor and set the fields, dynamic fields, types and copyFields that you want baseball to have.  Don’t forget to set the <uniquekey> element, too!
  • Save the schema.xml file
  • Go to the Solr Admin UI and go to Core Admin
  • Select ‘Add Core’ and enter the relative path (under c:\solr\solr) for your new collection.  In our example, it’s ‘baseball’.  Also, name your collection (maybe baseballStats).  The other three fields should default fine (assuming you haven’t renamed your schema or config files).  Save it and the Admin UI should add the collection.  You can double-check everything went fine by refreshing your screen and selecting the baseballStats core from the dropdown and then select Schema Browser.  Make sure your fields are there. 
  • Now you can start adding data!

Overall I had a great time and I hope everyone got something out of some Solr searching at CMAP!  Thanks!!

Posted on Wednesday, August 7, 2013 7:58 AM User Group , C# , Architecture , ASP.NET MVC , SOLR | Back to top


Comments on this post: Do Some SOLR Searching…at CMAP

# re: Do Some SOLR Searching…at CMAP
Requesting Gravatar...
Hi David,
I attended your presentation. It was very good. Did you get a chance to upload your configuration files for the two collections you presented? thanks.
Left by Robert D on Oct 15, 2013 10:04 PM

Your comment:
 (will show your gravatar)


Copyright © David Hoerster | Powered by: GeeksWithBlogs.net