ZeitgeistIndex: Zeitgeist Reference Manual

## ZeitgeistIndex ZeitgeistIndex — Query the Zeitgeist Full Text Search Extension |

## Functions

void | zeitgeist_index_search ()
ZeitgeistResultSet * | zeitgeist_index_search_finish ()
void | zeitgeist_index_search_with_relevancies ()
ZeitgeistResultSet * | zeitgeist_index_search_with_relevancies_finish ()
ZeitgeistIndex * | zeitgeist_index_new ()

## Types and Values

#define | ZEITGEIST_TYPE_INDEX
struct | ZeitgeistIndex
struct | ZeitgeistIndexClass

## Object Hierarchy

        GObject
        ╰── ZeitgeistQueuedProxyWrapper
            ╰── ZeitgeistIndex

## Description

include: zeitgeist.h

## Functions

### zeitgeist_index_search ()

    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()`

#### Parameters

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 `zeitgeist_time_range_new_anytime()` as Zeitgeist will detect this and optimize the query accordingly . | [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 `query` . | [in]
cancellable | . A GCancellable used to cancel the call or `NULL` . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_index_search_finish ()

    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()`

#### Parameters

self | the ZeitgeistIndex instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### zeitgeist_index_search_with_relevancies ()

    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()`

#### Parameters

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 `zeitgeist_time_range_new_anytime()` as Zeitgeist will detect this and optimize the query accordingly . | [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 `NULL` . | [in][allow-none]
relevancies | . numeric relevancies of the events returned by result_set . | [out][array length=relevancies_length1]
relevancies_length1 | length of the `relevancies` array |
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### zeitgeist_index_search_with_relevancies_finish ()

    ZeitgeistResultSet *
    zeitgeist_index_search_with_relevancies_finish
                                   (ZeitgeistIndex *self,
                                    GAsyncResult *_res_,
                                    gdouble **relevancies,
                                    int *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()`

#### Parameters

self | the ZeitgeistIndex instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

#### Returns

ZeitgeistResultSet result_set.

### zeitgeist_index_new ()

    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()`.

## Types and Values

### ZEITGEIST_TYPE_INDEX

    #define ZEITGEIST_TYPE_INDEX (zeitgeist_index_get_type ())

The type for ZeitgeistIndex.

### struct ZeitgeistIndex

    struct ZeitgeistIndex;

Query the Zeitgeist Full Text Search Extension

include: zeitgeist.h

### struct ZeitgeistIndexClass

    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.

#### Members