Dazzle.FuzzyIndexBuilder

g Dazzle.FuzzyIndexBuilder Dazzle.FuzzyIndexBuilder GObject.Object GObject.Object GObject.Object->Dazzle.FuzzyIndexBuilder

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_case_sensitive ()

get_document (document_id)

insert (key, document, priority)

set_case_sensitive (case_sensitive)

set_metadata (key, value)

set_metadata_string (key, value)

set_metadata_uint32 (key, value)

set_metadata_uint64 (key, value)

write (file, io_priority, cancellable)

write_async (file, io_priority, cancellable, callback, *user_data)

write_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

case-sensitive

bool

r/w

Case Sensitive

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Dazzle.FuzzyIndexBuilder(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Dazzle.FuzzyIndexBuilderClass

classmethod new()
Return type:

Dazzle.FuzzyIndexBuilder

get_case_sensitive()
Return type:

bool

get_document(document_id)
Parameters:

document_id (int) –

Returns:

A GLib.Variant

Return type:

GLib.Variant

Returns the document that was inserted in a previous call to Dazzle.FuzzyIndexBuilder.insert().

insert(key, document, priority)
Parameters:
  • key (str) – The UTF-8 encoded key for the document

  • document (GLib.Variant) – The document to store

  • priority (int) – An optional priority for the keyword.

Returns:

The document id registered for document.

Return type:

int

Inserts document into the index using key as the lookup key.

If a matching document (checked by hashing document) has already been inserted, only a single instance of the document will be stored.

If document is floating, it will be consumed.

priority may be used to group results by priority. Priority must be less than 256.

set_case_sensitive(case_sensitive)
Parameters:

case_sensitive (bool) –

set_metadata(key, value)
Parameters:
set_metadata_string(key, value)
Parameters:
  • key (str) –

  • value (str) –

set_metadata_uint32(key, value)
Parameters:
  • key (str) –

  • value (int) –

set_metadata_uint64(key, value)
Parameters:
  • key (str) –

  • value (int) –

write(file, io_priority, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

write_async(file, io_priority, cancellable, callback, *user_data)
Parameters:

Builds and writes the index to file. The file format is a GLib.Variant on disk and can be loaded and searched using #FuzzyIndex.

write_finish(result)
Parameters:

result (Gio.AsyncResult) –

Raises:

GLib.Error

Return type:

bool

Property Details

Dazzle.FuzzyIndexBuilder.props.case_sensitive
Name:

case-sensitive

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Case Sensitive