diff --git a/Data/SearchEngine/Autosuggest.hs b/Data/SearchEngine/Autosuggest.hs
--- a/Data/SearchEngine/Autosuggest.hs
+++ b/Data/SearchEngine/Autosuggest.hs
@@ -238,6 +238,7 @@
     --
     carefulUnions :: [DocIdSet] -> Maybe DocIdSet
     carefulUnions dss
+      | null dss  = Just DocIdSet.empty
       | null dss' = Nothing
       | otherwise = Just (DocIdSet.unions dss')
       where
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+0.2.2.2 Adam Gundry <adam@well-typed.com> March 2023
+	* Fix bug in 0.2.2.1 autosuggest patch
+
 0.2.2.1 Adam Gundry <adam@well-typed.com> March 2023
 	* Fix autosuggest query performance bug on large datasets
 
diff --git a/full-text-search.cabal b/full-text-search.cabal
--- a/full-text-search.cabal
+++ b/full-text-search.cabal
@@ -1,5 +1,5 @@
 name:                full-text-search
-version:             0.2.2.1
+version:             0.2.2.2
 synopsis:            In-memory full text search engine
 description:         An in-memory full text search engine library. It lets you
                      run full-text queries on a collection of your documents.
