errors and cleanup

This commit is contained in:
Chris Allen 2014-04-07 20:37:19 -05:00
parent bfaeb92c89
commit bf74b956b1
2 changed files with 15 additions and 8 deletions

View File

@ -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 |

View File

@ -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