@@ -845,6 +845,7 @@ data MatchQuery = MatchQuery
845 , matchQueryLenient :: Maybe Lenient
845 , matchQueryLenient :: Maybe Lenient
846 , matchQueryBoost :: Maybe Boost
846 , matchQueryBoost :: Maybe Boost
847 , matchQueryMinimumShouldMatch :: Maybe Text
847 , matchQueryMinimumShouldMatch :: Maybe Text
848+ , matchQueryFuzziness :: Maybe Fuzziness
848 } deriving (Eq, Show)
849 } deriving (Eq, Show)
@@ -853,7 +854,7 @@ instance ToJSON MatchQuery where
853 (QueryString mqQueryString) booleanOperator
854 (QueryString mqQueryString) booleanOperator
854 zeroTermsQuery cutoffFrequency matchQueryType
855 zeroTermsQuery cutoffFrequency matchQueryType
855 analyzer maxExpansions lenient boost
856 analyzer maxExpansions lenient boost
856− minShouldMatch
857+ minShouldMatch mqFuzziness
858 object [ fieldName .= omitNulls base ]
859 object [ fieldName .= omitNulls base ]
859 where base = [ "query" .= mqQueryString
860 where base = [ "query" .= mqQueryString
@@ -866,6 +867,7 @@ instance ToJSON MatchQuery where
866 , "lenient" .= lenient
867 , "lenient" .= lenient
867 , "boost" .= boost
868 , "boost" .= boost
868 , "minimum_should_match" .= minShouldMatch
869 , "minimum_should_match" .= minShouldMatch
870+ , "fuzziness" .= mqFuzziness
871instance FromJSON MatchQuery where
873instance FromJSON MatchQuery where
@@ -882,12 +884,13 @@ instance FromJSON MatchQuery where
882 <*> o .:? "lenient"
884 <*> o .:? "lenient"
883 <*> o .:? "boost"
885 <*> o .:? "boost"
884 <*> o .:? "minimum_should_match"
886 <*> o .:? "minimum_should_match"
887+ <*> o .:? "fuzziness"
886{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
889{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
887 enabling you to provide only the 'FieldName' and 'QueryString' to make a 'MatchQuery'
890 enabling you to provide only the 'FieldName' and 'QueryString' to make a 'MatchQuery'
889mkMatchQuery :: FieldName -> QueryString -> MatchQuery
892mkMatchQuery :: FieldName -> QueryString -> MatchQuery
890−mkMatchQuery field query = MatchQuery field query Or ZeroTermsNone Nothing Nothing Nothing Nothing Nothing Nothing Nothing
893+mkMatchQuery field query = MatchQuery field query Or ZeroTermsNone Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
892data MatchQueryType =
895data MatchQueryType =
893 MatchPhrase
896 MatchPhrase