Elasticsearch的一个Common Lisp客户端:Eclastic
jopen
10年前
一个Common Lisp客户端用于与 elasticsearch交互。
Fetching a document
Asks the server for a document. If none exists, it still returns an empty document, but a warning is signalled:
(document-by-id *my-documents* "1") ;; => #<<DOCUMENT> /highway/whatever/1 {10083980C3}> (handler-case (document-by-id *my-documents* "no-such-doc") (document-not-found "Sorry, I couldn't find that document")) ;; => "Sorry, I couldn't find that document"
Searching
The query language will be accessible with native Lisp syntax:
(get* *my-documents* (new-search (match "adventure" "_all"))) ;; => (#<<DOCUMENT> /highway/whatever/321 {10071F58E3}> ;; #<<DOCUMENT> /highway/whatever/412 {10071F5963}> ;; #<<DOCUMENT> /highway/whatever/431 {10071F59E3}>) ;; (:NUM-HITS 3 :SHARDS (:TOTAL 5 :FAILED 5 :SUCCESSFUL 0) ;; :TIMED-OUT NIL :TOOK 3)