flux
flux copied to clipboard
added a collections reload and list method, create connection with URL arg alone
For creating a collection, we first need a connection.
(def myconn (http/create "http://localhost:8983/solr" "mycollection" )
(create-collection myconn "mycollection" 1 )
However, this gives me an error (on Solr version 4.10.2)
org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Expected mime type application/octet-stream but got text/html.
(html elided) Problem accessing /solr/mycollection/admin/collections.
We can instead specify a connection that only takes a URL, and returns a connection, which can be used to create a collection. I've also added 2 methods for listing and reloading collections.
(def myconn (http/create "http://localhost:8983/solr" ))
(flux-col/create-collection myconn "mycollection" 1 )
(flux-col/list-collections myconn )
;add documents
(flux-col/reload-collection myconn "mycollection")
(flux-col/delete-collection myconn "mycollection" )