Skip to content

added a collections reload and list method, create connection with URL arg alone#11

Open
shark8me wants to merge 1 commit intomwmitchell:masterfrom
shark8me:add-reload-and-list-in-collections
Open

added a collections reload and list method, create connection with URL arg alone#11
shark8me wants to merge 1 commit intomwmitchell:masterfrom
shark8me:add-reload-and-list-in-collections

Conversation

@shark8me
Copy link

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" )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant