You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Johnny X <jo...@gmail.com> on 2009/01/23 21:53:55 UTC

Issue indexing in Solr

I keep getting the error "FATAL: Solr returned an error: Bad Request"

Solr is running on a different port (8080) so I changed the command line
request to "java -Durl=http://localhost:8080/solr/update -jar post.jar
*.xml"

which seems to at least initiate.

"WARNING: Make sure your XML documents are encoded in UTF-8, other encodings
are not currently supported" appears, but I don't know if that's normal.
These XML files were generated using a library in dot net so I'm not sure,
but I'd guess they'd encode to UTF-8 by default?


My xml currently looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><add><doc><field
name="Message-ID">&lt;12929996.1075855668941.JavaMail.evans@thyme&gt;</field><field
name="Date">Mon, 31 Dec 1979 16:00:00 -0800 (PST)</field><field
name="From">phillip.allen@enron.com</field><field
name="To">muller@thedoghousemail.com</field><field name="Subject">Re: (No
Subject)</field><field name="Mime-Version">1.0</field><field
name="Content-Type">text/plain; charset=us-ascii</field><field
name="Content-Transfer-Encoding">7bit</field><field name="X-From">Phillip K
Allen</field><field name="X-To">muller@thedoghousemail.com</field><field
name="X-cc"></field><field name="X-bcc"></field><field
name="X-Folder">\Phillip_Allen_Dec2000\Notes Folders\All
documents</field><field name="X-Origin">Allen-P</field><field
name="X-FileName">pallen.nsf</field><field name="Content">
How is your racing going?  What category are you up to? 

I

</field></doc></add>


Would the "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" cause a
problem?

Also, on a side note, do I need a <commit/> in the last XML document, or
will Solr automatically commit after a set period post-indexing?


Thanks very much.


-- 
View this message in context: http://www.nabble.com/Issue-indexing-in-Solr-tp21632462p21632462.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue indexing in Solr

Posted by Jeff Newburn <jn...@zappos.com>.
The best way to find out what was wrong with the request is going to be the
web server logs.  It should throw an exception that usually complains about
fields missing or incorrect.

As to the committing solr has an autocommit option that will fire after a
designated amount of changes have been entered.  If you are planning on
updating a record here or there I would advise sending in the commit
yourself.  This process will ensure your data is what you intend it to be.
If you are planning on doing large amounts of commits then the autocommit is
probably a better bet.


On 1/23/09 12:53 PM, "Johnny X" <jo...@gmail.com> wrote:

> 
> I keep getting the error "FATAL: Solr returned an error: Bad Request"
> 
> Solr is running on a different port (8080) so I changed the command line
> request to "java -Durl=http://localhost:8080/solr/update -jar post.jar
> *.xml"
> 
> which seems to at least initiate.
> 
> "WARNING: Make sure your XML documents are encoded in UTF-8, other encodings
> are not currently supported" appears, but I don't know if that's normal.
> These XML files were generated using a library in dot net so I'm not sure,
> but I'd guess they'd encode to UTF-8 by default?
> 
> 
> My xml currently looks like this:
> 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><add><doc><field
> name="Message-ID">&lt;12929996.1075855668941.JavaMail.evans@thyme&gt;</field><
> field
> name="Date">Mon, 31 Dec 1979 16:00:00 -0800 (PST)</field><field
> name="From">phillip.allen@enron.com</field><field
> name="To">muller@thedoghousemail.com</field><field name="Subject">Re: (No
> Subject)</field><field name="Mime-Version">1.0</field><field
> name="Content-Type">text/plain; charset=us-ascii</field><field
> name="Content-Transfer-Encoding">7bit</field><field name="X-From">Phillip K
> Allen</field><field name="X-To">muller@thedoghousemail.com</field><field
> name="X-cc"></field><field name="X-bcc"></field><field
> name="X-Folder">\Phillip_Allen_Dec2000\Notes Folders\All
> documents</field><field name="X-Origin">Allen-P</field><field
> name="X-FileName">pallen.nsf</field><field name="Content">
> How is your racing going?  What category are you up to?
> 
> I
> 
> </field></doc></add>
> 
> 
> Would the "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" cause a
> problem?
> 
> Also, on a side note, do I need a <commit/> in the last XML document, or
> will Solr automatically commit after a set period post-indexing?
> 
> 
> Thanks very much.
>