Top |
GEnum ╰── XapianDatabaseAction GObject ╰── XapianDatabase ╰── XapianWritableDatabase
XapianWritableDatabase * xapian_writable_database_new (const char *path
,XapianDatabaseAction action
,GError **error
);
Creates and initialises a XapianWritableDatabase for the
given path
.
If the initialization was not successful, this function
returns NULL
and sets error
.
path |
the path of the database. |
[not nullable] |
action |
the action to perform |
|
error |
return location for a GError |
XapianWritableDatabase * xapian_writable_database_new_with_backend (const char *path
,XapianDatabaseAction action
,XapianDatabaseBackend backend
,GError **error
);
Creates and initialises a XapianWritableDatabase for the
given path
.
If the initialization was not successful, this function
returns NULL
and sets error
.
path |
the path of the database. |
[not nullable] |
action |
the action to perform |
|
backend |
the backend to use |
|
error |
return location for a GError |
XapianWritableDatabase * xapian_writable_database_new_full (const char *path
,XapianDatabaseAction action
,XapianDatabaseBackend backend
,XapianDatabaseFlags flags
,GError **error
);
Creates and initialises a XapianWritableDatabase for the
given path
.
If the initialization was not successful, this function
returns NULL
and sets error
.
path |
the path of the database. |
[not nullable] |
action |
the action to perform |
|
backend |
the backend to use |
|
flags |
flags to be used when opening the database |
|
error |
return location for a GError |
gboolean xapian_writable_database_commit (XapianWritableDatabase *self
,GError **error
);
Commits the pending changes of the database.
void xapian_writable_database_set_metadata (XapianWritableDatabase *self
,const char *key
,const char *value
);
Set the user-specified metadata associated with a given key.
This method sets the metadata value associated with a given key. If there is already a metadata value stored in the database with the same key, the old value is replaced. If you want to delete an existing item of metadata, just set its value to the empty string.
Since: 1.4
gboolean xapian_writable_database_begin_transaction (XapianWritableDatabase *self
,gboolean flushed
,GError **error
);
Begins a transaction in the database.
See also: xapian_writable_database_commit_transaction()
,
xapian_writable_database_cancel_transaction()
self |
||
flushed |
whether the transaction should be permanently stored in the database when committed, or if the transaction should only be applied to the database |
|
error |
return location for a GError |
gboolean xapian_writable_database_commit_transaction (XapianWritableDatabase *self
,GError **error
);
Commits the currently pending transaction.
If the transaction was started by passing TRUE
to the flushed
argument of xapian_writable_database_begin_transaction()
then all
the changes caused by the transaction will be permanently stored
inside the database.
In case of error, this function will return FALSE
and set error
.
gboolean xapian_writable_database_cancel_transaction (XapianWritableDatabase *self
,GError **error
);
Cancels the currently pending transaction.
gboolean xapian_writable_database_add_document (XapianWritableDatabase *self
,XapianDocument *document
,unsigned int *docid_out
,GError **error
);
Adds document
to a database.
self |
||
document |
a XapianDocument to add |
|
docid_out |
return location for the id of the newly added document. |
[out] |
error |
return location for a GError |
gboolean xapian_writable_database_delete_document (XapianWritableDatabase *self
,unsigned int docid
,GError **error
);
Deletes the document with the given docid
from a database.
gboolean xapian_writable_database_replace_document (XapianWritableDatabase *self
,unsigned int docid
,XapianDocument *document
,GError **error
);
Replaces the XapianDocument with docid
inside a
XapianWritableDatabase with the given document
.
void xapian_writable_database_add_spelling (XapianWritableDatabase *self
,const char *word
);
Add a word to the spelling dictionary with a default frequency increase of 1.
If the word is already present, its frequency is increased.
Since: 1.2
void xapian_writable_database_add_spelling_full (XapianWritableDatabase *self
,const char *word
,unsigned int freqinc
);
Add a word to the spelling dictionary.
If the word is already present, its frequency is increased.
Since: 1.2
void xapian_writable_database_remove_spelling (XapianWritableDatabase *self
,const char *word
);
Remove a word from the spelling dictionary.
The word's frequency is decreased by 1, and if would become zero or less then the word is removed completely.
Since: 1.2
void xapian_writable_database_remove_spelling_full (XapianWritableDatabase *self
,const char *word
,unsigned int freqdec
);
Remove a word from the spelling dictionary.
The word's frequency is decreased, and if would become zero or less then the word is removed completely.
Since: 1.2
“action”
property“action” XapianDatabaseAction
The action to be performed when creating a database.
Flags: Read / Write / Construct Only
Default value: XAPIAN_DATABASE_ACTION_CREATE_OR_OPEN