Top |
void zeitgeist_index_search (ZeitgeistIndex *self
,const gchar *query
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,guint32 offset
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Perform a full text search possibly restricted to a ZeitgeistTimeRange and/or set of event templates.
The default boolean operator is AND
. Thus the query foo bar will be interpreted as foo AND bar. To exclude a term from the result set prepend it with a minus sign - eg. foo -bar. Phrase queries can be done by double quoting the string "foo is a bar". You can truncate terms by appending a *.
There are a few keys you can prefix to a term or phrase to search within a specific set of metadata. They are used like key:value. The keys name and title search strictly within the text field of the event subjects. The key app searches within the application name or description that is found in the actor attribute of the events. Lastly, you can use the site key to search within the domain name of subject URIs.
You can also control the results with the boolean operators AND and OR and you may use brackets, ( and ), to control the operator precedence.
FIXME: how do we put documentation into _finish? The total hit count of the query will be available via the returned result set by calling zeitgeist_result_set_estimated_matches()
. This will often be bigger than the actual number of events held in the result set, which is limited by the num_events
parameter passed to zeitgeist_index_search()
.
See also: zeitgeist_index_search_finish()
self |
the ZeitgeistIndex instance |
|
query |
. The search string to send to Zeitgeist . |
[in] |
time_range |
. Restrict matched events to ones within this time range. If you are not interested in restricting the timerange pass . |
[in] |
event_templates |
. Restrict matches events to ones matching these templates . |
[in] |
offset |
. Offset into the result set to read events from . |
[in] |
num_events |
. Maximal number of events to retrieve . |
[in] |
result_type |
. The ZeitgeistResultType determining the sort order. You may pass ZEITGEIST_RESULT_TYPE_RELEVANCY to this method to have the results ordered by relevancy calculated in relation to . |
[in] |
cancellable |
. A GCancellable used to cancel the call or . |
[in][allow-none] |
_callback_ |
callback to call when the request is satisfied. |
[scope async] |
_user_data_ |
the data to pass to |
[closure] |
ZeitgeistResultSet * zeitgeist_index_search_finish (ZeitgeistIndex *self
,GAsyncResult *_res_
,GError **error
);
Perform a full text search possibly restricted to a ZeitgeistTimeRange and/or set of event templates.
The default boolean operator is AND
. Thus the query foo bar will be interpreted as foo AND bar. To exclude a term from the result set prepend it with a minus sign - eg. foo -bar. Phrase queries can be done by double quoting the string "foo is a bar". You can truncate terms by appending a *.
There are a few keys you can prefix to a term or phrase to search within a specific set of metadata. They are used like key:value. The keys name and title search strictly within the text field of the event subjects. The key app searches within the application name or description that is found in the actor attribute of the events. Lastly, you can use the site key to search within the domain name of subject URIs.
You can also control the results with the boolean operators AND and OR and you may use brackets, ( and ), to control the operator precedence.
FIXME: how do we put documentation into _finish? The total hit count of the query will be available via the returned result set by calling zeitgeist_result_set_estimated_matches()
. This will often be bigger than the actual number of events held in the result set, which is limited by the num_events
parameter passed to zeitgeist_index_search()
.
See also: zeitgeist_index_search()
self |
the ZeitgeistIndex instance |
|
_res_ |
||
error |
location to store the error occurring, or |
void zeitgeist_index_search_with_relevancies (ZeitgeistIndex *self
,const gchar *query
,ZeitgeistTimeRange *time_range
,GPtrArray *event_templates
,ZeitgeistStorageState storage_state
,guint32 offset
,guint32 num_events
,ZeitgeistResultType result_type
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Perform a full text search possibly restricted to a ZeitgeistTimeRange and/or set of event templates. As opposed to zeitgeist_index_search()
, this call will also return numeric relevancies of the events in the ZeitgeistResultSet.
See zeitgeist_index_search()
for more details on how to create the query.
See also: zeitgeist_index_search_with_relevancies_finish()
self |
the ZeitgeistIndex instance |
|
query |
. The search string to send to Zeitgeist . |
[in] |
time_range |
. Restrict matched events to ones within this time range. If you are not interested in restricting the timerange pass . |
[in] |
event_templates |
. Restrict matched events to ones matching these templates . |
[in] |
storage_state |
. Filter the events by availability of the storage medium. . |
[in] |
offset |
. Offset into the result set to read events from . |
[in] |
num_events |
. Maximal number of events to retrieve . |
[in] |
result_type |
. The ZeitgeistResultType determining the sort order You may pass ZEITGEIST_RESULT_TYPE_RELEVANCY to this method to have the results ordered by relevancy calculated in relation to "query" . |
[in] |
cancellable |
. a GCancellable to cancel the operation or . |
[in][allow-none] |
relevancies |
. numeric relevancies of the events returned by result_set . |
[out][array length=relevancies_length1] |
relevancies_length1 |
length of the |
|
_callback_ |
callback to call when the request is satisfied. |
[scope async] |
_user_data_ |
the data to pass to |
[closure] |
ZeitgeistResultSet * zeitgeist_index_search_with_relevancies_finish (ZeitgeistIndex *self
,GAsyncResult *_res_
,gdouble **relevancies
,gint *relevancies_length1
,GError **error
);
Perform a full text search possibly restricted to a ZeitgeistTimeRange and/or set of event templates. As opposed to zeitgeist_index_search()
, this call will also return numeric relevancies of the events in the ZeitgeistResultSet.
See zeitgeist_index_search()
for more details on how to create the query.
See also: zeitgeist_index_search_with_relevancies()
self |
the ZeitgeistIndex instance |
|
_res_ |
||
error |
location to store the error occurring, or |
ZeitgeistIndex *
zeitgeist_index_new (void
);
Create a new index that interfaces with the default event index of the Zeitgeist daemon.
Create a new zeitgeist_index_new()
instance. The index will start to connect to Zeitgeist asynchronously. You can however start calling methods on the returned instance immediately, any method calls issued before the connection has been established will simply be queued and executed once the connection is up.
Returns: A reference to a newly allocated index. Free with g_object_unref()
.
#define ZEITGEIST_TYPE_INDEX (zeitgeist_index_get_type ())
The type for ZeitgeistIndex.
struct ZeitgeistIndex;
Query the Zeitgeist Full Text Search Extension
include: zeitgeist.h
struct ZeitgeistIndexClass { ZeitgeistQueuedProxyWrapperClass parent_class; };
The class structure for ZEITGEIST_TYPE_INDEX
. All the fields in this structure are private and should never be accessed directly.