List Info

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




Solr::Connection.add XML responses and Solr::Response::Xml
user name
2007-06-12 14:23:56
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

Re: Solr::Connection.add XML responses and Solr::Response::Xml
country flaguser name
United States
2007-06-12 15:37:03
Aaron,

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

$ curl http://localhost:89
83/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


Re: Solr::Connection.add XML responses and Solr::Response::Xml
user name
2007-06-12 16:16:04
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 <erikehatchersolutions.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:89
83/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
>
>

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )