Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: ruby-dev

Solr::Connection.add XML responses and Solr::Response::Xml

 

 

Lucene ruby-dev RSS feed   Index | Next | Previous | View Threaded


aaron at ktheory

Jun 12, 2007, 12:23 PM

Post #1 of 3 (1929 views)
Permalink
Solr::Connection.add XML responses and Solr::Response::Xml

Hi all,

The XML response that Solr returns after successfully adding documents
to the index appears to differ from the response solr-ruby expects.

Solr version 1.1 and 1.2 return the following XML snippet after
successfully indexing a document:

<result status="0"></result>

However, solr-ruby's Solr::Response::Xml class expects something along
the lines of:

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">2</int></lst>
</response>

(see the comments in solr/response/xml.rb)

Since Solr's XML response differs from what solr-ruby expects, the
Solr::Connection.add returns false, even though the document was
committed successfully.

While trying to track down where things diverged, I see the following
in Solr 1.1's changelog:

"The XML response format when adding multiple documents to the collection
in a single <add> command has changed to return a single <result>."

Is it a bug/misconfiguration on my part that Solr is returning
unexpected XML; or is solr-ruby expecting the wrong response?

Cheers,
Aaron Suggs


erik at ehatchersolutions

Jun 12, 2007, 1:37 PM

Post #2 of 3 (1840 views)
Permalink
Re: Solr::Connection.add XML responses and Solr::Response::Xml [In reply to]

Aaron,

I'm using the trunk version of Solr and getting this response from
posting one of the example files:

$ curl http://localhost:8983/solr/update --data-binary @solr.xml -H
'Content-type:text/xml;
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">26</int></lst>
</response>

Are you perhaps using an older solrconfig.xml file? Try using the
one from the Solr example configuration and see if that changes
things for you.

Erik



On Jun 12, 2007, at 3:23 PM, Aaron Suggs wrote:

> Hi all,
>
> The XML response that Solr returns after successfully adding documents
> to the index appears to differ from the response solr-ruby expects.
>
> Solr version 1.1 and 1.2 return the following XML snippet after
> successfully indexing a document:
>
> <result status="0"></result>
>
> However, solr-ruby's Solr::Response::Xml class expects something along
> the lines of:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">2</int></lst>
> </response>
>
> (see the comments in solr/response/xml.rb)
>
> Since Solr's XML response differs from what solr-ruby expects, the
> Solr::Connection.add returns false, even though the document was
> committed successfully.
>
> While trying to track down where things diverged, I see the following
> in Solr 1.1's changelog:
>
> "The XML response format when adding multiple documents to the
> collection
> in a single <add> command has changed to return a single <result>."
>
> Is it a bug/misconfiguration on my part that Solr is returning
> unexpected XML; or is solr-ruby expecting the wrong response?
>
> Cheers,
> Aaron Suggs


aaron at ktheory

Jun 12, 2007, 2:16 PM

Post #3 of 3 (1831 views)
Permalink
Re: Solr::Connection.add XML responses and Solr::Response::Xml [In reply to]

Ah. I did have something wrong in my solrconfig.xml. Namely, I needed
to add the line:

<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />

Thanks!

-Aaron

On 6/12/07, Erik Hatcher <erik[at]ehatchersolutions.com> wrote:
> Aaron,
>
> I'm using the trunk version of Solr and getting this response from
> posting one of the example files:
>
> $ curl http://localhost:8983/solr/update --data-binary @solr.xml -H
> 'Content-type:text/xml;
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">26</int></lst>
> </response>
>
> Are you perhaps using an older solrconfig.xml file? Try using the
> one from the Solr example configuration and see if that changes
> things for you.
>
> Erik
>
>
>
> On Jun 12, 2007, at 3:23 PM, Aaron Suggs wrote:
>
> > Hi all,
> >
> > The XML response that Solr returns after successfully adding documents
> > to the index appears to differ from the response solr-ruby expects.
> >
> > Solr version 1.1 and 1.2 return the following XML snippet after
> > successfully indexing a document:
> >
> > <result status="0"></result>
> >
> > However, solr-ruby's Solr::Response::Xml class expects something along
> > the lines of:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <response>
> > <lst name="responseHeader"><int name="status">0</int><int
> > name="QTime">2</int></lst>
> > </response>
> >
> > (see the comments in solr/response/xml.rb)
> >
> > Since Solr's XML response differs from what solr-ruby expects, the
> > Solr::Connection.add returns false, even though the document was
> > committed successfully.
> >
> > While trying to track down where things diverged, I see the following
> > in Solr 1.1's changelog:
> >
> > "The XML response format when adding multiple documents to the
> > collection
> > in a single <add> command has changed to return a single <result>."
> >
> > Is it a bug/misconfiguration on my part that Solr is returning
> > unexpected XML; or is solr-ruby expecting the wrong response?
> >
> > Cheers,
> > Aaron Suggs
>
>

Lucene ruby-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.