Hello,

Yonik and Jeff thank you for your help.
You are right this was content-type issue.

in order to run example  following things need to be done:

1.Code (SolrSharp) should be changed
from:
src\Configuration\SolrSearcher.cs(217): oRequest.ContentType = "application/x-www-form-urlencoded";
to:
src\Configuration\SolrSearcher.cs(217): oRequest.ContentType = "text/xml";

2. In order take care of the solr 1.2 schema invalidation issue:
schema.xml
comment line: 265
<!-- <field name="word" type="string" indexed="true" stored="true"/>-->
comment line: 279
<!-- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>-->
or as Jeff suggested:
   For the example code, adding the "timestamp" field in the
   ExampleIndexDocument public constructor such as:
this.Add(new IndexFieldValue("timestamp", DateTime.Now.ToString("s")+"Z")));

Regards
Michael




----- Original Message ----- From: "Jeff Rodenburg" <[EMAIL PROTECTED]>
To: <solr-user@lucene.apache.org>
Sent: Wednesday, June 20, 2007 1:56 PM
Subject: Re: SolrSharp example


On 6/20/07, Yonik Seeley <[EMAIL PROTECTED]> wrote:

On 6/20/07, Michael Plax <[EMAIL PROTECTED]> wrote:
> This is a log that I got after runnning SolrSharp example. I think
example
> program posts not properly formatted xml.
> I'm running Solr on Windows XP, Java 1.5. Are those settings could be
the
> problem?

Solr1.2 is pickier about the Content-type in the HTTP headers.
I bet it's being set incorrectly.



Ahh, good point.  Within SolrSearcher.cs, the WebPost method contains this
setting:

oRequest.ContentType = "application/x-www-form-urlencoded";

Looking through the CHANGES.txt file in the 1.2 tagged release on svn:

9. The example solrconfig.xml maps /update to XmlUpdateRequestHandler using the new request dispatcher (SOLR-104). This requires posted content to have
a valid contentType: curl -H 'Content-type:text/xml; charset=utf-8'.  The
response format matches that of /select and returns standard error codes. To
enable solr1.1 style /update, do not map "/update" to any handler in
solrconfig.xml (ryan)

For SolrSearcher.cs, it sounds as though changing the ContentType setting to
"text/xml" may fix this issue.

I don't have a 1.2 instance to test this against available to me right now,
but can check this later.  Michael, try updating your SolrSearcher.cs file
for this content-type setting to see if that resolves your issue.


thanks,
jeff r.


Reply via email to