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 BrendanD <br...@gmail.com> on 2007/10/10 21:20:36 UTC
start tag not allowed in epilog
Hi,
I've got an xml update document that I'm sending to solr's update handler
with deletes and adds in it. For example:
<delete><id>1234</id><id>5678</id></delete>
<add><doc>....</doc><doc>....</doc></add>
And I'm getting the following exception in the catalina.out log:
Oct 10, 2007 12:58:22 PM org.apache.solr.common.SolrException log
SEVERE: javax.xml.stream.XMLStreamException: ParseError at
[row,col]:[1,4003]
Message: start tag not allowed in epilog but got a
at com.bea.xml.stream.MXParser.parseEpilog(MXParser.java:2112)
at com.bea.xml.stream.MXParser.nextImpl(MXParser.java:1945)
at com.bea.xml.stream.MXParser.next(MXParser.java:1333)
at
org.apache.solr.handler.XmlUpdateRequestHandler.processUpdate(XmlUpdateRequestHandler.java:148)
at
org.apache.solr.handler.XmlUpdateRequestHandler.handleRequestBody(XmlUpdateRequestHandler.java:123)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:78)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:807)
at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:206)
Is this not allowed? I looked at the code in XmlUpdateRequestHandler.java
and it's dying on this line (148):
int event = parser.next();
Does anyone know how to correct this? Is it not possible to have multiple
different top-level tags in the same update xml file? It seems to me like it
should work, but perhaps there's something inherently bad about this from
the XMLStreamReader's point of view.
Thanks,
Brendan
--
View this message in context: http://www.nabble.com/start-tag-not-allowed-in-epilog-tf4602869.html#a13142631
Sent from the Solr - User mailing list archive at Nabble.com.
Re: start tag not allowed in epilog
Posted by BrendanD <br...@gmail.com>.
I've re-written the code to generate separate files. One for adds and one for
deletes. And this is working well for us now. Thanks.
Mike Klaas wrote:
>
>
> This would be very complicated from a standpoint of returning errors
> to the client.
>
> Keep in mind the <deletes> can never be batched, regardless. The
> only command that supports batching is <update> (and it is 1 <update>
> with multiple <doc>s, not multiple <update>s).
>
> If you keep a persistent connection open to solr, I don't see why one
> command per request should be limiting.
>
> Note also that you can batch on your end. If the deletes are doc
> ids, then you can collect a bunch at once and do
> <delete><query>id:xxx id:yyy id:zzz id:aaa id:bbb</query></delete> to
> perform them all at once.
>
> -Mike
>
>
--
View this message in context: http://www.nabble.com/start-tag-not-allowed-in-epilog-tf4602869.html#a13145693
Sent from the Solr - User mailing list archive at Nabble.com.
Re: start tag not allowed in epilog
Posted by Mike Klaas <mi...@gmail.com>.
On 10-Oct-07, at 12:49 PM, BrendanD wrote:
>
> We simply process a queue of updates from a database table. Some of
> the
> updates are deletes, some are adds. Sometimes you can have many
> deletes in a
> row, sometimes many adds in a row, and sometimes a mixture of
> deletes and
> adds. We're trying to batch our updates and were hoping to avoid
> having to
> manage separate files for adds and deletes.
>
> Perhaps a single top-level tag e.g. <update>....</update> could
> contain
> deletes and adds in the same document?
This would be very complicated from a standpoint of returning errors
to the client.
Keep in mind the <deletes> can never be batched, regardless. The
only command that supports batching is <update> (and it is 1 <update>
with multiple <doc>s, not multiple <update>s).
If you keep a persistent connection open to solr, I don't see why one
command per request should be limiting.
Note also that you can batch on your end. If the deletes are doc
ids, then you can collect a bunch at once and do
<delete><query>id:xxx id:yyy id:zzz id:aaa id:bbb</query></delete> to
perform them all at once.
-Mike
Re: start tag not allowed in epilog
Posted by BrendanD <br...@gmail.com>.
We simply process a queue of updates from a database table. Some of the
updates are deletes, some are adds. Sometimes you can have many deletes in a
row, sometimes many adds in a row, and sometimes a mixture of deletes and
adds. We're trying to batch our updates and were hoping to avoid having to
manage separate files for adds and deletes.
Perhaps a single top-level tag e.g. <update>....</update> could contain
deletes and adds in the same document?
Thanks,
Brendan
hossman wrote:
>
>
> it's inherently bad from the XML spec's point of view -- as in the XML
> spec says you can only have one "top level" tag per "XML document".
>
> incidently: what is your use case for even trying this? you kow that with
> a uniqueKey declaration you don't need to delete a doc before adding a new
> one withthe same uniqueKey right? ... you cna just add them all.
>
> we may/should allow you to specify multiple <id> or <query> blocks inside
> of a delete, but i don't imagine anyone is plannining on adding syntax to
> support <delete> and <add> ops in the same update command ... they are
> radically different.
>
>
> -Hoss
>
>
>
--
View this message in context: http://www.nabble.com/start-tag-not-allowed-in-epilog-tf4602869.html#a13143348
Sent from the Solr - User mailing list archive at Nabble.com.
Re: start tag not allowed in epilog
Posted by Chris Hostetter <ho...@fucit.org>.
: Does anyone know how to correct this? Is it not possible to have multiple
: different top-level tags in the same update xml file? It seems to me like it
: should work, but perhaps there's something inherently bad about this from
: the XMLStreamReader's point of view.
it's inherently bad from the XML spec's point of view -- as in the XML
spec says you can only have one "top level" tag per "XML document".
incidently: what is your use case for even trying this? you kow that with
a uniqueKey declaration you don't need to delete a doc before adding a new
one withthe same uniqueKey right? ... you cna just add them all.
we may/should allow you to specify multiple <id> or <query> blocks inside
of a delete, but i don't imagine anyone is plannining on adding syntax to
support <delete> and <add> ops in the same update command ... they are
radically different.
-Hoss