Hi Everyone I am using SolNet Api for using Solr in my .Net project.When I am
trying to index the data solr throws an *Error:The remote server returned an
error: (400) Bad Request.*
/* Stacktrace */ at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) in c:\prg\SolrNet\svn\SolrNet\Impl\SolrConnection.cs:line 104 at SolrNet.Commands.AddCommand`1.Execute(ISolrConnection connection) in c:\prg\SolrNet\svn\SolrNet\Commands\AddCommand.cs:line 60 at SolrNet.Impl.SolrBasicServer`1.Send(ISolrCommand cmd) in c:\prg\SolrNet\svn\SolrNet\Impl\SolrBasicServer.cs:line 87 at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd) in c:\prg\SolrNet\svn\SolrNet\Impl\SolrBasicServer.cs:line 91 at SolrNet.Impl.SolrBasicServer`1.AddWithBoost(IEnumerable`1 docs) in c:\prg\SolrNet\svn\SolrNet\Impl\SolrBasicServer.cs:line 74 at SolrNet.Impl.SolrServer`1.Add(IEnumerable`1 docs) in c:\prg\SolrNet\svn\SolrNet\Impl\SolrServer.cs:line 128 at Suvado.Solr.Common.SolrWrapper`1.UpdateItems(IEnumerable`1 items, Boolean commit) in D:\ArticleMgmt\ArticleMgmt\Suvado\Suvado.Solr.Common\SolrWrapper.cs:line 91 at Suvado.Solr.Indexing.ArticlesIndexingProcess.AddToSolr(IEnumerable`1 articlesToAdd) in D:\ArticleMgmt\ArticleMgmt\Suvado\Suvado.Solr.Indexing\ArticlesIndexingProcess.cs:line 148 at Suvado.Solr.Indexing.ArticlesIndexingProcess.RunInternal(DataGateway dataGateway) in D:\ArticleMgmt\ArticleMgmt\Suvado\Suvado.Solr.Indexing\ArticlesIndexingProcess.cs:line 82
* /Following is my cod/e *
*var Solr = ServiceLocator.Current.GetInstance<ISolrOperations&lt;T>>(typeof(T).Name + "_" + language);* *public ResponseHeader UpdateItems(IEnumerable<T> items, bool commit = false) { var result = Solr.Add(items); if (commit) Solr.Commit(); return result; }*
where *T is Article*
* /Article.cs/ * public class Article { [SolrUniqueKey] public long ArticleId{ get; set; }
[SolrField] public string Title { get; set; }
[SolrField] public string Description { get; set; }
[SolrField] public string ArticleURL { get; set; }
[SolrField] public string ImageURL { get; set; }
[SolrField] public string ArticleImageURL { get; set; }
[SolrField] public DateTime DateModified { get; set; }
[SolrField] public string Language { get; set; }
[SolrField] public string ArticleContent { get; set; }
public bool Deleted { get; set; }
}
Please find Schema for article_en here schema.xml <http://lucene.472066.n3.nabble.com/file/n4010417/schema.xml>
--
mihirhapaliya's gravatar image asked Sep 26 2012 at 06:21 in Lucene-Solr-User by mihirhapaliya

1 Answers

Check the Solr log. Most likely there's a mismatch between the fields in the Solr schema and the fields defined in your Article class. Also, please use the SolrNet mailing list for questions about SolrNet: https://groups.google.com/forum/?fromgroups#!forum/solrnet
-- Mauricio
On Wed, Sep 26, 2012 at 3:21 AM, mihirhapaliya Hi Everyone I am using SolNet Api for using Solr in my .Net project.When I > am > trying to index the data solr throws an *Error:The remote server returned > an > error: (400) Bad Request.* > > /* > Stacktrace > */ > at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) in > c:\prg\SolrNet\svn\SolrNet\Impl\SolrConnection.cs:line 104 > at SolrNet.Commands.AddCommand`1.Execute(ISolrConnection connection) in > c:\prg\SolrNet\svn\SolrNet\Commands\AddCommand.cs:line 60 > at SolrNet.Impl.SolrBasicServer`1.Send(ISolrCommand cmd) in > c:\prg\SolrNet\svn\SolrNet\Impl\SolrBasicServer.cs:line 87 > at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd) > in > c:\prg\SolrNet\svn\SolrNet\Impl\SolrBasicServer.cs:line 91 > at SolrNet.Impl.SolrBasicServer`1.AddWithBoost(IEnumerable`1 docs) in > c:\prg\SolrNet\svn\SolrNet\Impl\SolrBasicServer.cs:line 74 > at SolrNet.Impl.SolrServer`1.Add(IEnumerable`1 docs) in > c:\prg\SolrNet\svn\SolrNet\Impl\SolrServer.cs:line 128 > at Suvado.Solr.Common.SolrWrapper`1.UpdateItems(IEnumerable`1 items, > Boolean commit) in > D:\ArticleMgmt\ArticleMgmt\Suvado\Suvado.Solr.Common\SolrWrapper.cs:line 91 > at Suvado.Solr.Indexing.ArticlesIndexingProcess.AddToSolr(IEnumerable`1 > articlesToAdd) in > > D:\ArticleMgmt\ArticleMgmt\Suvado\Suvado.Solr.Indexing\ArticlesIndexingProcess.cs:line > 148 > at Suvado.Solr.Indexing.ArticlesIndexingProcess.RunInternal(DataGateway > dataGateway) in > > D:\ArticleMgmt\ArticleMgmt\Suvado\Suvado.Solr.Indexing\ArticlesIndexingProcess.cs:line > 82 > > > * > /Following is my cod/e > * > > *var Solr = > ServiceLocator.Current.GetInstance<ISolrOperations<T>>(typeof(T).Name + > "_" + language);* > *public ResponseHeader UpdateItems(IEnumerable<T> items, bool commit = > false) > { > var result = Solr.Add(items); > if (commit) > Solr.Commit(); > return result; > }* > > where *T is Article* > > * > /Article.cs/ > * > public class Article > { > [SolrUniqueKey] > public long ArticleId{ get; set; } > > [SolrField] > public string Title { get; set; } > > [SolrField] > public string Description { get; set; } > > [SolrField] > public string ArticleURL { get; set; } > > [SolrField] > public string ImageURL { get; set; } > > [SolrField] > public string ArticleImageURL { get; set; } > > [SolrField] > public DateTime DateModified { get; set; } > > [SolrField] > public string Language { get; set; } > > [SolrField] > public string ArticleContent { get; set; } > > public bool Deleted { get; set; } > > } > > Please find Schema for article_en here schema.xml > <http://lucene.472066.n3.nabble.com/file/n4010417/schema.xml> > > > > > > > -- >
Mauricio Scheffer's gravatar image answered Sep 27 2012 at 16:24 by Mauricio Scheffer

Related Discussions

  • Solr Exception "The Remote Server Returned An Error: (400) Bad Request." in Lucene-solr-user

  • Hi, I am having some difficulties knowing which one is the exception I am having my solrNet client as "The remote server returned an error: (400) Bad Request.". Internally Solr is actually printing the log issues like "undefined field fieldName". Do your have any idea about getting more detailed info into the http response? Thanks, Sergio View this message in context: http://lucene...

  • SimplePostTool: FATAL: Solr Returned An Error #400 Bad Request in Lucene-solr-user

  • Hi All Currently I am in a mid of a project which Index some data to Solrs multiple instance. I have the Configuration as, on the same machine I have made multiple instances of Solr http://localhost:8080/solr1 http://localhost:8080/solr2 http://localhost:8080/solr3 http://localhost:8080/solr4 http://localhost:8080/solr5 http://localhost:8080/solr6 Now when I am posting the Data ...

  • Why Error #400 Bad Request Somtimes Where I Add Doc To Solrcloud Collection? [scottchu] in Lucene-solr-user

  • I add doc by running post.jar with xml files but sometimes get error #400(Bad Request). At first, I doubt the xml files has problem but after I stop nodes and restart them. I add same doc again and it's successful. According post.jar output below, though NMLBOym_a_UN2004_07_20160511_1018.xml got error #400 but at last it commit the index change. However, it doesn't write the index successfully (I...

  • Problem In Execution Of Error Call In Ajax Request If Solr Server Is Not Running in Lucene-solr-user

  • *$.ajax({ url: solrURL+"/solr/db/select/?qt=dismax&wt=json&&start="+start+"&rows="+end+"&q="+query+"&json.wrf=?", async:false, dataType: 'json', success: function(){ getSolrResponse(sort,order,itemPerPage,showPage,query,solrURL); } ,error:function(){ alert("there is an error"); } })* ...

  • Error Loading A Custom Request Handler In Solr 4.0 in Lucene-solr-user

  • Hi, Apologies if this is really basic. I'm trying to learn how to create a custom request handler, so I wrote the minimal class (attached), compiled and jar'd it, and placed it in example/lib. I added this to solrconfig.xml: When I started Solr with java -jar start.jar, I got this: ... SEVERE: java.lang.NoClassDefFoundError: org/apache/solr/handler/RequestHandlerBase at java.lang....

  • SolrJ Question About Bad Request Root Cause Error in Lucene-solr-user

  • Hi All We are using SolrJ client (v 1.4.1) to integrate with our solr search server. We notice that whenever SolrJ request does not match with Solr schema, we get Bad Request exception which makes sense. org.apache.solr.common.SolrException: Bad Request But, SolrJ Client does not provide any clue about the reason request is Bad. Is there any way to get the root cause on client side? Of Course...

  • Deploying Solr5 In Jetty9 - Error "No Context On This Server Matched Or Handled This Request." ? in Lucene-solr-user

  • I'm trying a 1st deploy of Solr 5.0.0 in Jetty9 (jetty-distribution-9.2.9.v20150224). I've installed Jetty9 /etc/init.d/jetty check Checking arguments to Jetty: START_INI = /usr/local/etc/jetty/base/start.ini START_D = /usr/local/etc/jetty/base/start.d JETTY_HOME = /usr/local/jetty JETTY_BASE = /usr/local/etc/jetty/base JETTY_CONF = /usr/local/jetty/...

  • 'Error 404: Missing Core Name In Path' In Solr in Lucene-solr-user

  • I http://lucene.472066.n3.nabble.com/file/n3931194/Screenshot_%2847%29.png used //server.deleteByQuery( "*:*" );// CAUTION: deletes everything! query in my solr indexing program. Since then i am receiving the error whenever , i go to http://localhost:8080/solr/admin/ and press search with query string : The error is HTTP Status 400 - Missing solr core name in path type Status report message...

  • Seemingly Arbitrary Error On Document Adds To SolrCloud - "Server Error Request: Http://10.0.0.5:8443/solr/collection1/update?update.distrib=TOLEADER&distrib.from=..." in Lucene-solr-user

  • I'm adding dozens of documents every few minutes to a SolrCloud instance with 3 machines and ~ 25 million documents. I'm starting to see issues where adds are throwing these ugly errors that seem to indicate there might be some issues with the nodes communicating to one another. My posts are of the following form, but with about 30 fields rather than just 1: 112370241 And here is...

  • Solr 4.0 And Tomcat, Error In New Admin UI in Lucene-solr-user

  • Hi folks, i comment this issue : https://issues.apache.org/jira/browse/SOLR-3238 , but i want to ask here if anyone have the same problem. I use Solr 4.0 from trunk(latest) with tomcat6. I get an error in New Admin UI: This interface requires that you activate the admin request handlers, add the following configuration to your solrconfig.xml: Admin request Handlers are definitely activated...

  • Solr Authentication - Error 401 Unauthorized in Lucene-solr-user

  • I have secured solr cloud via basic authentication. Now I am having difficulties creating cores and getting status information. Solr keeps telling me that the request is unothorized. However, I have access to the admin UI after login. How do I configure solr to use the basic authentication credentials? This is the error message: /opt/solr-5.3.0/bin/solr status Found 1 Solr nodes: ...

  • Error While Indexing Data Using Solr (Unexpected Character 'F' (code 70) In Prolog; Expected '<') in Lucene-solr-user

  • Hello Everyone , I am getting an error while indexing data to solr. i am using solrj apis to index the document and using the xml request handler to index document. i am getting an error *org.apache.solr.common.SolrException: Unexpected character 'F' (code 70) in prolog; expected '...

  • Solr 4.2 Mechanism Proxy Request Error in Lucene-solr-user

  • Hi, I think that in solr 4.2 the new feature to proxy a request if the collection is not in the requested node has a bug. If I do a query with the parameter rows=0 and the node doesn't have the collection. If the parameter is rows=4 or superior then the search works as expected the curl returns The output of wget is: Connecting to 192.168.20.48:8983... connected. HTTP request sent, awaiting...

  • Tika And Solr 3,1 Integration Error in Lucene-solr-user

  • Hi I am trying to integrate solr 3.1 and tika (which comes default with the version) and using curl command trying to index few of the documents, i am getting this error. the error is attr_meta field is unknown. i checked the solrconfig, it looks perfect to me. can you please tell me what i am missing. I copied all the jars from contrib/extraction/lib to solr/lib folder that is there in same place...

  • Error With Distributed Search And Suggester Component (Solr 3.4) in Lucene-solr-user

  • Hi list, Does anybody know if the Suggester component is designed to work with shards? I'm asking because the documentation implies that it should (since ...Suggester reuses much of the SpellCheckComponent infrastructure…, and the SpellCheckComponent is documented as supporting a distributed setup). But when I make a request, I get an exception: java.lang.NullPointerException at org.apache....

  • Solr 1.3 - MySql - Commit One Greek Document, No Error But Nothing Showing Up By Request? in Lucene-solr-user

  • Hi everybody, I noticed that greek document wasn't there, so I tried to commit just one document and checked it, so I did a full import which inserted one document then I commit it manually, checked the log, no error. When I check my statistics I've : numDocs : 1, commits : 1. But then When I try to get back the document by a request, nothing come back : 8180/solr/video/select/?q=ALL Βίντεο ενός μεγάλου αθλητικού τύπου από ...

  • ERROR On Posting Update Request Using CURL In Php in Lucene-solr-user

  • Hi This is my document in php $xmldoc = 'F_14674gmail.com121sample.pptx'; $ch = curl_init("http://localhost:8080/solr/update"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml") ); curl_setopt($ch, CURLOPT_POSTFIELDS,$xmldoc); $result= ...

  • Lazy Loading Error In Extracting Request Handler in Lucene-solr-user

  • Hi, I am new to Solr and its configuration. I need to index some pdf files and for that reason I thought of using the extractingrequesthandler. I use Apache tomcat and run solr from it. I used the following command to index a pdf file. C:\Users\vikky\Downloads\curl-7.21.0-win64-nossl>curl.exe "http://localhost:8983/solr/update/extract?literal.id=doc4&uprefix=attr_&fma p.content=attr_content...

  • Bad Request (Solr + Weblogic + Oracle DB) in Lucene-solr-user

  • Hello all, I'm new to solr and I'm having a hard time trying to configure the schema.xml for a simple table. I'm using WebLogic with standard configs and Oracle Database. I have a simple table with the following fields Fase varchar Campo varchar Antes varchar Depois varchar Regras varchar My schema.xml is like this: My publish class in Java is like that: package br.com.trateme.solr...

  • Bad Request Accessing Solr On Linux in Lucene-solr-user

  • Hi, I am using solr 3.3 running on a linux box. For some reason when i make a request to solr on my windows box, i do not get bad request error but when i run it on my linux box, i get bad request. On the linux box, i have both my application and solr deployed on the same tomcat instance. Below is the error: Bad Request request: http://172.16.2.26:8080/solr/catalogue/select?q=paper&rows=10&start...

Facebook Google+ Twitter Linkedin
 Discussion Overview

 Group: Lucene-solr-user

 asked: Sep 26 2012 at 06:21

 active: Sep 27 2012 at 16:24

 posts: 2

 users: 2