Fix subtle bug in searchTableNgrams

This commit fixes a bug (or feature? unclear at this stage) of the
`rootOf` function inside `searchTableNgrams`, which could, in some
occasion, return a root which has a different `ListType`, which
in turn throws off pagination.
3 jobs for adinapoli/issue-incorrect-pagination in 26 minutes and 52 seconds (queued for 4 seconds)
latest
Status Job ID Name Coverage
  Test
failed #6809
deps

00:08:44

failed #6810
docs

00:08:27

failed #6811
test

00:09:39

 
Name Stage Failure
failed
test Test
servant-job                      > Installing executable servant-job-calc-example in /builds/gargantext/haskell-gargantext/.stack-root/snapshots/x86_64-linux/0cba99fdc67ff1c8a7c28861c60a087262b84a01c40e03efa02dcd0155b6cc02/8.10.6/bin
servant-job > Installing executable servant-job-scrapy-example in /builds/gargantext/haskell-gargantext/.stack-root/snapshots/x86_64-linux/0cba99fdc67ff1c8a7c28861c60a087262b84a01c40e03efa02dcd0155b6cc02/8.10.6/bin
servant-job > Registering library for servant-job-0.2.0.0..

-- While building package haskell-igraph-0.10.4 (scroll up to its section to see the error) using:
/builds/gargantext/haskell-gargantext/.stack-root/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.6 --builddir=.stack-work/dist/x86_64-linux/Cabal-3.2.1.0 build --ghc-options ""
Process exited with code: ExitFailure 1
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
docs Test
opaleye                          > copy/register
opaleye > Installing library in /builds/gargantext/haskell-gargantext/.stack-root/snapshots/x86_64-linux/0cba99fdc67ff1c8a7c28861c60a087262b84a01c40e03efa02dcd0155b6cc02/8.10.6/lib/x86_64-linux-ghc-8.10.6/opaleye-0.9.6.1-HdhlDzSoohPEf7LIKQK9I4
opaleye > Registering library for opaleye-0.9.6.1..

-- While building package haskell-igraph-0.10.4 (scroll up to its section to see the error) using:
/builds/gargantext/haskell-gargantext/.stack-root/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.6 --builddir=.stack-work/dist/x86_64-linux/Cabal-3.2.1.0 build --ghc-options ""
Process exited with code: ExitFailure 1
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
deps Test
opaleye                          > copy/register
opaleye > Installing library in /builds/gargantext/haskell-gargantext/.stack-root/snapshots/x86_64-linux/0cba99fdc67ff1c8a7c28861c60a087262b84a01c40e03efa02dcd0155b6cc02/8.10.6/lib/x86_64-linux-ghc-8.10.6/opaleye-0.9.6.1-HdhlDzSoohPEf7LIKQK9I4
opaleye > Registering library for opaleye-0.9.6.1..

-- While building package haskell-igraph-0.10.4 (scroll up to its section to see the error) using:
/builds/gargantext/haskell-gargantext/.stack-root/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.6 --builddir=.stack-work/dist/x86_64-linux/Cabal-3.2.1.0 build --ghc-options ""
Process exited with code: ExitFailure 1
Cleaning up file based variables
ERROR: Job failed: exit code 1