peterbourgon/elasticsearch — pull request #2 by bernerdschaefer (2013-03-20 11:13:32+00:00)
Title: Support for Index Operations

### New API

Here's an example from the cluster test that showcases almost everything new for indexing operations.

```go
response, err := c.Bulk(es.BulkRequest{
es.BulkParams{Refresh: "true"},
[]es.BulkIndexable{
es.IndexRequest{
es.IndexParams{Index: "twitter", Type: "tweet", Id: "1", Version: "3"},
map[string]interface{}{"name": "James"},
},
es.DeleteRequest{
es.IndexParams{Index: "twitter", Type: "tweet", Id: "2"},
},
es.CreateRequest{
es.IndexParams{Index: "twitter", Type: "tweet", Id: "3", Percolate: "*"},
map[string]interface{}{"name": "John"},
},
},
})
```

### Breaking API Changes

- Both SearchRequest and MultiSearchRequest now take an explicit
`es.SearchParams` as params.
- MultiSearchRequest is no longer a slice of SearchRequests, but
instead accepts both `es.SearchParams` and a slice of
SearchRequests.

### Internal API Changes

- Fireable interface now expects a Request method which takes a
base URL and returns an HTTP request.
- Cluster no longer uses the event loop for dispatching requests.
- `searchCommon` on Node is now `Execute` as a generic method for
executing requests against the node.