Skip to content

Commit

Permalink
Adding method for getting a new CoreAdmin instance from SolrInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
vanng822 committed Aug 16, 2014
1 parent b91d5a7 commit d2a1163
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions solr/solr.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,13 @@ func (si *SolrInterface) Optimize(params *url.Values) (*UpdateResponse, error) {
func (si *SolrInterface) Rollback() (*UpdateResponse, error) {
return si.Update(map[string]interface{}{"rollback": map[string]interface{}{}}, nil)
}

// Return new instance of CoreAdmin with provided solrUrl and basic auth
func (si *SolrInterface) CoreAdmin() (*CoreAdmin, error) {
ca, err := NewCoreAdmin(si.conn.url.String())
if err != nil {
return nil, err
}
ca.SetBasicAuth(si.conn.username, si.conn.password)
return ca, nil
}

0 comments on commit d2a1163

Please sign in to comment.