git.iko.soy/typeable/bloodhound
on master help sign in
blah fuck wtf
dc49132Chris Allen
bloodhound.cabal+4−2
@@ -32,7 +32,7 @@ library
32 build-depends: base >= 4.3 && <5,
32 build-depends: base >= 4.3 && <5,
33 bytestring >= 0.10.0 && <0.11,
33 bytestring >= 0.10.0 && <0.11,
34 containers >= 0.5.0.0 && <0.6,
34 containers >= 0.5.0.0 && <0.6,
35− aeson >= 0.11 && <0.12,
35+ aeson >= 0.11.1 && <0.12,
36 http-client >= 0.3 && <0.5,
36 http-client >= 0.3 && <0.5,
37 network-uri >= 2.6 && <2.7,
37 network-uri >= 2.6 && <2.7,
38 semigroups >= 0.15 && <0.19,
38 semigroups >= 0.15 && <0.19,
@@ -62,7 +62,7 @@ test-suite tests
62 http-client,
62 http-client,
63 http-types,
63 http-types,
64 containers,
64 containers,
65− hspec >= 1.8 && <2.2,
65+ hspec >= 1.8 && <2.3,
66 text,
66 text,
67 time,
67 time,
68 aeson,
68 aeson,
@@ -84,6 +84,8 @@ test-suite doctests
84 hs-source-dirs: tests, src
84 hs-source-dirs: tests, src
85 if impl(ghc >= 7.8)
85 if impl(ghc >= 7.8)
86 build-depends: base,
86 build-depends: base,
87+ aeson,
88+ bloodhound,
87 directory,
89 directory,
88 doctest >= 0.10.1,
90 doctest >= 0.10.1,
89 doctest-prop,
91 doctest-prop,
src/Database/Bloodhound.hs+4−1
@@ -1,7 +1,10 @@
1module Database.Bloodhound
1module Database.Bloodhound
2+ ( -- module Data.Aeson.Types
3+ -- ,
2− ( module Database.Bloodhound.Client
4+ module Database.Bloodhound.Client
3 , module Database.Bloodhound.Types
5 , module Database.Bloodhound.Types
4 ) where
6 ) where
5
7
8+-- import Data.Aeson.Types
6import Database.Bloodhound.Client
9import Database.Bloodhound.Client
7import Database.Bloodhound.Types
10import Database.Bloodhound.Types
src/Database/Bloodhound/Types.hs+10−6
@@ -4,7 +4,7 @@
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
7−{-# LANGUAGE NoMonomorphismRestriction #-}
7+-- {-# LANGUAGE NoMonomorphismRestriction #-}
8{-# LANGUAGE OverloadedStrings #-}
8{-# LANGUAGE OverloadedStrings #-}
9{-# LANGUAGE RecordWildCards #-}
9{-# LANGUAGE RecordWildCards #-}
10{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
@@ -311,6 +311,7 @@ import Database.Bloodhound.Types.Internal
311
311
312-- $setup
312-- $setup
313-- >>> :set -XOverloadedStrings
313-- >>> :set -XOverloadedStrings
314+-- >>> import Data.Aeson
314-- >>> import Database.Bloodhound
315-- >>> import Database.Bloodhound
315-- >>> let testServer = (Server "http://localhost:9200")
316-- >>> let testServer = (Server "http://localhost:9200")
316-- >>> let testIndex = IndexName "twitter"
317-- >>> let testIndex = IndexName "twitter"
@@ -2484,7 +2485,8 @@ instance FromJSON MoreLikeThisFieldQuery where
2484 <*> o .:? "percent_terms_to_match"
2485 <*> o .:? "percent_terms_to_match"
2485 <*> o .:? "min_term_freq"
2486 <*> o .:? "min_term_freq"
2486 <*> o .:? "max_query_terms"
2487 <*> o .:? "max_query_terms"
2487− <*> (optionalNE =<< o .:? "stop_words")
2488+ -- <*> (optionalNE =<< o .:? "stop_words")
2489+ <*> o .:? "stop_words"
2488 <*> o .:? "min_doc_freq"
2490 <*> o .:? "min_doc_freq"
2489 <*> o .:? "max_doc_freq"
2491 <*> o .:? "max_doc_freq"
2490 <*> o .:? "min_word_length"
2492 <*> o .:? "min_word_length"
@@ -2492,7 +2494,7 @@ instance FromJSON MoreLikeThisFieldQuery where
2492 <*> o .:? "boost_terms"
2494 <*> o .:? "boost_terms"
2493 <*> o .:? "boost"
2495 <*> o .:? "boost"
2494 <*> o .:? "analyzer"
2496 <*> o .:? "analyzer"
2495− optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
2497+ -- optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
2496
2498
2497instance ToJSON MoreLikeThisQuery where
2499instance ToJSON MoreLikeThisQuery where
2498 toJSON (MoreLikeThisQuery text fields percent
2500 toJSON (MoreLikeThisQuery text fields percent
@@ -2517,11 +2519,13 @@ instance FromJSON MoreLikeThisQuery where
2517 parseJSON = withObject "MoreLikeThisQuery" parse
2519 parseJSON = withObject "MoreLikeThisQuery" parse
2518 where parse o = MoreLikeThisQuery
2520 where parse o = MoreLikeThisQuery
2519 <$> o .: "like_text"
2521 <$> o .: "like_text"
2520− <*> (optionalNE =<< o .:? "fields")
2522+ -- <*> (optionalNE =<< o .:? "fields")
2523+ <*> o .:? "fields"
2521 <*> o .:? "percent_terms_to_match"
2524 <*> o .:? "percent_terms_to_match"
2522 <*> o .:? "min_term_freq"
2525 <*> o .:? "min_term_freq"
2523 <*> o .:? "max_query_terms"
2526 <*> o .:? "max_query_terms"
2524− <*> (optionalNE =<< o .:? "stop_words")
2527+ -- <*> (optionalNE =<< o .:? "stop_words")
2528+ <*> o .:? "stop_words"
2525 <*> o .:? "min_doc_freq"
2529 <*> o .:? "min_doc_freq"
2526 <*> o .:? "max_doc_freq"
2530 <*> o .:? "max_doc_freq"
2527 <*> o .:? "min_word_length"
2531 <*> o .:? "min_word_length"
@@ -2529,7 +2533,7 @@ instance FromJSON MoreLikeThisQuery where
2529 <*> o .:? "boost_terms"
2533 <*> o .:? "boost_terms"
2530 <*> o .:? "boost"
2534 <*> o .:? "boost"
2531 <*> o .:? "analyzer"
2535 <*> o .:? "analyzer"
2532− optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
2536+ -- optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
2533
2537
2534instance ToJSON IndicesQuery where
2538instance ToJSON IndicesQuery where
2535 toJSON (IndicesQuery indices query noMatch) =
2539 toJSON (IndicesQuery indices query noMatch) =
stack-7.10.yaml+3−2
@@ -2,7 +2,8 @@ flags: {}
2packages:
2packages:
3- '.'
3- '.'
4extra-deps:
4extra-deps:
5−- aeson-0.10.0.0
5+- aeson-0.11.1.0
6+- fail-4.9.0.0
6- http-types-0.9
7- http-types-0.9
7- http-client-0.4.24
8- http-client-0.4.24
8- attoparsec-0.13.0.1
9- attoparsec-0.13.0.1
@@ -11,4 +12,4 @@ extra-deps:
11- quickcheck-properties-0.1
12- quickcheck-properties-0.1
12- semigroups-0.18.0.1
13- semigroups-0.18.0.1
13- uri-bytestring-0.1.9
14- uri-bytestring-0.1.9
14−resolver: lts-3.10
15+resolver: lts-5.1