Dazzle.FuzzyIndexBuilder¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Case Sensitive |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Dazzle.FuzzyIndexBuilder(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Return type:
- get_document(document_id)¶
- Parameters:
document_id (
int
) –- Returns:
- Return type:
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 documentdocument (
GLib.Variant
) – The document to storepriority (
int
) – An optional priority for the keyword.
- Returns:
The document id registered for document.
- Return type:
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_metadata(key, value)¶
- Parameters:
key (
str
) –value (
GLib.Variant
) –
- write(file, io_priority, cancellable)¶
- Parameters:
file (
Gio.File
) –io_priority (
int
) –cancellable (
Gio.Cancellable
orNone
) –
- Raises:
- Return type:
- write_async(file, io_priority, cancellable, callback, *user_data)¶
- Parameters:
io_priority (
int
) – The priority for IO operationscancellable (
Gio.Cancellable
orNone
) – An optionalGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – A callback for completion orNone
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:
- Return type: