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 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!