1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>ZeitgeistIndex</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
<link rel="home" href="index.html" title="API Documentation for the Zeitgeist Client Library">
8
<link rel="up" href="ch04.html" title="API for Zeitgeist Extensions">
9
<link rel="prev" href="ch04.html" title="API for Zeitgeist Extensions">
10
<link rel="next" href="ZeitgeistDataSource.html" title="ZeitgeistDataSource">
11
<meta name="generator" content="GTK-Doc V1.16 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="ch04.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="ch04.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">API Documentation for the Zeitgeist Client Library</th>
21
<td><a accesskey="n" href="ZeitgeistDataSource.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#ZeitgeistIndex.synopsis" class="shortcut">Top</a>
26
<a href="#ZeitgeistIndex.description" class="shortcut">Description</a>
28
<a href="#ZeitgeistIndex.object-hierarchy" class="shortcut">Object Hierarchy</a>
31
<div class="refentry">
32
<a name="ZeitgeistIndex"></a><div class="titlepage"></div>
33
<div class="refnamediv"><table width="100%"><tr>
35
<h2><span class="refentrytitle"><a name="ZeitgeistIndex.top_of_page"></a>ZeitgeistIndex</span></h2>
36
<p>ZeitgeistIndex — Query the Zeitgeist Full Text Search Extension</p>
38
<td valign="top" align="right"></td>
40
<div class="refsynopsisdiv">
41
<a name="ZeitgeistIndex.synopsis"></a><h2>Synopsis</h2>
42
<pre class="synopsis">
43
#include <zeitgeist.h>
45
<a class="link" href="ZeitgeistIndex.html#ZeitgeistIndex-struct" title="ZeitgeistIndex">ZeitgeistIndex</a>;
46
struct <a class="link" href="ZeitgeistIndex.html#ZeitgeistIndexClass" title="struct ZeitgeistIndexClass">ZeitgeistIndexClass</a>;
47
<a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="returnvalue">ZeitgeistIndex</span></a> * <a class="link" href="ZeitgeistIndex.html#zeitgeist-index-new" title="zeitgeist_index_new ()">zeitgeist_index_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
48
<span class="returnvalue">void</span> <a class="link" href="ZeitgeistIndex.html#zeitgeist-index-search" title="zeitgeist_index_search ()">zeitgeist_index_search</a> (<em class="parameter"><code><a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> *self</code></em>,
49
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *query</code></em>,
50
<em class="parameter"><code><a class="link" href="ZeitgeistTimeRange.html" title="ZeitgeistTimeRange"><span class="type">ZeitgeistTimeRange</span></a> *time_range</code></em>,
51
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *event_templates</code></em>,
52
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> offset</code></em>,
53
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> num_events</code></em>,
54
<em class="parameter"><code><a class="link" href="zeitgeist-1.0-Enumerations.html#ZeitgeistResultType"><span class="type">ZeitgeistResultType</span></a> result_type</code></em>,
55
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
56
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
57
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
58
<a class="link" href="ZeitgeistResultSet.html" title="ZeitgeistResultSet"><span class="returnvalue">ZeitgeistResultSet</span></a> * <a class="link" href="ZeitgeistIndex.html#zeitgeist-index-search-finish" title="zeitgeist_index_search_finish ()">zeitgeist_index_search_finish</a> (<em class="parameter"><code><a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> *self</code></em>,
59
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *res</code></em>,
60
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
63
<div class="refsect1">
64
<a name="ZeitgeistIndex.object-hierarchy"></a><h2>Object Hierarchy</h2>
65
<pre class="synopsis">
66
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
70
<div class="refsect1">
71
<a name="ZeitgeistIndex.description"></a><h2>Description</h2>
73
<div class="refsect1">
74
<a name="ZeitgeistIndex.details"></a><h2>Details</h2>
75
<div class="refsect2">
76
<a name="ZeitgeistIndex-struct"></a><h3>ZeitgeistIndex</h3>
77
<pre class="programlisting">typedef struct _ZeitgeistIndex ZeitgeistIndex;</pre>
82
<div class="refsect2">
83
<a name="ZeitgeistIndexClass"></a><h3>struct ZeitgeistIndexClass</h3>
84
<pre class="programlisting">struct ZeitgeistIndexClass {
85
GObjectClass parent_class;
92
<div class="refsect2">
93
<a name="zeitgeist-index-new"></a><h3>zeitgeist_index_new ()</h3>
94
<pre class="programlisting"><a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="returnvalue">ZeitgeistIndex</span></a> * zeitgeist_index_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
96
Create a new <a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> instance. The index will start to connect to
97
Zeitgeist asynchronously. You can however start calling methods on the
98
returned instance immediately, any method calls issued before the connection
99
has been established will simply be queued and executed once the connection
102
<div class="variablelist"><table border="0">
103
<col align="left" valign="top">
105
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
106
<td>A reference to a newly allocated index. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</td>
111
<div class="refsect2">
112
<a name="zeitgeist-index-search"></a><h3>zeitgeist_index_search ()</h3>
113
<pre class="programlisting"><span class="returnvalue">void</span> zeitgeist_index_search (<em class="parameter"><code><a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> *self</code></em>,
114
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *query</code></em>,
115
<em class="parameter"><code><a class="link" href="ZeitgeistTimeRange.html" title="ZeitgeistTimeRange"><span class="type">ZeitgeistTimeRange</span></a> *time_range</code></em>,
116
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *event_templates</code></em>,
117
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> offset</code></em>,
118
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> num_events</code></em>,
119
<em class="parameter"><code><a class="link" href="zeitgeist-1.0-Enumerations.html#ZeitgeistResultType"><span class="type">ZeitgeistResultType</span></a> result_type</code></em>,
120
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
121
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
122
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
124
Perform a full text search possibly restricted to a <a class="link" href="ZeitgeistTimeRange.html" title="ZeitgeistTimeRange"><span class="type">ZeitgeistTimeRange</span></a>
125
and/or set of event templates.
128
The default boolean operator is <code class="literal">AND</code>. Thus the query
129
<span class="emphasis"><em>foo bar</em></span> will be interpreted as
130
<span class="emphasis"><em>foo AND bar</em></span>. To exclude a term from the result
131
set prepend it with a minus sign - eg <span class="emphasis"><em>foo -bar</em></span>.
132
Phrase queries can be done by double quoting the string
133
<span class="emphasis"><em>"foo is a bar"</em></span>. You can truncate terms by appending
137
There are a few keys you can prefix to a term or phrase to search within
138
a specific set of metadata. They are used like
139
<span class="emphasis"><em>key:value</em></span>. The keys <span class="emphasis"><em>name</em></span> and
140
<span class="emphasis"><em>title</em></span> search strictly within the text field of the
141
event subjects. The key <span class="emphasis"><em>app</em></span> searches within the
142
application name or description that is found in the actor attribute of
143
the events. Lastly you can use the <span class="emphasis"><em>site</em></span> key to search
144
within the domain name of the subject URIs.
147
You can also control the results with the boolean operators
148
<span class="emphasis"><em>AND</em></span> and <span class="emphasis"><em>OR</em></span> and you may
149
use brackets, ( and ), to control the operator precedence.
151
<div class="variablelist"><table border="0">
152
<col align="left" valign="top">
155
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
156
<td>The <a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> you want to query</td>
159
<td><p><span class="term"><em class="parameter"><code>query</code></em> :</span></p></td>
160
<td>The search string to send to Zeitgeist</td>
163
<td><p><span class="term"><em class="parameter"><code>time_range</code></em> :</span></p></td>
164
<td>Restrict matched events to ones within this time range. If you
165
are not interested in restricting the timerange pass
166
<a class="link" href="ZeitgeistTimeRange.html#zeitgeist-time-range-new-anytime" title="zeitgeist_time_range_new_anytime ()"><code class="function">zeitgeist_time_range_new_anytime()</code></a> as Zeitgeist will detect this
167
and optimize the query accordingly</td>
170
<td><p><span class="term"><em class="parameter"><code>event_templates</code></em> :</span></p></td>
171
<td>Restrict matches events to ones matching these
175
<td><p><span class="term"><em class="parameter"><code>offset</code></em> :</span></p></td>
176
<td>Offset into the result set to read events from</td>
179
<td><p><span class="term"><em class="parameter"><code>num_events</code></em> :</span></p></td>
180
<td>Maximal number of events to retrieve</td>
183
<td><p><span class="term"><em class="parameter"><code>result_type</code></em> :</span></p></td>
184
<td>The <a class="link" href="zeitgeist-1.0-Enumerations.html#ZeitgeistResultType"><span class="type">ZeitgeistResultType</span></a> determining the sort order.
185
You may pass <a class="link" href="zeitgeist-1.0-Enumerations.html#ZEITGEIST-RESULT-TYPE-RELEVANCY:CAPS"><span class="type">ZEITGEIST_RESULT_TYPE_RELEVANCY</span></a> to this method
186
to have the results ordered by relevancy calculated in relation
187
to <em class="parameter"><code>query</code></em>
191
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
192
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> used to cancel the call or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
196
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
197
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> to invoke when the search results are ready</td>
200
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
201
<td>User data to pass back with <em class="parameter"><code>callback</code></em>
208
<div class="refsect2">
209
<a name="zeitgeist-index-search-finish"></a><h3>zeitgeist_index_search_finish ()</h3>
210
<pre class="programlisting"><a class="link" href="ZeitgeistResultSet.html" title="ZeitgeistResultSet"><span class="returnvalue">ZeitgeistResultSet</span></a> * zeitgeist_index_search_finish (<em class="parameter"><code><a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> *self</code></em>,
211
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *res</code></em>,
212
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
214
Retrieve the result from an asynchronous query started with
215
<a class="link" href="ZeitgeistIndex.html#zeitgeist-index-search" title="zeitgeist_index_search ()"><code class="function">zeitgeist_index_search()</code></a>.
218
The total hit count of the query will be avilable via the returned
219
result set by calling <a class="link" href="ZeitgeistResultSet.html#zeitgeist-result-set-estimated-matches" title="zeitgeist_result_set_estimated_matches ()"><code class="function">zeitgeist_result_set_estimated_matches()</code></a>. This will
220
often be bigger than actual number of events held in the result set, which
221
is limited by the <em class="parameter"><code>num_events</code></em> paramter passed to <a class="link" href="ZeitgeistIndex.html#zeitgeist-index-search" title="zeitgeist_index_search ()"><code class="function">zeitgeist_index_search()</code></a>.
223
<div class="variablelist"><table border="0">
224
<col align="left" valign="top">
227
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
228
<td>The <a class="link" href="ZeitgeistIndex.html" title="ZeitgeistIndex"><span class="type">ZeitgeistIndex</span></a> to retrieve results from</td>
231
<td><p><span class="term"><em class="parameter"><code>res</code></em> :</span></p></td>
232
<td>The <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> you received in the <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> you passed
233
to <a class="link" href="ZeitgeistIndex.html#zeitgeist-index-search" title="zeitgeist_index_search ()"><code class="function">zeitgeist_index_search()</code></a>
237
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
238
<td>A place to store a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in case you want to ignore errors</td>
241
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
242
<td>A newly allocated <a class="link" href="ZeitgeistResultSet.html" title="ZeitgeistResultSet"><span class="type">ZeitgeistResultSet</span></a> containing the
243
<a class="link" href="ZeitgeistEvent.html" title="ZeitgeistEvent"><span class="type">ZeitgeistEvent</span></a>s matching the query. You must free the
244
result set with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. The events held in the result set
245
will automatically be unreffed when it is finalized.</td>
254
Generated by GTK-Doc V1.16</div>
b'\\ No newline at end of file'