@@ -4,7 +4,7 @@
44{-# LANGUAGE FlexibleInstances #-}
55{-# LANGUAGE GeneralizedNewtypeDeriving #-}
66{-# LANGUAGE MultiParamTypeClasses #-}
7−{-# LANGUAGE NoMonomorphismRestriction #-}
7+-- {-# LANGUAGE NoMonomorphismRestriction #-}
88{-# LANGUAGE OverloadedStrings #-}
99{-# LANGUAGE RecordWildCards #-}
1010{-# LANGUAGE UndecidableInstances #-}
@@ -311,6 +311,7 @@ import Database.Bloodhound.Types.Internal
311311
312312-- $setup
313313-- >>> :set -XOverloadedStrings
314+-- >>> import Data.Aeson
314315-- >>> import Database.Bloodhound
315316-- >>> let testServer = (Server "http://localhost:9200")
316317-- >>> let testIndex = IndexName "twitter"
@@ -2484,7 +2485,8 @@ instance FromJSON MoreLikeThisFieldQuery where
24842485 <*> o .:? "percent_terms_to_match"
24852486 <*> o .:? "min_term_freq"
24862487 <*> o .:? "max_query_terms"
2487− <*> (optionalNE =<< o .:? "stop_words")
2488+ -- <*> (optionalNE =<< o .:? "stop_words")
2489+ <*> o .:? "stop_words"
24882490 <*> o .:? "min_doc_freq"
24892491 <*> o .:? "max_doc_freq"
24902492 <*> o .:? "min_word_length"
@@ -2492,7 +2494,7 @@ instance FromJSON MoreLikeThisFieldQuery where
24922494 <*> o .:? "boost_terms"
24932495 <*> o .:? "boost"
24942496 <*> o .:? "analyzer"
2495− optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
2497+ -- optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
24962498
24972499instance ToJSON MoreLikeThisQuery where
24982500 toJSON (MoreLikeThisQuery text fields percent
@@ -2517,11 +2519,13 @@ instance FromJSON MoreLikeThisQuery where
25172519 parseJSON = withObject "MoreLikeThisQuery" parse
25182520 where parse o = MoreLikeThisQuery
25192521 <$> o .: "like_text"
2520− <*> (optionalNE =<< o .:? "fields")
2522+ -- <*> (optionalNE =<< o .:? "fields")
2523+ <*> o .:? "fields"
25212524 <*> o .:? "percent_terms_to_match"
25222525 <*> o .:? "min_term_freq"
25232526 <*> o .:? "max_query_terms"
2524− <*> (optionalNE =<< o .:? "stop_words")
2527+ -- <*> (optionalNE =<< o .:? "stop_words")
2528+ <*> o .:? "stop_words"
25252529 <*> o .:? "min_doc_freq"
25262530 <*> o .:? "max_doc_freq"
25272531 <*> o .:? "min_word_length"
@@ -2529,7 +2533,7 @@ instance FromJSON MoreLikeThisQuery where
25292533 <*> o .:? "boost_terms"
25302534 <*> o .:? "boost"
25312535 <*> o .:? "analyzer"
2532− optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
2536+ -- optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON)
25332537
25342538instance ToJSON IndicesQuery where
25352539 toJSON (IndicesQuery indices query noMatch) =