Elasticsearch的一個Common Lisp客戶端:Eclastic
一個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) 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!