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 Brian_K <br...@theport.com> on 2009/06/17 18:01:06 UTC
POSTing to /select
Is it possible to query /select using http POST rather than GET? Is the
syntax different it so?
When I try, I receive an 500 response and a big fat exception.
java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:169)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:78)
at org.apache.solr.search.QParser.getQuery(QParser.java:131)
at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:91)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1290)
at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:341)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:244)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
Thanks!
Brian
--
View this message in context: http://www.nabble.com/POSTing-to--select-tp24076780p24076780.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: POSTing to /select
Posted by Brian_K <br...@theport.com>.
I did not have the content type set appropriately, to
application/x-www-form-urlencoded.
:wistle:
Erik Hatcher wrote:
>
>
> On Jun 17, 2009, at 12:01 PM, Brian_K wrote:
>
>>
>> Is it possible to query /select using http POST rather than GET? Is
>> the
>> syntax different it so?
>>
>> When I try, I receive an 500 response and a big fat exception.
>>
>> java.lang.NullPointerException
>> at java.io.StringReader.<init>(Unknown Source)
>> at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:
>> 169
>
> Yes, POST works fine... I think you just missed providing the q
> parameter, which is required in the most basic case.
>
> Erik
>
>
>
--
View this message in context: http://www.nabble.com/Re%3A-POSTing-to--select-tp24077130p24079690.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: POSTing to /select
Posted by Walter Underwood <wu...@netflix.com>.
On the other hand, POST is the wrong HTTP semantic for a search
request and makes it impossible to use HTTP caching. POST also makes
all your requests look identical in the HTTP logs, so you can't
do any log analysis.
If GET works, always use GET.
wunder
On 6/17/09 9:18 AM, "Erik Hatcher" <er...@ehatchersolutions.com> wrote:
>
> On Jun 17, 2009, at 12:01 PM, Brian_K wrote:
>
>>
>> Is it possible to query /select using http POST rather than GET? Is
>> the
>> syntax different it so?
>>
>> When I try, I receive an 500 response and a big fat exception.
>>
>> java.lang.NullPointerException
>> at java.io.StringReader.<init>(Unknown Source)
>> at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:
>> 169
>
> Yes, POST works fine... I think you just missed providing the q
> parameter, which is required in the most basic case.
>
> Erik
>
Re: POSTing to /select
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 17, 2009, at 12:01 PM, Brian_K wrote:
>
> Is it possible to query /select using http POST rather than GET? Is
> the
> syntax different it so?
>
> When I try, I receive an 500 response and a big fat exception.
>
> java.lang.NullPointerException
> at java.io.StringReader.<init>(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:
> 169
Yes, POST works fine... I think you just missed providing the q
parameter, which is required in the most basic case.
Erik