"sort" throws exception

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

"sort" throws exception

Jack L

I'm using DisMaxRequestHandler and my queries seem to work fine.
I intended to add an option to sort on a "date" type field.
However, the moment I add sort, I get an exception (listed at the
bottom of this email.) Then I tried with "sort=score" and the
exception still happens. I'm sure it's due to my ignorance because
sort must be a well tested parameter. I wonder what I'm doing wrong?

The query with sort looks like this:
http://localhost:8983/solr/select?rows=10&qt=dismax&wt=python&q=car&sort=score

--
Best regards,
Jack


java.lang.ArrayIndexOutOfBoundsException: 1
        at org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:189)
        at org.apache.solr.util.SolrPluginUtils.getSort(SolrPluginUtils.java:787)
        at org.apache.solr.request.DisMaxRequestHandler.handleRequest(DisMaxRequestHandler.java:338)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:595)
        at org.apache.solr.servlet.SolrServlet.doGet(SolrServlet.java:92)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
        at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Reply | Threaded
Open this post in threaded view
|

Re: "sort" throws exception

Yonik Seeley-2
Try sort=score desc
Looks like we need some better error checking and more friendly error messages.

-Yonik

On 6/13/07, Jack L <[hidden email]> wrote:

>
> I'm using DisMaxRequestHandler and my queries seem to work fine.
> I intended to add an option to sort on a "date" type field.
> However, the moment I add sort, I get an exception (listed at the
> bottom of this email.) Then I tried with "sort=score" and the
> exception still happens. I'm sure it's due to my ignorance because
> sort must be a well tested parameter. I wonder what I'm doing wrong?
>
> The query with sort looks like this:
> http://localhost:8983/solr/select?rows=10&qt=dismax&wt=python&q=car&sort=score
>
> --
> Best regards,
> Jack
>
>
> java.lang.ArrayIndexOutOfBoundsException: 1
>         at org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:189)
>         at org.apache.solr.util.SolrPluginUtils.getSort(SolrPluginUtils.java:787)
>         at org.apache.solr.request.DisMaxRequestHandler.handleRequest(DisMaxRequestHandler.java:338)
>         at org.apache.solr.core.SolrCore.execute(SolrCore.java:595)
>         at org.apache.solr.servlet.SolrServlet.doGet(SolrServlet.java:92)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>         at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
>         at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>         at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>         at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
>         at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
>         at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>         at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>
>
Reply | Threaded
Open this post in threaded view
|

Re: "sort" throws exception

Chris Hostetter-3
In reply to this post by Jack L

: However, the moment I add sort, I get an exception (listed at the
: bottom of this email.) Then I tried with "sort=score" and the
: exception still happens. I'm sure it's due to my ignorance because
: sort must be a well tested parameter. I wonder what I'm doing wrong?

: java.lang.ArrayIndexOutOfBoundsException: 1

as yonik said, you need a sort direction ... but i'm curious which version
of Solr you are using, for as long as i can remmeber dismax has logged
Sort parsing errors but "ignored" them and returned results anyway using
the default sort.

StandardRequest handler on the other hand returns a 400 error page with
"Missing sort order." as the message (i thought that was in 1.1, but
aparently it wasn't official until 1.2)


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re[2]: "sort" throws exception

Jack L
Hello Chris,

I'm using version 1.1.

If I'm only using 1.1 features, should I still try 1.2 for other
improvements such as stability, error handling, etc.?

--
Best regards,
Jack

Wednesday, June 13, 2007, 12:23:35 PM, you wrote:


> : However, the moment I add sort, I get an exception (listed at the
> : bottom of this email.) Then I tried with "sort=score" and the
> : exception still happens. I'm sure it's due to my ignorance because
> : sort must be a well tested parameter. I wonder what I'm doing wrong?

> : java.lang.ArrayIndexOutOfBoundsException: 1

> as yonik said, you need a sort direction ... but i'm curious which version
> of Solr you are using, for as long as i can remmeber dismax has logged
> Sort parsing errors but "ignored" them and returned results anyway using
> the default sort.

> StandardRequest handler on the other hand returns a 400 error page with
> "Missing sort order." as the message (i thought that was in 1.1, but
> aparently it wasn't official until 1.2)


> -Hoss

Reply | Threaded
Open this post in threaded view
|

Re: "sort" throws exception

Ryan McKinley
Jack L wrote:
> Hello Chris,
>
> I'm using version 1.1.
>
> If I'm only using 1.1 features, should I still try 1.2 for other
> improvements such as stability, error handling, etc.?
>

If you can upgrade, it is highly recommended.  There are lots of little
annoying fixes included in 1.2 -- in addition to lucene performance
improvements.

I think i posted this same question in january...