tag:blogger.com,1999:blog-43347204105032206462024-03-13T13:52:31.829+01:00(yacb) yet another coders blogKlaashttp://www.blogger.com/profile/06025335251387584971noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4334720410503220646.post-62888200139072246732011-06-24T13:44:00.000+02:002011-06-24T13:44:03.646+02:00SolrNet 0.4.0 alpha releasedThere is a new release of SolrNet (in alpha at this moment), it is version 0.4.0.<br />
<br />
<b>New features</b><br />
<br />
Solr 4.0 grouping (this used to be called "field collapsing", but was completely overhauled)<br />
Solr 4.0 pivot faceting<br />
SolrQueryByDistance (spatial search)<br />
Support for ExtractingRequestHandler (i.e. document indexing, like MS Word, PDF, etc)<br />
Rollback (it was implemented but missing in ISolrOperations)<br />
CommitWithin and Overwrite parameters for document add<br />
Mixed exclusive/inclusive range queries (Solr 4.0 only)<br />
<br />
<br />
<a href="http://bugsquash.blogspot.com/2011/06/solrnet-040-alpha-1-released.html">See here the release message from Maurico</a>Klaashttp://www.blogger.com/profile/06025335251387584971noreply@blogger.com0tag:blogger.com,1999:blog-4334720410503220646.post-42325757269153141912011-06-08T12:15:00.003+02:002011-06-08T18:57:50.132+02:00Pivot tables in SolrNetPivoting support is now available for SolrNet.<br />
<br />
Here is an example how to use the pivot tables feature within Solr using SolrNet.<br />
<span style="font-style:italic;font-size:small">To use it download the current source code of SolrNet from <a href="https://github.com/mausch/SolrNet">github</a>. (select the master branch)</span><br />
<pre class="brush: csharp">var url = "someurlwhereyoursolrisrunning";
Startup.Init<Model.doc>(url);
var solr = ServiceLocator.Current.GetInstance();
//Create a facet Pivot Query
var facetPivotQuery = new SolrFacetPivotQuery()
{
//Define 2 pivots, one for inStock subgrouped by cat and
//one for manu_exact subgrouped by cat
Fields = new[] {
"inStock,cat",
"manu_exact,cat"
},
//Set the minCount to 1
MinCount = 1
};
//Create the facet parameters
//Note that you can use pivotQueries together
//with other facets queries
var facetParams = new FacetParameters()
{
Queries = new[] { facetPivotQuery },
//Limit the amounts of pivotRows to 15
Limit = 15
};
var queryOptions = new QueryOptions();
queryOptions.Facet = facetParams;
queryOptions.Rows = 0;
var results = solr.Query("ipod", queryOptions);
if (results.FacetPivots.Count > 0)
{
foreach (var pivotTable in results.FacetPivots)
{
Console.WriteLine(String.Format("Pivot {0}, has {1} childgroups",
pivotTable.Key,
pivotTable.Value.Count.ToString()));
}
}
</pre>Klaashttp://www.blogger.com/profile/06025335251387584971noreply@blogger.com1tag:blogger.com,1999:blog-4334720410503220646.post-18032853590208805102011-06-06T19:25:00.013+02:002011-06-08T16:04:59.489+02:00SolrNet Grouping exampleGrouping and Pivoting support is now available for SolrNet.<br />
<br />
Here is an example how to use the grouping feature within SolrNet.<br />
<span style="font-style:italic;font-size:small">To use it download the current source code of SolrNet from <a href="https://github.com/mausch/SolrNet">github</a>. (select the master branch)</span><br />
<pre class="brush: csharp">var url = "someurlwhereyoursolrisrunning";
Startup.Init<Model.doc>(url);
var solr = ServiceLocator.Current.GetInstance<ISolrOperations<Model.doc>>();
var groupingParams = new GroupingParameters();
//Set the output groups, this means the output will have 2 groups
//one group for popularity and one for manu_exact
//these two groups are not nested
groupingParams.Fields = new[] { "popularity", "manu_exact" };
//Set the output format to grouped
groupingParams.Format = GroupingFormat.Grouped;
var queryOptions = new QueryOptions();
//Set count of how many groups you want to return
queryOptions.Rows = 20;
//Add the grouping parameters
queryOptions.Grouping = groupingParams;
//Set sorting of the groups on the field popularity
queryOptions.OrderBy = new[] { new SortOrder("popularity", Order.DESC) };
//Execute the query
var results = solr.Query("ipod", queryOptions);
//Examine the results
if (results.Grouping.Count > 0)
{
foreach (var group in results.Grouping)
{
Console.WriteLine(String.Format("Group {0}, has {1} subgroups",
group.Key,
group.Value.Groups.Count.ToString()));
}
}
</pre>Klaashttp://www.blogger.com/profile/06025335251387584971noreply@blogger.com1tag:blogger.com,1999:blog-4334720410503220646.post-58425421005756486662011-06-06T11:39:00.006+02:002011-06-06T19:43:55.258+02:00Grouping and Pivoting in SolrNetGrouping and Pivoting support is now available for <a href="http://code.google.com/p/solrnet/">SolrNet</a>. To use it download the current (master branch) source code of SolrNet from <a href="https://github.com/mausch/SolrNet">github</a>.Klaashttp://www.blogger.com/profile/06025335251387584971noreply@blogger.com0