Skip to content

Instantly share code, notes, and snippets.

@mlehman
Created December 29, 2010 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlehman/757936 to your computer and use it in GitHub Desktop.
Save mlehman/757936 to your computer and use it in GitHub Desktop.
;; Embedded Solr Example
(def server (create-solr-server
{:type :embedded :core "mycore" :dir "/home-path"}))
;; Http Solr Example
(def server (create-solr-server
{:type :http :host "localhost"}))
;; Adding Documents
(add server {:title "Don Quixote"
:author "Miguel de Cervantes" :summary "..." })
;; Simple Query
(query server "la mancha")
::Paging
(query server "author:c*" :rows 100 :start 100)
;;Faceting
(query server "*:*" :rows 0 :facet true :facet.field :author)
;; Delete
(delete-by-query server "*:*")
;; Commit
(commit server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment