60 std::function<void(
const std::string& callback_id, std::string json_payload)>;
76 void build(std::string dataset_id, std::vector<std::string> items,
77 std::string callback_id = {});
83 void query(std::string dataset_id, std::string query_text,
87 void release(
const std::string& dataset_id);
98 mutable std::mutex mutex;
99 std::map<std::string, std::shared_ptr<const runtime::SearchIndex>> indices;
101 std::shared_ptr<const runtime::SearchIndex> get(
const std::string&
id)
const;
107 bool put_unless_cancelled(
const std::string&
id,
108 std::shared_ptr<const runtime::SearchIndex> index,
110 void erase(
const std::string&
id);
111 std::size_t size()
const;
115 std::shared_ptr<Registry> registry_;
123 std::map<std::string, runtime::BackgroundJobHandle> active_queries_;
124 std::map<std::string, runtime::BackgroundJobHandle> active_builds_;
Definition background_job.hpp:87
QueryService(const QueryService &)=delete
QueryService & operator=(const QueryService &)=delete
void query(std::string dataset_id, std::string query_text, std::string callback_id, QueryOptions options={})
Search dataset_id off the UI thread.
void release(const std::string &dataset_id)
Drop a dataset's index. Frees the memory once no in-flight job holds it.
void build(std::string dataset_id, std::vector< std::string > items, std::string callback_id={})
Build (or replace) the index for dataset_id off the UI thread from items.
QueryService(DeliverFn deliver)
std::size_t dataset_count() const
Number of datasets with a currently-installed index (UI-thread view).
std::function< void(const std::string &callback_id, std::string json_payload)> DeliverFn
Delivers a completed result.
Definition query_service.hpp:59
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ cancel
Definition window_classes.hpp:126
Definition query_service.hpp:45
bool fuzzy
Definition query_service.hpp:47
std::size_t max_results
0 = unlimited
Definition query_service.hpp:46
bool case_sensitive
Definition query_service.hpp:48