git.iko.soy/typeable/bloodhound
on master help sign in
url query encoding bug
commita4a15751a9e094b8e32a670c3562d3bdf0e28a0d authorJosh Berman <berman.josh@gmail.com> dateTue 18 Aug 2015, 16:26 (11 years ago) parentc02b6c7
2 files changed+10−10
bloodhound.cabal+1−1 src/Database/Bloodhound/Client.hs+9−9
bloodhound.cabal+1−1
@@ -1,5 +1,5 @@
11name: bloodhound
2−version: 0.7.1.0
2+version: 0.7.1.1
33synopsis: ElasticSearch client library for Haskell
44description: ElasticSearch made awesome for Haskell hackers
55homepage: https://github.com/bitemyapp/bloodhound
src/Database/Bloodhound/Client.hs+9−9
@@ -173,16 +173,16 @@ joinPath ps = do
173173 return $ joinPath' (s:ps)
174174
175175appendSearchTypeParam :: Text -> SearchType -> Text
176−appendSearchTypeParam originalUrl st = addQuery [(keyEq, Just stParams)] originalUrl
177− where keyEq = "search_type="
178− stParams
179− | st == SearchTypeDfsQueryThenFetch = "dfs_query_then_fetch"
180− | st == SearchTypeCount = "count"
181− | st == SearchTypeScan = "scan&scroll=1m"
182− | st == SearchTypeQueryAndFetch = "query_and_fetch"
183− | st == SearchTypeDfsQueryAndFetch = "dfs_query_and_fetch"
176+appendSearchTypeParam originalUrl st = addQuery params originalUrl
177+ where stText = "search_type"
178+ params
179+ | st == SearchTypeDfsQueryThenFetch = [(stText, Just "dfs_query_then_fetch")]
180+ | st == SearchTypeCount = [(stText, Just "count")]
181+ | st == SearchTypeScan = [(stText, Just "scan"), ("scroll", Just "1m")]
182+ | st == SearchTypeQueryAndFetch = [(stText, Just "query_and_fetch")]
183+ | st == SearchTypeDfsQueryAndFetch = [(stText, Just "dfs_query_and_fetch")]
184184 -- used to catch 'SearchTypeQueryThenFetch', which is also the default
185− | otherwise = "query_then_fetch"
185+ | otherwise = [(stText, Just "query_then_fetch")]
186186
187187-- | Severely dumbed down query renderer. Assumes your data doesn't
188188-- need any encoding