| XESAM GLib Reference Manual | ||||
|---|---|---|---|---|
XesamGSearch;
void xesam_g_search_start (XesamGSearch *search);
void xesam_g_search_close (XesamGSearch *search);
void xesam_g_search_continue (XesamGSearch *search);
guint xesam_g_search_get_total (XesamGSearch *search);
guint xesam_g_search_get_read (XesamGSearch *search);
void xesam_g_search_get_extended_data (XesamGSearch *search,
guint *hit_ids);
XesamGSession* xesam_g_search_get_session (XesamGSearch *search);
const gchar* xesam_g_search_get_id (XesamGSearch *search);
guint xesam_g_search_get_max_batch_size (XesamGSearch *search);
void xesam_g_search_set_max_batch_size (XesamGSearch *search,
guint max_size);
"closed" : Run Last "done" : Run Last "extended-data-ready" : Run Last "hits-added" : Run Last "hits-modified" : Run Last "hits-removed" : Run Last "ready" : Run Last "started" : Run Last
XesamGSearch is a client side representation of a search. A search is created via a XesamGSession object's xesam_g_session_new_search_from_text or xesam_g_session_new_search methods.
All communications with the search engine is completely asynchronous. When hits are available the XesamGSearch::hits-added signal will be emitted.
A search will not emit any hits before xesam_g_search_start has been called on it.
XesamGSearch is available since 1.0
void xesam_g_search_start (XesamGSearch *search);
Instruct the server to start a given search. No hits will be returned before this method has been invoked.
search : |
The search to start |
void xesam_g_search_close (XesamGSearch *search);
Close a search. The server is allowed to free all resources related to the search when this method is invoked.
A closed search is considered invalid for further use.
It is good pratice to close the search as soon as possible. However an unclosed search will also be closed when the last reference to it is dropped.
search : |
The search to close |
void xesam_g_search_continue (XesamGSearch *search);
Tell a XesamGSearch that it should continue to fetch hits after a XesamGSearch::hits-added signal has been emitted. This method is automatically called if you call any method on a XesamGHits object passed via the "hits-added" signal.
If you choose to ignore a XesamGHits object emitted with a "hits-added" you must manually call this method.
Under normal operations it is not necessary to use this method.
search : |
The search to continue fetching hits for |
guint xesam_g_search_get_total (XesamGSearch *search);
search : |
|
| Returns : |
void xesam_g_search_get_extended_data (XesamGSearch *search, guint *hit_ids);
Emits a XesamGSearch::extened-data-ready with a new XesamGHits object, when results are ready. Enriches hits with additional metadata as described by the session property XesamGSession::hit-fields-extended.
FIXME: It might be better to pass the actual hit objects as arguments. That way we can actual enrich the same hit objects.
FIXME: Not implemented.
search : |
The search to which the hit id's are relative. |
hit_ids : |
An array of hit ids as returned from xesam_g_hit_get_id. |
XesamGSession* xesam_g_search_get_session (XesamGSearch *search);
Look up the parent session for a search.
search : |
The search to llok up parent session for |
| Returns : | The parent session for the given search |
const gchar* xesam_g_search_get_id (XesamGSearch *search);
Get the unique id for a given search.
search : |
The search to get the id for. |
| Returns : | The id. Do not modify this pointer. |
guint xesam_g_search_get_max_batch_size (XesamGSearch *search);
Convenience method to get the value of the XesamGSearch:max-batch-size property.
search : |
The search to set the max batch size for |
| Returns : |
void xesam_g_search_set_max_batch_size (XesamGSearch *search, guint max_size);
search : |
|
max_size : |
max-batch-size" property"max-batch-size" guint : Read / Write
Maximum number of hits per XesamGHits object, batches can still contain less.
Default value: 20
void user_function (XesamGSearch *xesamgsearch, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *xesamgsearch, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *xesamgsearch, XesamGHits *arg1, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *search, XesamGHits *hits, gpointer user_data) : Run Last
Emitted when new hits are ready. The XesamGHits object is fully loaded with the new XesamGHit objects stored in memory.
To limit the number of hits fetched per hits-added signal use the XesamGSearch:max-batch-size property.
search : |
the object on which this signal is emitted |
hits : |
a XesamGHits object holding all the retrieved XesamGHit objects |
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *xesamgsearch, XesamGHits *arg1, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *xesamgsearch, XesamGHits *arg1, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *xesamgsearch, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (XesamGSearch *xesamgsearch, gpointer user_data) : Run Last
xesamgsearch : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |