@@ -340,16 +340,16 @@ data Filter = AndFilter [Filter] Cache
341instance ToJSON Filter where
341instance ToJSON Filter where
342 toJSON (AndFilter filters cache) =
342 toJSON (AndFilter filters cache) =
343− object ["and" .= fmap toJSON filters
343+ object ["and" .= fmap toJSON filters
344 , "_cache" .= cache]
344 , "_cache" .= cache]
345 toJSON (OrFilter filters cache) =
345 toJSON (OrFilter filters cache) =
346− object ["or" .= fmap toJSON filters
346+ object ["or" .= fmap toJSON filters
347 , "_cache" .= cache]
347 , "_cache" .= cache]
348 toJSON (ExistsFilter fieldName) =
348 toJSON (ExistsFilter fieldName) =
349− object ["exists" .= object
349+ object ["exists" .= object
350− ["field" .= fieldName]]
350+ ["field" .= fieldName]]
351 toJSON (BoolFilter boolMatch cache) =
351 toJSON (BoolFilter boolMatch cache) =
352− object ["bool" .= toJSON boolMatch
352+ object ["bool" .= toJSON boolMatch
353 , "_cache" .= cache]
353 , "_cache" .= cache]
355-- I dunno.
355-- I dunno.
@@ -360,31 +360,33 @@ instance ToJSON Term where
360 toJSON (Term field value) = object ["term" .= object
360 toJSON (Term field value) = object ["term" .= object
361 [field .= value]]
361 [field .= value]]
363−data BoolMatch = MustMatch Term
363+data BoolMatch = MustMatch Term
364 | MustNotMatch Term
364 | MustNotMatch Term
365 | ShouldMatch [Term] deriving (Show)
365 | ShouldMatch [Term] deriving (Show)
367instance ToJSON BoolMatch where
367instance ToJSON BoolMatch where
368− toJSON (MustMatch term) = object ["must" .= toJSON term]
368+ toJSON (MustMatch term) = object ["must" .= toJSON term]
369 toJSON (MustNotMatch term) = object ["must_not" .= toJSON term]
369 toJSON (MustNotMatch term) = object ["must_not" .= toJSON term]
370− toJSON (ShouldMatch terms) = object ["should" .= fmap toJSON terms]
370+ toJSON (ShouldMatch terms) = object ["should" .= fmap toJSON terms]
372-- "memory" or "indexed"
372-- "memory" or "indexed"
373data GeoFilterType = GeoFilterMemory | GeoFilterIndexed deriving (Show)
373data GeoFilterType = GeoFilterMemory | GeoFilterIndexed deriving (Show)
375−data LatLon = LatLon { lat :: Double, lon :: Double } deriving (Show)
375+data LatLon = LatLon { lat :: Double
376+ , lon :: Double } deriving (Show)
376data GeoBoundingBox =
378data GeoBoundingBox =
377− GeoBoundingBox { topLeft :: LatLon
379+ GeoBoundingBox { topLeft :: LatLon
378 , bottomRight :: LatLon } deriving (Show)
380 , bottomRight :: LatLon } deriving (Show)
380data GeoBoundingBoxConstraint =
382data GeoBoundingBoxConstraint =
381− GeoBoundingBoxConstraint { geoBBField :: FieldName
383+ GeoBoundingBoxConstraint { geoBBField :: FieldName
382 , constraintBox :: GeoBoundingBox
384 , constraintBox :: GeoBoundingBox
383 } deriving (Show)
385 } deriving (Show)
385data GeoConstraint =
387data GeoConstraint =
386 GeoConstraint { geoField :: FieldName
388 GeoConstraint { geoField :: FieldName
387− , latLon :: LatLon } deriving (Show)
389+ , latLon :: LatLon } deriving (Show)
389data DistanceUnits = Miles
391data DistanceUnits = Miles
@@ -419,7 +421,7 @@ data FromJSON a => SearchHits a =
419 , hits :: [Hits a] } deriving (Show)
421 , hits :: [Hits a] } deriving (Show)
421data FromJSON a => Hits a =
423data FromJSON a => Hits a =
422− Hits { hitsIndex :: IndexName
424+ Hits { hitsIndex :: IndexName
423 , hitsType :: MappingName
425 , hitsType :: MappingName
424 , hitDocumentID :: DocumentID
426 , hitDocumentID :: DocumentID
425 , hitScore :: Score
427 , hitScore :: Score