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 Scott K <so...@skister.com> on 2010/10/08 02:07:35 UTC

How do I get the solr error response as XML instead of HTML

solr errors come back as HTML instead of XM or JSON

Is it possible to get the response to come back as XML or JSON, or at
least something I could show to an end user?

Is there a way to tell solr to ignore unparseable terms and still
return a result, ideally with a warning so the end user doesn't get an
error page.


GET 'http://localhost:8983/solr/select/?q=term+OR&wt=xml'
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 400 org.apache.lucene.queryParser.ParseException: Cannot
parse 'term OR': Encountered "&lt;EOF&gt;" at line 1, column 7.
Was expecting one of:
    &lt;NOT&gt; ...
    "+" ...
    "-" ...
    "(" ...
    "*" ...
    &lt;QUOTED&gt; ...
    &lt;TERM&gt; ...
    &lt;PREFIXTERM&gt; ...
    &lt;WILDTERM&gt; ...
    &lt;REGEXPTERM&gt; ...
    "[" ...
    "{" ...
    &lt;NUMBER&gt; ...
    &lt;TERM&gt; ...
    "*" ...
    </title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /solr/select/. Reason:
<pre>    org.apache.lucene.queryParser.ParseException: Cannot parse
'term OR': Encountered "&lt;EOF&gt;" at line 1, column 7.
Was expecting one of:
    &lt;NOT&gt; ...
    "+" ...
    "-" ...
    "(" ...
    "*" ...
    &lt;QUOTED&gt; ...
    &lt;TERM&gt; ...
    &lt;PREFIXTERM&gt; ...
    &lt;WILDTERM&gt; ...
    &lt;REGEXPTERM&gt; ...
    "[" ...
    "{" ...
    &lt;NUMBER&gt; ...
    &lt;TERM&gt; ...
    "*" ...
    </pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>

Re: How do I get the solr error response as XML instead of HTML

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Scott,

Regarding unparseable terms - I think even edismaxc query parser is more 
forgiving that the standard one, but if that is not the case, one can always 
build a custom query parser that is more forgiving regarding invalid query 
string syntax.

Re HTML response - I'm guessing you are seeing something that looks like HTML to 
you in a browser.  It should be XML.  If it is not, please show us what you are 
seeing.

Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/



----- Original Message ----
> From: Scott K <so...@skister.com>
> To: solr-user@lucene.apache.org
> Sent: Thu, October 7, 2010 8:07:35 PM
> Subject: How do I get the solr error response as XML instead of HTML
> 
> solr errors come back as HTML instead of XM or JSON
> 
> Is it possible to get  the response to come back as XML or JSON, or at
> least something I could show  to an end user?
> 
> Is there a way to tell solr to ignore unparseable terms  and still
> return a result, ideally with a warning so the end user doesn't get  an
> error page.
> 
> 
> GET 'http://localhost:8983/solr/select/?q=term+OR&wt=xml'
> <html>
> <head>
> <meta  http-equiv="Content-Type" content="text/html;  charset=ISO-8859-1"/>
> <title>Error 400  org.apache.lucene.queryParser.ParseException: Cannot
> parse 'term OR':  Encountered "&lt;EOF&gt;" at line 1, column 7.
> Was expecting one  of:
>     &lt;NOT&gt; ...
>     "+" ...
>      "-" ...
>     "(" ...
>     "*" ...
>      &lt;QUOTED&gt; ...
>     &lt;TERM&gt;  ...
>     &lt;PREFIXTERM&gt; ...
>      &lt;WILDTERM&gt; ...
>     &lt;REGEXPTERM&gt;  ...
>     "[" ...
>     "{" ...
>      &lt;NUMBER&gt; ...
>     &lt;TERM&gt; ...
>      "*" ...
>      </title>
> </head>
> <body><h2>HTTP ERROR  400</h2>
> <p>Problem accessing /solr/select/.  Reason:
> <pre>     org.apache.lucene.queryParser.ParseException: Cannot parse
> 'term OR':  Encountered "&lt;EOF&gt;" at line 1, column 7.
> Was expecting one  of:
>     &lt;NOT&gt; ...
>     "+" ...
>      "-" ...
>     "(" ...
>     "*" ...
>      &lt;QUOTED&gt; ...
>     &lt;TERM&gt;  ...
>     &lt;PREFIXTERM&gt; ...
>      &lt;WILDTERM&gt; ...
>     &lt;REGEXPTERM&gt;  ...
>     "[" ...
>     "{" ...
>      &lt;NUMBER&gt; ...
>     &lt;TERM&gt; ...
>      "*" ...
>     </pre></p><hr  /><i><small>Powered by  Jetty://</small></i><br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> 
> </body>
> </html>
> 

Re: Can anyone compare Solr with Autonomy?

Posted by Tommaso Teofili <to...@gmail.com>.
Hi Scott,
I can say that in my experience I've seen a company dropping the Autonomy
solution in favour of Apache Solr :-)
It's not a comparison and nor a matter of better/worse but it can count when
evaluating how market is behaving regarding that.
Tommaso

2010/10/8 Otis Gospodnetic <ot...@yahoo.com>

