git.iko.soy/typeable/bloodhound
on master help sign in
formatting
commite9ba7548069483d32410d2aee2fca41ffbbf785b authorChris Allen <cma@bitemyapp.com> dateSun 13 Apr 2014, 20:27 (13 years ago) parent815f828
1 file changed+5
README.org+5
README.org+5
@@ -256,8 +256,13 @@ let query = TermQuery (Term "user" "bitemyapp") Nothing
256256-- <||> (or/plus) should make it into a search that returns everything.
257257
258258let filter = IdentityFilter <&&> IdentityFilter
259+
260+-- constructing the search object the searchByIndex function dispatches on.
259261let search = mkSearch (Just query) (Just filter)
262+
263+-- you can also searchByType and specify the mapping name.
260264reply <- searchByIndex testServer testIndex search
265+
261266let result = eitherDecode (responseBody reply) :: Either String (SearchResult Tweet)
262267
263268λ> fmap (hits . searchHits) result