## dzl-fuzzy-index-builder dzl-fuzzy-index-builder |

## Functions

DzlFuzzyIndexBuilder * | dzl_fuzzy_index_builder_new ()
gboolean | dzl_fuzzy_index_builder_get_case_sensitive ()
void | dzl_fuzzy_index_builder_set_case_sensitive ()
guint64 | dzl_fuzzy_index_builder_insert ()
gboolean | dzl_fuzzy_index_builder_write ()
void | dzl_fuzzy_index_builder_write_async ()
gboolean | dzl_fuzzy_index_builder_write_finish ()
const GVariant * | dzl_fuzzy_index_builder_get_document ()
void | dzl_fuzzy_index_builder_set_metadata ()
void | dzl_fuzzy_index_builder_set_metadata_string ()
void | dzl_fuzzy_index_builder_set_metadata_uint32 ()
void | dzl_fuzzy_index_builder_set_metadata_uint64 ()

## Properties

gboolean | case-sensitive | Read / Write

## Types and Values

#define | DZL_TYPE_FUZZY_INDEX_BUILDER
| DzlFuzzyIndexBuilder

## Object Hierarchy

        GObject
        ╰── DzlFuzzyIndexBuilder

## Description

## Functions

### dzl_fuzzy_index_builder_new ()

    DzlFuzzyIndexBuilder *
    dzl_fuzzy_index_builder_new (void);

### dzl_fuzzy_index_builder_get_case_sensitive ()

    gboolean
    dzl_fuzzy_index_builder_get_case_sensitive
                                   (DzlFuzzyIndexBuilder *self);

### dzl_fuzzy_index_builder_set_case_sensitive ()

    void
    dzl_fuzzy_index_builder_set_case_sensitive
                                   (DzlFuzzyIndexBuilder *self,
                                    gboolean case_sensitive);

### dzl_fuzzy_index_builder_insert ()

    guint64
    dzl_fuzzy_index_builder_insert (DzlFuzzyIndexBuilder *self,
                                    const gchar *key,
                                    GVariant *document,
                                    guint priority);

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.

#### Parameters

self | A DzlFuzzyIndexBuilder |
key | The UTF-8 encoded key for the document |
document | The document to store |
priority | An optional priority for the keyword. |

#### Returns

The document id registered for `document` .

### dzl_fuzzy_index_builder_write ()

    gboolean
    dzl_fuzzy_index_builder_write (DzlFuzzyIndexBuilder *self,
                                   GFile *file,
                                   gint io_priority,
                                   GCancellable *cancellable,
                                   GError **error);

### dzl_fuzzy_index_builder_write_async ()

    void
    dzl_fuzzy_index_builder_write_async (DzlFuzzyIndexBuilder *self,
                                         GFile *file,
                                         gint io_priority,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

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

#### Parameters

self | A DzlFuzzyIndexBuilder |
file | A GFile to write the index to |
io_priority | The priority for IO operations |
cancellable | An optional GCancellable or `NULL`. | [nullable]
callback | A callback for completion or `NULL` |
user_data | User data for `callback` |

### dzl_fuzzy_index_builder_write_finish ()

    gboolean
    dzl_fuzzy_index_builder_write_finish (DzlFuzzyIndexBuilder *self,
                                          GAsyncResult *result,
                                          GError **error);

### dzl_fuzzy_index_builder_get_document ()

    const GVariant *
    dzl_fuzzy_index_builder_get_document (DzlFuzzyIndexBuilder *self,
                                          guint64 document_id);

Returns the document that was inserted in a previous call to `dzl_fuzzy_index_builder_insert()`.

#### Returns

A GVariant.

[transfer none]

### dzl_fuzzy_index_builder_set_metadata ()

    void
    dzl_fuzzy_index_builder_set_metadata (DzlFuzzyIndexBuilder *self,
                                          const gchar *key,
                                          GVariant *value);

### dzl_fuzzy_index_builder_set_metadata_string ()

    void
    dzl_fuzzy_index_builder_set_metadata_string
                                   (DzlFuzzyIndexBuilder *self,
                                    const gchar *key,
                                    const gchar *value);

### dzl_fuzzy_index_builder_set_metadata_uint32 ()

    void
    dzl_fuzzy_index_builder_set_metadata_uint32
                                   (DzlFuzzyIndexBuilder *self,
                                    const gchar *key,
                                    guint32 value);

### dzl_fuzzy_index_builder_set_metadata_uint64 ()

    void
    dzl_fuzzy_index_builder_set_metadata_uint64
                                   (DzlFuzzyIndexBuilder *self,
                                    const gchar *key,
                                    guint64 value);

## Types and Values

### DZL_TYPE_FUZZY_INDEX_BUILDER

    #define DZL_TYPE_FUZZY_INDEX_BUILDER (dzl_fuzzy_index_builder_get_type())

### DzlFuzzyIndexBuilder

    typedef struct _DzlFuzzyIndexBuilder DzlFuzzyIndexBuilder;

## Property Details

### The `“case-sensitive”` property

      “case-sensitive”           gboolean

Case Sensitive.

Flags: Read / Write

Default value: FALSE