Thursday, March 22, 2012

Apache Solr and SolrNet quickstart, using the Netflix Dataset (Odata format)

Here is one quick tutorial to Send some movie data (netflix oData format) to solr for indexing, and do some basic querying.

Sample Dataset, http://odata.netflix.com/Catalog/
image

I picked up 5 fields and put them into the solr scheme.xml,
image

then add solrnet to your C# client, Define one POCO object used for the mapping. use the solrxxx attirbute will enable you bridge some naming conventions between solr schema and your C# obejct.

image

then use OData Helper, and Linq entitiy to load the data (using .net framework 4.0)
image

once it download the catalog, several parallel tasks will be created to post the data to solr for indexing, after done, you can see the data is there,

image

notes,
solrnet using the Microsoft.Practices.ServiceLocation.dll as a dependency to manage the object creation,
you can use nuget search Odata to download the Odata helper.

No comments:

 
Locations of visitors to this page