tamaramata / solrnet

Automatically exported from code.google.com/p/solrnet
0 stars 0 forks source link

Commit should not send waitFlush to Solr 4 #172

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The waitFlush parameter on Commit is removed from solr 4. Calling .Commit() 
through SolrBasicServer throws an exception.

What steps will reproduce the problem?
1. Set up solr 4
2. Perform a .Commit() to the solr 4
3. Solr returns a status 400

What is the expected output? What do you see instead?
I would expect the Commit() to succeed, now I get an exception:
SolrNet.Exceptions.SolrConnectionException: Apache Tomcat/7.0.22 - Error report 

HTTP Status 400 - Unknown commit parameter 'waitFlush'
------------------------------------
type Status report

message Unknown commit parameter 'waitFlush'

description The request sent by the client was syntactically incorrect (Unknown 
commit parameter 'waitFlush').
------------------------------------
Apache Tomcat/7.0.22
---> System.Net.WebException: The remote server returned an error: (400) Bad 
Request. at System.Net.HttpWebRequest.GetResponse() at 
HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse() at 
SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request) at 
SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, 
Stream content, IEnumerable`1 parameters) --- End of inner exception stack 
trace --- at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String 
contentType, Stream content, IEnumerable`1 parameters) at 
SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) at 
SolrNet.Commands.CommitCommand.Execute(ISolrConnection connection) at 
SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd) at 
SolrNet.Impl.SolrBasicServer`1.Commit(CommitOptions options) at
...

Original issue reported on code.google.com by rjvdb...@gmail.com on 8 Feb 2012 at 3:13

GoogleCodeExporter commented 8 years ago
Fixed in 
https://github.com/mausch/SolrNet/commit/6bf640a8116fa187a5db82ee186173169b4776c
f , thanks!

Original comment by mauricio...@gmail.com on 9 Feb 2012 at 1:09

GoogleCodeExporter commented 8 years ago
Wow, that's a really fast response! Thanks

Original comment by rjvdb...@gmail.com on 9 Feb 2012 at 7:09

GoogleCodeExporter commented 8 years ago
Issue 198 has been merged into this issue.

Original comment by mauricio...@gmail.com on 13 Nov 2012 at 1:03

GoogleCodeExporter commented 8 years ago
Issue 203 has been merged into this issue.

Original comment by mauricio...@gmail.com on 2 Mar 2013 at 7:27

GoogleCodeExporter commented 8 years ago
Are you sure those duplicate issues filed are not new errors? I am seeing this 
error with Solr 4.1.0.2013.01.16.17.21.36 and Solrnet 0.4.0.

 Error: <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int 
name="QTime">1</int></lst><lst name="error"><str name="msg">Unknown commit 
parameter 'waitFlush'</str><int name="code">400</int></lst>
</response>
 -    at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters) in g:\prg\SolrNet\SolrNet\Impl\SolrConnection.cs:line 119
   at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) in g:\prg\SolrNet\SolrNet\Impl\SolrConnection.cs:line 84
   at SolrNet.Commands.CommitCommand.Execute(ISolrConnection connection) in g:\prg\SolrNet\SolrNet\Commands\CommitCommand.cs:line 76
   at SolrNet.Impl.SolrBasicServer`1.Send(ISolrCommand cmd) in g:\prg\SolrNet\SolrNet\Impl\SolrBasicServer.cs:line 96
   at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd) in g:\prg\SolrNet\SolrNet\Impl\SolrBasicServer.cs:line 106
   at SolrNet.Impl.SolrBasicServer`1.Commit(CommitOptions options) in g:\prg\SolrNet\SolrNet\Impl\SolrBasicServer.cs:line 58
   at SolrNet.Impl.SolrServer`1.Commit() in g:\prg\SolrNet\SolrNet\Impl\SolrServer.cs:line 211

Thanks,

Alvin

Original comment by alashcr...@gmail.com on 2 Apr 2013 at 7:18

GoogleCodeExporter commented 8 years ago
Alvin, yes. Please use the latest build from the build server: 
http://teamcity.codebetter.com/project.html?projectId=project36&guest=1

Original comment by mauricio...@gmail.com on 2 Apr 2013 at 8:28

GoogleCodeExporter commented 8 years ago
Thanks. Works like a charm. Do you plan on updating the NuGet package soon? I 
created a package in a local NuGet repository for the time being.

Original comment by alashcr...@gmail.com on 3 Apr 2013 at 11:29

GoogleCodeExporter commented 8 years ago
Alvin: see https://groups.google.com/d/msg/solrnet/DWHIgrJ3itw/VuBGkJB78E8J

Original comment by mauricio...@gmail.com on 3 Apr 2013 at 2:35

GoogleCodeExporter commented 8 years ago
Issue 206 has been merged into this issue.

Original comment by mauricio...@gmail.com on 17 Apr 2013 at 8:45

GoogleCodeExporter commented 8 years ago
Issue 209 has been merged into this issue.

Original comment by mauricio...@gmail.com on 7 Jun 2013 at 2:27

GoogleCodeExporter commented 8 years ago
Mauricio has posted a link from github, where it is stated that the problem 
with waitFlush is solved. Can anyone tell me how to integrate the new commit 
method, since i use SolrNet.dll and dont have the source code.

Original comment by martinva...@gmail.com on 13 Jun 2013 at 3:42

GoogleCodeExporter commented 8 years ago
Please use the latest build from the build server: 
http://teamcity.codebetter.com/project.html?projectId=project36&guest=1

Original comment by mauricio...@gmail.com on 13 Jun 2013 at 3:43

GoogleCodeExporter commented 8 years ago
Issue 216 has been merged into this issue.

Original comment by mauricio...@gmail.com on 15 Aug 2013 at 3:59

GoogleCodeExporter commented 8 years ago
https://github.com/mausch/SolrNet/blob/master/Documentation/FAQ.md#im-getting-a-
bad-request-error-when-calling-commit

Original comment by mauricio...@gmail.com on 27 Nov 2013 at 2:17

GoogleCodeExporter commented 8 years ago
Current Version is still in beta and isn't available in NuGet packages. Is 
there a plan to release stable version and NuGet package?

Original comment by kshivash...@gmail.com on 27 Mar 2014 at 5:15

GoogleCodeExporter commented 8 years ago
kshivasharana : see 
https://groups.google.com/d/msg/solrnet/DWHIgrJ3itw/VuBGkJB78E8J and 
https://github.com/mausch/SolrNet/blob/master/Documentation/README.md#downloads

Please people, read all the comments.

Original comment by mauricio...@gmail.com on 27 Mar 2014 at 3:04

GoogleCodeExporter commented 8 years ago
Fixed: use CommitCommand, set WaitFlush property = null.
I use solr 4.9.0 and solrnet 0.4.0.
Code:
SolrConnection conn = new SolrConnection(solrUrl);
Startup.Init<Article>(solrUrl);
SolrNet.Commands.CommitCommand Commit = new SolrNet.Commands.CommitCommand();
Commit.WaitFlush = null;
Commit.WaitSearcher = true;
var solrWorker = ServiceLocator.Current.GetInstance<ISolrOperations<Article>>();
IEnumerable<Article> ars = new ArticleRepository().GetArticles();            
solrWorker.AddRange(ars);            
Commit.Execute(conn); 

Original comment by manhcomp...@gmail.com on 12 Aug 2014 at 8:26