prepare

fun prepare(): PreparedSearchQuery<S>

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

Note:

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

val preparedQuery = searchQuery.clone().prepare()