You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2006/04/05 22:43:45 UTC
[jira] Created: (SOLR-7) can't post queries
can't post queries
------------------
Key: SOLR-7
URL: http://issues.apache.org/jira/browse/SOLR-7
Project: Solr
Type: Bug
Reporter: Yonik Seeley
Priority: Minor
One can't currently post a query (must be an http-get).
The same servlet handles /update and /select, and the doPost method always treats the request as an update.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Re: [jira] Created: (SOLR-7) can't post queries
Posted by Chris Hostetter <ho...@fucit.org>.
: > On 4/5/06, Erik Hatcher <er...@ehatchersolutions.com> wrote:
: >> How about leveraging HTTP 1.1 methods more semantically, such that a
: >> PUT is used for an insert perhaps, and a DELETE for a delete, and GET
: >> for searches. POST is fine for update semantics.
i was thinking about th PUT/POST distinction for udpates/adds a while back
-- but i convinced myself that POST made more sense for updates because
the WebDav/REST mentality of PUT is that PUTing to a same URL twice with
different content should replace the content -- unless we start having
update URLs where the uniqueKey field is in the URL, we aren't really
living up to the "PUT" expectation (not to mention the cases where people
don't use uniqueKey in their index, or want to update multiple docs at a
time)
i also realized that except for the people who are really gung-ho about
REST, many people don't understand PUT and DELETE .. there are even some
HTTP client libraries out there that either don't support them or make
them hard to do.
so while i like the idea of supporting PUT/DELETE, i'm not certain what
the logical semanics should be, and i think the existing POST/GET behavior
should definitley remain as is with support for POSTing queries added (so
plugins that want to take in large amounts of input can efficiently)
: In my copious free time* I will eventually create, unless someone
: beats me to it, a Ruby library to wrap the interface to Solr making
: it easily palatable to the flood of Rails applications out there that
: need what Solr offers.
go hard dude.
: Additionally, supporting the OpenSearch API would be a fantastic
: addition to Solr as well. This is one area I might be actually
: tinkering with in the coming weeks/months.
I mentioned a while back, this may be entirely possible using an XSLT (and
perhaps a custom plugin for complex query parsing) your milage may vary...
http://www.mail-archive.com/solr-dev@lucene.apache.org/msg00130.html
-Hoss
Re: [jira] Created: (SOLR-7) can't post queries
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 5, 2006, at 9:17 PM, Yonik Seeley wrote:
> On 4/5/06, Erik Hatcher <er...@ehatchersolutions.com> wrote:
>> How about leveraging HTTP 1.1 methods more semantically, such that a
>> PUT is used for an insert perhaps, and a DELETE for a delete, and GET
>> for searches. POST is fine for update semantics.
>
> Sounds like a great idea!
> Would that also allow us to slap on the fashionable "REST" label? ;-)
Well, loosely speaking Solr already is a RESTful application as it
speaks plain ol' HTTP with lightweight XML using GET/POST. And, in
fact, this is what will make Solr a very popular tool I think.
In my copious free time* I will eventually create, unless someone
beats me to it, a Ruby library to wrap the interface to Solr making
it easily palatable to the flood of Rails applications out there that
need what Solr offers.
Erik
Re: [jira] Created: (SOLR-7) can't post queries
Posted by Yonik Seeley <ys...@gmail.com>.
On 4/5/06, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> How about leveraging HTTP 1.1 methods more semantically, such that a
> PUT is used for an insert perhaps, and a DELETE for a delete, and GET
> for searches. POST is fine for update semantics.
Sounds like a great idea!
Would that also allow us to slap on the fashionable "REST" label? ;-)
-Yonik
Re: [jira] Created: (SOLR-7) can't post queries
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
How about leveraging HTTP 1.1 methods more semantically, such that a
PUT is used for an insert perhaps, and a DELETE for a delete, and GET
for searches. POST is fine for update semantics.
Additionally, supporting the OpenSearch API would be a fantastic
addition to Solr as well. This is one area I might be actually
tinkering with in the coming weeks/months.
By the way, Solr rocks! Nice work, gang. Solr is going to be quite
de facto in the near future for search integration, I feel it :)
Erik
On Apr 5, 2006, at 4:43 PM, Yonik Seeley (JIRA) wrote:
> can't post queries
> ------------------
>
> Key: SOLR-7
> URL: http://issues.apache.org/jira/browse/SOLR-7
> Project: Solr
> Type: Bug
>
> Reporter: Yonik Seeley
> Priority: Minor
>
>
> One can't currently post a query (must be an http-get).
> The same servlet handles /update and /select, and the doPost method
> always treats the request as an update.
>
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the
> administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Chris Hostetter <ho...@fucit.org>.
: There is a ServletContextListener that can be registered in web.xml
: as a <listener>. This existed in Servlet 2.3 also.
Ah .. i see, I new about listeners, i just didn't realize how varied they
are (i wasn't aware of ServletContextListener at all).
-Hoss
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 6, 2006, at 3:41 PM, Chris Hostetter wrote:
> Erik: Are you just talking about using <load-on-startup> for a
> servlet, or is there some other recent addition to he Servlet spec for
> registering an arbitrary class that should be constructed once per
> application with init/destroy methods that should be called
> appropriately
> ... i can't seem to find anything like that (other then making a
> servlet
> with no path mapping)
There is a ServletContextListener that can be registered in web.xml
as a <listener>. This existed in Servlet 2.3 also.
Erik
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Yoav Shapira <yo...@apache.org>.
The ServletContextListener is better solution. Besides being more
elegant and independent of the actual load order of servlets, it has
one key advantage. The servlet container is free to destroy and
recreate (thus re-initializing) load-on-startup servlets as it sees
fit, just the same as any other servlet, so your load-on-startup init
code is NOT guaranteed to run just once in the lifetime of the server.
Yoav
On 4/6/06, Yonik Seeley <ys...@gmail.com> wrote:
> On 4/6/06, Chris Hostetter <ho...@fucit.org> wrote:
> > I acctaully thought we were using load-on-startup ... I can't for the life
> > of me figure out why autowarming works since we don't have load-on-startup
> > set to 1.
>
> We have it set to 0, meaning it load before 1 (the number is a load
> order, not true/false)
>
> -Yonik
>
--
Yoav Shapira
Nimalex LLC
1 Mifflin Place, Suite 310
Cambridge, MA, USA
yoavs@computer.org / www.yoavshapira.com
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Yonik Seeley <ys...@gmail.com>.
On 4/6/06, Chris Hostetter <ho...@fucit.org> wrote:
> I acctaully thought we were using load-on-startup ... I can't for the life
> of me figure out why autowarming works since we don't have load-on-startup
> set to 1.
We have it set to 0, meaning it load before 1 (the number is a load
order, not true/false)
-Yonik
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Chris Hostetter <ho...@fucit.org>.
: We should be able to use <load-on-startup> for the servlet that is
: responsible for
: making the core in both Servlet 2.3 and 2.4.
I acctaully thought we were using load-on-startup ... I can't for the life
of me figure out why autowarming works since we don't have load-on-startup
set to 1.
For me it was a question of asthetic code grouping. I didn't want only
one of two servlets that both depended on the core existing to init it
withought some obvious dependency.
Erik: Are you just talking about using <load-on-startup> for a
servlet, or is there some other recent addition to he Servlet spec for
registering an arbitrary class that should be constructed once per
application with init/destroy methods that should be called appropriately
... i can't seem to find anything like that (other then making a servlet
with no path mapping)
-Hoss
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Bill Au <bi...@gmail.com>.
We should be able to use <load-on-startup> for the servlet that is
responsible for
making the core in both Servlet 2.3 and 2.4.
Bill
On 4/5/06, Yonik Seeley <ys...@gmail.com> wrote:
>
> On 4/5/06, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> > Modern day servlet spec allows for an initialization hook so a
> > servlet init hack to get things initialized is not needed these
> > days. What is the minimum servlet spec that Solr is aimed for?
>
> 2.4, IMO.
>
> -Yonik
>
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Yonik Seeley <ys...@gmail.com>.
On 4/5/06, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> Modern day servlet spec allows for an initialization hook so a
> servlet init hack to get things initialized is not needed these
> days. What is the minimum servlet spec that Solr is aimed for?
2.4, IMO.
-Yonik
Re: [jira] Commented: (SOLR-7) can't post queries
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Modern day servlet spec allows for an initialization hook so a
servlet init hack to get things initialized is not needed these
days. What is the minimum servlet spec that Solr is aimed for?
Erik
On Apr 5, 2006, at 4:53 PM, Hoss Man (JIRA) wrote:
> [ http://issues.apache.org/jira/browse/SOLR-7?
> page=comments#action_12373427 ]
>
> Hoss Man commented on SOLR-7:
> -----------------------------
>
> I remember being slightly anoyed by this at one point, and thinking
> it would be really easy to refactor the code into two seperate
> servlets bound to the seperate paths -- but then i realized the
> init method for hte servlet is what makes the core, and I wasn't
> motivated enough to make a choice of how to deal with that.
>
> The simplest approach would probably be to have a QueryServlet
> bound to /select that is in charge of initializing the core, and an
> UpdateServlet bound to /update ... since arguably there are more
> use cases where you might want to query a port without ever
> updating it then there are to updating a port without ever querying
> it.
>
> Of course, a seperate servlet/filter could be created to manage the
> core, it doesn't really matter that much
>
>
>> can't post queries
>> ------------------
>>
>> Key: SOLR-7
>> URL: http://issues.apache.org/jira/browse/SOLR-7
>> Project: Solr
>> Type: Bug
>
>> Reporter: Yonik Seeley
>> Priority: Minor
>
>>
>> One can't currently post a query (must be an http-get).
>> The same servlet handles /update and /select, and the doPost
>> method always treats the request as an update.
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the
> administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
[jira] Commented: (SOLR-7) can't post queries
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/SOLR-7?page=comments#action_12373427 ]
Hoss Man commented on SOLR-7:
-----------------------------
I remember being slightly anoyed by this at one point, and thinking it would be really easy to refactor the code into two seperate servlets bound to the seperate paths -- but then i realized the init method for hte servlet is what makes the core, and I wasn't motivated enough to make a choice of how to deal with that.
The simplest approach would probably be to have a QueryServlet bound to /select that is in charge of initializing the core, and an UpdateServlet bound to /update ... since arguably there are more use cases where you might want to query a port without ever updating it then there are to updating a port without ever querying it.
Of course, a seperate servlet/filter could be created to manage the core, it doesn't really matter that much
> can't post queries
> ------------------
>
> Key: SOLR-7
> URL: http://issues.apache.org/jira/browse/SOLR-7
> Project: Solr
> Type: Bug
> Reporter: Yonik Seeley
> Priority: Minor
>
> One can't currently post a query (must be an http-get).
> The same servlet handles /update and /select, and the doPost method always treats the request as an update.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (SOLR-7) can't post queries
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/SOLR-7?page=all ]
Yonik Seeley closed SOLR-7:
---------------------------
Resolution: Fixed
OK, posting queries to /select now works for me, and updates are handled by a separate servlet.
> can't post queries
> ------------------
>
> Key: SOLR-7
> URL: http://issues.apache.org/jira/browse/SOLR-7
> Project: Solr
> Type: Bug
> Reporter: Yonik Seeley
> Priority: Minor
> Attachments: update_servlet.txt
>
> One can't currently post a query (must be an http-get).
> The same servlet handles /update and /select, and the doPost method always treats the request as an update.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (SOLR-7) can't post queries
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/SOLR-7?page=comments#action_12373543 ]
Hoss Man commented on SOLR-7:
-----------------------------
er, scratch that load-on-startup comment ... i'm two times a fool for both missunderstanding the meaning of that tag for hte last 3 years and for not reading to the end of a thread before summarizing it in a bug.
> can't post queries
> ------------------
>
> Key: SOLR-7
> URL: http://issues.apache.org/jira/browse/SOLR-7
> Project: Solr
> Type: Bug
> Reporter: Yonik Seeley
> Priority: Minor
>
> One can't currently post a query (must be an http-get).
> The same servlet handles /update and /select, and the doPost method always treats the request as an update.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (SOLR-7) can't post queries
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/SOLR-7?page=all ]
Yonik Seeley updated SOLR-7:
----------------------------
Attachment: update_servlet.txt
here is a quick refactor...
any objections?
the context listener stuff is independent and can be handled later.
> can't post queries
> ------------------
>
> Key: SOLR-7
> URL: http://issues.apache.org/jira/browse/SOLR-7
> Project: Solr
> Type: Bug
> Reporter: Yonik Seeley
> Priority: Minor
> Attachments: update_servlet.txt
>
> One can't currently post a query (must be an http-get).
> The same servlet handles /update and /select, and the doPost method always treats the request as an update.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (SOLR-7) can't post queries
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/SOLR-7?page=comments#action_12373542 ]
Hoss Man commented on SOLR-7:
-----------------------------
as discussed in email, a ServletContextListener registered in the web.xml using <listener> would be the most logical place to put core construction/desrtuction.
on a slightly related note: if/when someone splits the curernt SolrServlet into an UpdateServlet and a QueryServlet, it would probably make sense for both of them to be regsitered with <load-on-start>1</load-on-start>.
> can't post queries
> ------------------
>
> Key: SOLR-7
> URL: http://issues.apache.org/jira/browse/SOLR-7
> Project: Solr
> Type: Bug
> Reporter: Yonik Seeley
> Priority: Minor
>
> One can't currently post a query (must be an http-get).
> The same servlet handles /update and /select, and the doPost method always treats the request as an update.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira