@@ -59,12 +59,12 @@ instance ToJSON Filter where
59 , distanceGeoField .= toJSON latLon
59 , distanceGeoField .= toJSON latLon
60 , "_cache" .= cache]]
60 , "_cache" .= cache]]
62− toJSON (GeoDistanceRangeFilter (GeoPoint (FieldName geoField) drLatLon)
62+ toJSON (GeoDistanceRangeFilter (GeoPoint (FieldName gddrField) drLatLon)
63− (DistanceRange distanceFrom distanceTo)) =
63+ (DistanceRange distanceFrom drDistanceTo)) =
64 object ["geo_distance_range" .=
64 object ["geo_distance_range" .=
65 object ["from" .= toJSON distanceFrom
65 object ["from" .= toJSON distanceFrom
66− , "to" .= toJSON distanceTo
66+ , "to" .= toJSON drDistanceTo
67− , geoField .= toJSON drLatLon]]
67+ , gddrField .= toJSON drLatLon]]
69 toJSON (GeoPolygonFilter (FieldName geoField) latLons) =
69 toJSON (GeoPolygonFilter (FieldName geoField) latLons) =
70 object ["geo_polygon" .=
70 object ["geo_polygon" .=
@@ -358,20 +358,20 @@ instance ToJSON CommonMinimumMatch where
358 , "high_freq" .= toJSON highF ]
358 , "high_freq" .= toJSON highF ]
360instance ToJSON BoostingQuery where
360instance ToJSON BoostingQuery where
361− toJSON (BoostingQuery positiveQuery negativeQuery negativeBoost) =
361+ toJSON (BoostingQuery bqPositiveQuery bqNegativeQuery bqNegativeBoost) =
362− object [ "positive" .= toJSON positiveQuery
362+ object [ "positive" .= toJSON bqPositiveQuery
363− , "negative" .= toJSON negativeQuery
363+ , "negative" .= toJSON bqNegativeQuery
364− , "negative_boost" .= toJSON negativeBoost ]
364+ , "negative_boost" .= toJSON bqNegativeBoost ]
367instance ToJSON BoolQuery where
367instance ToJSON BoolQuery where
368− toJSON (BoolQuery mustM notM shouldM min boost disableCoord) =
368+ toJSON (BoolQuery mustM notM shouldM bqMin boost disableCoord) =
369 object filtered
369 object filtered
370 where filtered = catMaybes
370 where filtered = catMaybes
371 [ mField "must" mustM
371 [ mField "must" mustM
372 , mField "must_not" notM
372 , mField "must_not" notM
373 , mField "should" shouldM
373 , mField "should" shouldM
374− , mField "minimum_should_match" min
374+ , mField "minimum_should_match" bqMin
375 , mField "boost" boost
375 , mField "boost" boost
376 , mField "disable_coord" disableCoord ]
376 , mField "disable_coord" disableCoord ]
@@ -491,14 +491,14 @@ instance (FromJSON a) => FromJSON (EsResult a) where
493instance ToJSON Search where
493instance ToJSON Search where
494− toJSON (Search query filter sort trackSortScores from size) =
494+ toJSON (Search query filter sort sTrackSortScores sFrom sSize) =
495 object merged where
495 object merged where
496 lQuery = maybeJson "query" query
496 lQuery = maybeJson "query" query
497 lFilter = maybeJson "filter" filter
497 lFilter = maybeJson "filter" filter
498 lSort = maybeJsonF "sort" sort
498 lSort = maybeJsonF "sort" sort
499− merged = mconcat [[ "from" .= from
499+ merged = mconcat [[ "from" .= sFrom
500− , "size" .= size
500+ , "size" .= sSize
501− , "track_scores" .= trackSortScores]
501+ , "track_scores" .= sTrackSortScores]
503 , lFilter
503 , lFilter
@@ -506,20 +506,20 @@ instance ToJSON Search where
507instance ToJSON SortSpec where
507instance ToJSON SortSpec where
508 toJSON (DefaultSortSpec
508 toJSON (DefaultSortSpec
509− (DefaultSort (FieldName sortFieldName) sortOrder ignoreUnmapped
509+ (DefaultSort (FieldName dsSortFieldName) dsSortOrder dsIgnoreUnmapped
510− sortMode missingSort nestedFilter)) =
510+ dsSortMode dsMissingSort dsNestedFilter)) =
511− object [sortFieldName .= object merged] where
511+ object [dsSortFieldName .= object merged] where
512− base = ["order" .= toJSON sortOrder
512+ base = ["order" .= toJSON dsSortOrder
513− , "ignore_unmapped" .= ignoreUnmapped]
513+ , "ignore_unmapped" .= dsIgnoreUnmapped]
514− lSortMode = maybeJson "mode" sortMode
514+ lSortMode = maybeJson "mode" dsSortMode
515− lMissingSort = maybeJson "missing" missingSort
515+ lMissingSort = maybeJson "missing" dsMissingSort
516− lNestedFilter = maybeJson "nested_filter" nestedFilter
516+ lNestedFilter = maybeJson "nested_filter" dsNestedFilter
517 merged = mconcat [base, lSortMode, lMissingSort, lNestedFilter]
517 merged = mconcat [base, lSortMode, lMissingSort, lNestedFilter]
519− toJSON (GeoDistanceSortSpec sortOrder (GeoPoint (FieldName field) latLon) units) =
519+ toJSON (GeoDistanceSortSpec gdsSortOrder (GeoPoint (FieldName field) gdsLatLon) units) =
520 object [ "unit" .= toJSON units
520 object [ "unit" .= toJSON units
521− , field .= toJSON latLon
521+ , field .= toJSON gdsLatLon
522− , "order" .= toJSON sortOrder ]
522+ , "order" .= toJSON gdsSortOrder ]
525instance ToJSON SortOrder where
525instance ToJSON SortOrder where
@@ -548,10 +548,10 @@ instance ToJSON ScoreType where
550instance ToJSON Distance where
550instance ToJSON Distance where
551− toJSON (Distance coefficient unit) =
551+ toJSON (Distance dCoefficient dUnit) =
552 String boltedTogether where
552 String boltedTogether where
553− coefText = showText coefficient
553+ coefText = showText dCoefficient
554− (String unitText) = (toJSON unit)
554+ (String unitText) = toJSON dUnit
555 boltedTogether = mappend coefText unitText
555 boltedTogether = mappend coefText unitText
@@ -579,8 +579,9 @@ instance ToJSON OptimizeBbox where
581instance ToJSON GeoBoundingBoxConstraint where
581instance ToJSON GeoBoundingBoxConstraint where
582− toJSON (GeoBoundingBoxConstraint (FieldName geoBBField) constraintBox cache) =
582+ toJSON (GeoBoundingBoxConstraint
583− object [geoBBField .= toJSON constraintBox
583+ (FieldName gbbcGeoBBField) gbbcConstraintBox cache) =
584+ object [gbbcGeoBBField .= toJSON gbbcConstraintBox
584 , "_cache" .= cache]
585 , "_cache" .= cache]
@@ -590,15 +591,15 @@ instance ToJSON GeoFilterType where
592instance ToJSON GeoBoundingBox where
593instance ToJSON GeoBoundingBox where
593− toJSON (GeoBoundingBox topLeft bottomRight) =
594+ toJSON (GeoBoundingBox gbbTopLeft gbbBottomRight) =
594− object ["top_left" .= toJSON topLeft
595+ object ["top_left" .= toJSON gbbTopLeft
595− , "bottom_right" .= toJSON bottomRight]
596+ , "bottom_right" .= toJSON gbbBottomRight]
598instance ToJSON LatLon where
599instance ToJSON LatLon where
599− toJSON (LatLon lat lon) =
600+ toJSON (LatLon lLat lLon) =
600− object ["lat" .= lat
601+ object ["lat" .= lLat
601− , "lon" .= lon]
602+ , "lon" .= lLon]
604-- index for smaller ranges, fielddata for longer ranges
605-- index for smaller ranges, fielddata for longer ranges