@@ -18,6 +18,7 @@ import Test.Import
19import Prelude
19import Prelude
21+import qualified Data.Aeson as Aeson
21import qualified Test.Aggregation as Aggregation
22import qualified Test.Aggregation as Aggregation
22import qualified Test.BulkAPI as Bulk
23import qualified Test.BulkAPI as Bulk
23import qualified Test.Documents as Documents
24import qualified Test.Documents as Documents
@@ -117,3 +118,19 @@ main = hspec $ do
117 regular_search `shouldBe` Right exampleTweet -- Check that the size restrtiction is being honored
118 regular_search `shouldBe` Right exampleTweet -- Check that the size restrtiction is being honored
119 scan_search `shouldMatchList` [Just exampleTweet, Just otherTweet]
120 scan_search `shouldMatchList` [Just exampleTweet, Just otherTweet]
122+ describe "Search After API" $
123+ it "returns document for search after query" $ withTestEnv $ do
127+ sortSpec = DefaultSortSpec $ mkSort (FieldName "user") Ascending
128+ searchAfterKey = [Aeson.toJSON ("bitemyapp" :: String)]
129+ search = Search Nothing
130+ Nothing (Just [sortSpec]) Nothing Nothing
131+ False (From 0) (Size 10) SearchTypeQueryThenFetch (Just searchAfterKey)
132+ Nothing Nothing Nothing Nothing
133+ result <- searchTweets search
134+ let myTweet = grabFirst result
136+ myTweet `shouldBe` Right otherTweet