bloodhound-0.24.0.0: Elasticsearch client library for Haskell
Copyright(C) 2014 2018 Chris Allen
LicenseBSD-style (see the file LICENSE)
MaintainerChris Allen <cma@bitemyapp.com>
Stabilityprovisional
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Database.Bloodhound.Dynamic.Client

Description

Dynamically route the query depending on the backend.

withFetchedBackendType $ backend ->
  pitSearch backend index search
Synopsis

Documentation

withFetchedBackendType :: MonadBH m => (forall (backend :: BackendType). SBackendType backend -> m a) -> m a Source #

Fetch the currently running backend and run backend-dependent code

pitSearch :: forall a m (backend :: BackendType). (FromJSON a, MonadBH m) => SBackendType backend -> IndexName -> Search -> m [Hit a] Source #

pitSearch uses the point in time (PIT) API of elastic, for a given IndexName. Requires Elasticsearch >=7.10 or OpenSearch >=2. Note that this will consume the entire search result set and will be doing O(n) list appends so this may not be suitable for large result sets. In that case, the point in time API should be used directly with openPointInTime and closePointInTime.

Note that pitSearch utilizes the search_after parameter under the hood, which requires a non-empty sortBody field in the provided Search value. Otherwise, pitSearch will fail to return all matching documents.

For more information see https://opensearch.org/docs/latest/search-plugins/point-in-time/.