> Scott,
>
> I doubt anyone (here or elsewhere) can give you a thorough and unbiased
> comparison.
>
> My suggestion is:
> 1) Figure out what functionality you need and what matters to you
> 2) Evaluate Solr with those requirements in mind.  Check with the list or
> an
> expert if you see/think that Solr can't do something from 1) or doesn't do
> it
> well
> 3) Move onto an evaluation of a commercial search solution if you are
> unhappy
> with the results you see in 2)
>
> Of course, we know 3) won't be needed - welcome to Solr! ;)
>
> Otis
> ----
> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> Lucene ecosystem search :: http://search-lucene.com/
>
>
>
> ----- Original Message ----
> > From: scott chu (朱炎詹) <sc...@udngroup.com>
> > To: solr-user@lucene.apache.org
> > Sent: Thu, October 7, 2010 10:41:56 PM
> > Subject: Can anyone compare Solr with Autonomy?
> >
> > Hi all,
> >    Does anyone know about these 2 systems & make a  siginificant
> comparison? My
> >compnay has intention to purchase Autonomy but it's  very very expensive?
> >
> > Best regards,
> >
> > Scott
> >
>

Re: Can anyone compare Solr with Autonomy?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Scott,

I doubt anyone (here or elsewhere) can give you a thorough and unbiased 
comparison.

My suggestion is:
1) Figure out what functionality you need and what matters to you
2) Evaluate Solr with those requirements in mind.  Check with the list or an 
expert if you see/think that Solr can't do something from 1) or doesn't do it 
well
3) Move onto an evaluation of a commercial search solution if you are unhappy 
with the results you see in 2)

Of course, we know 3) won't be needed - welcome to Solr! ;)

Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/



----- Original Message ----
> From: scott chu (朱炎詹) <sc...@udngroup.com>
> To: solr-user@lucene.apache.org
> Sent: Thu, October 7, 2010 10:41:56 PM
> Subject: Can anyone compare Solr with Autonomy?
> 
> Hi all,
>    Does anyone know about these 2 systems & make a  siginificant comparison? My 
>compnay has intention to purchase Autonomy but it's  very very expensive?
> 
> Best regards,
> 
> Scott 
> 

Can anyone compare Solr with Autonomy?

Posted by "scott chu (朱炎詹)" <sc...@udngroup.com>.
Hi all,
    Does anyone know about these 2 systems & make a siginificant comparison? 
My compnay has intention to purchase Autonomy but it's very very expensive?

Best regards,

Scott 


Re: How do I get the solr error response as XML instead of HTML

Posted by Lance Norskog <go...@gmail.com>.
You are using the standard parser. The Dismax parser is intended to
accept just about any input string and do something understandable
with it. Dismax is the usual parser for user queries, and Standard is
the usual for complex generated queries.

On Thu, Oct 7, 2010 at 5:07 PM, Scott K <so...@skister.com> wrote:
> solr errors come back as HTML instead of XM or JSON
>
> Is it possible to get the response to come back as XML or JSON, or at
> least something I could show to an end user?
>
> Is there a way to tell solr to ignore unparseable terms and still
> return a result, ideally with a warning so the end user doesn't get an
> error page.
>
>
> GET 'http://localhost:8983/solr/select/?q=term+OR&wt=xml'
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 400 org.apache.lucene.queryParser.ParseException: Cannot
> parse 'term OR': Encountered "&lt;EOF&gt;" at line 1, column 7.
> Was expecting one of:
>    &lt;NOT&gt; ...
>    "+" ...
>    "-" ...
>    "(" ...
>    "*" ...
>    &lt;QUOTED&gt; ...
>    &lt;TERM&gt; ...
>    &lt;PREFIXTERM&gt; ...
>    &lt;WILDTERM&gt; ...
>    &lt;REGEXPTERM&gt; ...
>    "[" ...
>    "{" ...
>    &lt;NUMBER&gt; ...
>    &lt;TERM&gt; ...
>    "*" ...
>    </title>
> </head>
> <body><h2>HTTP ERROR 400</h2>
> <p>Problem accessing /solr/select/. Reason:
> <pre>    org.apache.lucene.queryParser.ParseException: Cannot parse
> 'term OR': Encountered "&lt;EOF&gt;" at line 1, column 7.
> Was expecting one of:
>    &lt;NOT&gt; ...
>    "+" ...
>    "-" ...
>    "(" ...
>    "*" ...
>    &lt;QUOTED&gt; ...
>    &lt;TERM&gt; ...
>    &lt;PREFIXTERM&gt; ...
>    &lt;WILDTERM&gt; ...
>    &lt;REGEXPTERM&gt; ...
>    "[" ...
>    "{" ...
>    &lt;NUMBER&gt; ...
>    &lt;TERM&gt; ...
>    "*" ...
>    </pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
>
> </body>
> </html>
>



-- 
Lance Norskog
goksron@gmail.com

Re: How do I get the solr error response as XML instead of HTML

Posted by Chris Hostetter <ho...@fucit.org>.
: solr errors come back as HTML instead of XM or JSON
: 
: Is it possible to get the response to come back as XML or JSON, or at
: least something I could show to an end user?

At the moment, Solr just relies on the Servlet Container to generate the 
error response, so you'd have to customize it at that level to get it 
formatted in XML or JSON.

There is an open issue to make Solr generate the error responses directly 
so the ResponseWriters could format them (SOLR-141) but there hasn't been 
a lot of demand for it.

-Hoss