Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch this search test to add data via K/V

  • Loading branch information...
commit 5573e796ed3ea8b5fa2ec9d7e7e4b7a950243a95 1 parent bb498c2
@michaelklishin authored
Showing with 9 additions and 11 deletions.
  1. +9 −11 test/clojurewerkz/welle/test/search_test.clj
View
20 test/clojurewerkz/welle/test/search_test.clj
@@ -9,19 +9,17 @@
(wc/connect!)
-(deftest ^{:search true} test-query-string-query-via-the-solr-api
+(deftest ^{:search true} test-term-query-via-the-solr-api
(let [bucket-name "clojurewerkz.welle.solr.tweets"
- bucket (wb/update bucket-name :last-write-wins true :enable-search true)]
+ bucket (wb/update bucket-name :last-write-wins true :enable-search true)
+ doc {:username "clojurewerkz"
+ :text "Elastisch beta3 is out, several more @elasticsearch features supported github.com/clojurewerkz/elastisch, improved docs http://clojureelasticsearch.info #clojure"
+ :timestamp "20120802T101232+0100"
+ :id 1}]
(drain bucket-name)
- (wsolr/delete-via-query bucket-name "text:*")
- (wsolr/index bucket-name {:username "clojurewerkz"
- :text "Elastisch beta3 is out, several more @elasticsearch features supported github.com/clojurewerkz/elastisch, improved docs http://clojureelasticsearch.info #clojure"
- :timestamp "20120802T101232+0100"
- :id 1})
- (let [result (wsolr/search bucket-name "*")
+ (kv/store bucket-name "a-key" doc :content-type "application/json")
+ (let [result (wsolr/search bucket-name "username:clojurewerkz")
hits (wsolr/hits-from result)]
- (println result)
- (println hits)
+ (is (= "a-key" (-> hits first :id)))
(is (> (count hits) 0)))
- ;; (wsolr/delete-via-query bucket-name "text:*")
(drain bucket-name)))
Please sign in to comment.
Something went wrong with that request. Please try again.