mirror of
https://github.com/typeable/bloodhound.git
synced 2024-09-11 08:25:32 +03:00
errors and cleanup
This commit is contained in:
parent
bfaeb92c89
commit
bf74b956b1
@ -334,8 +334,8 @@ data Filter = AndFilter [Filter] (Maybe Cache)
|
||||
| OrFilter [Filter] (Maybe Cache)
|
||||
| BoolFilter BoolMatch (Maybe Cache)
|
||||
| ExistsFilter FieldName -- always cached
|
||||
| GeoBoundingBoxFilter FieldName GeoBoundingBoxConstraint GeoFilterType (Maybe Cache)
|
||||
| GeoDistanceFilter FieldName LatLon Distance (Maybe Cache)
|
||||
| GeoBoundingBoxFilter GeoBoundingBoxConstraint GeoFilterType (Maybe Cache)
|
||||
| GeoDistanceFilter GeoConstraint Distance (Maybe Cache)
|
||||
deriving (Show)
|
||||
|
||||
-- I dunno.
|
||||
@ -350,14 +350,19 @@ data BoolMatch = MustMatch Term
|
||||
data GeoFilterType = GeoFilterMemory | GeoFilterIndexed deriving (Show)
|
||||
|
||||
data LatLon = LatLon { lat :: Double, lon :: Double } deriving (Show)
|
||||
data GeoBoundingBox = { topLeft :: LatLon
|
||||
, bottomRight :: LatLon } deriving (Show)
|
||||
data GeoBoundingBox =
|
||||
GeoBoundingBox { topLeft :: LatLon
|
||||
, bottomRight :: LatLon } deriving (Show)
|
||||
|
||||
data GeoBoundingBoxConstraint =
|
||||
GeoBoundingBoxConstraint { geoField :: Text
|
||||
GeoBoundingBoxConstraint { geoField :: FieldName
|
||||
, constraintBox :: GeoBoundingBox
|
||||
} deriving (Show)
|
||||
|
||||
data GeoConstraint =
|
||||
GeoConstraint { geoField :: FieldName
|
||||
, latLon :: LatLon } deriving (Show)
|
||||
|
||||
data DistanceUnits = Miles
|
||||
| Yards
|
||||
| Feet
|
||||
@ -373,8 +378,10 @@ data DistanceType = Arc | SloppyArc | Plane deriving (Show)
|
||||
-- geo_point?
|
||||
data OptimizeBbox = GeoFilterType | NoOptimizeBbox deriving (Show)
|
||||
|
||||
data Distance = { coefficient :: Double
|
||||
, unit :: DistanceUnits } deriving (Show)
|
||||
data Distance =
|
||||
Distance { coefficient :: Double
|
||||
, unit :: DistanceUnits } deriving (Show)
|
||||
|
||||
-- This is turning into a fractal of horror
|
||||
-- data Fuzziness = FDateFuzziness DateFuzziness |
|
||||
|
||||
|
@ -55,4 +55,4 @@ main = hspec $ do
|
||||
docInserted <- getDocument (Server "http://localhost:9200") "twitter" "tweet" "1"
|
||||
let newTweet = decode (responseBody docInserted) :: Maybe (EsResult Tweet)
|
||||
deleted <- deleteExampleIndex
|
||||
(Just tweet) `shouldBe` (fmap _source newTweet)
|
||||
Just tweet `shouldBe` fmap _source newTweet
|
||||
|
Loading…
Reference in New Issue
Block a user