tjake / Solandra

Solandra = Solr + Cassandra
Apache License 2.0
882 stars 150 forks source link

Method for installing a schema/core should be RESTful #76

Open davidstrauss opened 13 years ago

davidstrauss commented 13 years ago

The current method for schema installation isn't RESTful.

First, it uses POST, which implies that the data is being added to the collection at the path, but /solandra/schema// isn't a collection.

Second, the path the POST enables use of (/solandra/) is not related to where the POST occurs.

Core creation should occur when a PUT of a schema happens at /solandra/. This has RESTful semantics because (1) a subsequent PUT to the same URL replaces the previous schema and (2) the PUT enables use of that URL for indexing documents within the core at the same path.

Indexing documents should be a POST to /solandra//, as I believe it already is. This follows REST semantics because it adds the document(s) to the collection managed within the core.

tjake commented 13 years ago

Good distinction between put and post. I can change this.

The only issue is POST to /solandra/core-id/ doesn't do anything, Solr api uses /solandra/core-id/update, and I don't want to break their api. This is also why I put the schema api under /solandra/schema to avoid confusion. though, perhaps /solandra/core-id/schema is better?

davidstrauss commented 13 years ago

I see where you're going with not touching Solr's API once you reach /solandra/core-id/. That makes sense, and it makes me reluctant to recommend moving the non-Solr API operation of Solandra core setup under that path (which would be the case with /solandra/core-id/schema).

I guess the only change I'd make is supporting PUT for /solandra/schema/core-id in order to recognize the whole "PUT at the same URL replaces the existing data" part of REST.