I'm using the solr net to try and upgrade our job searching to use lucene. The first code block works fine. However the 2nd block of code throws a 400 Bad Request exception on the line where I call solr.Add(jobs[i]); Anyone have any idea why? Thanks./**********this works*****************/static void Main(string[] args){new SolrBaseRepository.Instance<Job>().Start();var solr = ServiceLocator.Current.GetInstance<ISolrOperations<Job>>();var options = new QueryOptions{Rows = 10, Start = 0};var qry = new SolrQuery("*:*");foreach (var result in solr.Query(qry, options)){Console.WriteLine(result.PositionTitle);}Console.ReadLine();}/**********this doesn't work*****************/--static void Main(string[] args){var jobs = GetJobs();new SolrBaseRepository.Instance<Job>().Start();var solr = ServiceLocator.Current.GetInstance<ISolrOperations<Job>>();for (var i = 0; i < jobs.Count; i++){solr.Add(jobs[i]);if (i % 2 == 0)solr.Commit();}solr.Commit();solr.Optimize();Console.ReadLine();}
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To view this discussion on the web visit https://groups.google.com/d/msg/solrnet/-/bln9GfIye3gJ.
To post to this group, send email to sol...@googlegroups.com.
To unsubscribe from this group, send email to solrnet+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrnet?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/solrnet/-/mHfgcdpLnYsJ.
To view this discussion on the web visit https://groups.google.com/d/msg/solrnet/-/mHfgcdpLnYsJ.