search


Description:

public async ResultSet search (string query, TimeRange time_range, GenericArray<Event> event_templates, uint32 offset, uint32 num_events, ResultType result_type, Cancellable? cancellable = null) throws Error

Perform a full text search possibly restricted to a TimeRange 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().

Parameters:

query

The search string to send to Zeitgeist

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

event_templates

Restrict matches events to ones matching these templates

offset

Offset into the result set to read events from

num_events

Maximal number of events to retrieve

result_type

The ResultType determining the sort order. You may pass ResultType.RELEVANCY to this method to have the results ordered by relevancy calculated in relation to @query

cancellable

A GLib.Cancellable used to cancel the call or %NULL