git.iko.soy/typeable/bloodhound
on master help sign in
cleanup
commit667042753406dba364839c93ca49329e659fcfa0 authorChris Allen <cma@bitemyapp.com> dateTue 8 Apr 2014, 23:29 (13 years ago) parentd4fe69c
1 file changed+15−13
Database/Bloodhound/Client.hs+15−13
Database/Bloodhound/Client.hs+15−13
@@ -340,16 +340,16 @@ data Filter = AndFilter [Filter] Cache
340340
341341instance ToJSON Filter where
342342 toJSON (AndFilter filters cache) =
343− object ["and" .= fmap toJSON filters
343+ object ["and" .= fmap toJSON filters
344344 , "_cache" .= cache]
345345 toJSON (OrFilter filters cache) =
346− object ["or" .= fmap toJSON filters
346+ object ["or" .= fmap toJSON filters
347347 , "_cache" .= cache]
348348 toJSON (ExistsFilter fieldName) =
349− object ["exists" .= object
350− ["field" .= fieldName]]
349+ object ["exists" .= object
350+ ["field" .= fieldName]]
351351 toJSON (BoolFilter boolMatch cache) =
352− object ["bool" .= toJSON boolMatch
352+ object ["bool" .= toJSON boolMatch
353353 , "_cache" .= cache]
354354
355355-- I dunno.
@@ -360,31 +360,33 @@ instance ToJSON Term where
360360 toJSON (Term field value) = object ["term" .= object
361361 [field .= value]]
362362
363−data BoolMatch = MustMatch Term
363+data BoolMatch = MustMatch Term
364364 | MustNotMatch Term
365365 | ShouldMatch [Term] deriving (Show)
366366
367367instance ToJSON BoolMatch where
368− toJSON (MustMatch term) = object ["must" .= toJSON term]
368+ toJSON (MustMatch term) = object ["must" .= toJSON term]
369369 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]
371371
372372-- "memory" or "indexed"
373373data GeoFilterType = GeoFilterMemory | GeoFilterIndexed deriving (Show)
374374
375−data LatLon = LatLon { lat :: Double, lon :: Double } deriving (Show)
375+data LatLon = LatLon { lat :: Double
376+ , lon :: Double } deriving (Show)
377+
376378data GeoBoundingBox =
377− GeoBoundingBox { topLeft :: LatLon
379+ GeoBoundingBox { topLeft :: LatLon
378380 , bottomRight :: LatLon } deriving (Show)
379381
380382data GeoBoundingBoxConstraint =
381− GeoBoundingBoxConstraint { geoBBField :: FieldName
383+ GeoBoundingBoxConstraint { geoBBField :: FieldName
382384 , constraintBox :: GeoBoundingBox
383385 } deriving (Show)
384386
385387data GeoConstraint =
386388 GeoConstraint { geoField :: FieldName
387− , latLon :: LatLon } deriving (Show)
389+ , latLon :: LatLon } deriving (Show)
388390
389391data DistanceUnits = Miles
390392 | Yards
@@ -419,7 +421,7 @@ data FromJSON a => SearchHits a =
419421 , hits :: [Hits a] } deriving (Show)
420422
421423data FromJSON a => Hits a =
422− Hits { hitsIndex :: IndexName
424+ Hits { hitsIndex :: IndexName
423425 , hitsType :: MappingName
424426 , hitDocumentID :: DocumentID
425427 , hitScore :: Score