prepareSearch

fun prepareSearch(params: Params? = null): SearchQuery.Search<S>

Makes an immutable view of the search query. Be careful when using this method.

Note:

Returned SearchQuery.Search is just a view of the SearchQuery, thus changes in the search query are reflected in the SearchQuery.Search. Therefore SearchQuery.Search should only be used from the same thread as the underlying SearchQuery. If you really need to share SearchQuery.Search between threads you should clone the SearchQuery:

val search = searchQuery.clone().prepareSearch()