| Top |
| XapianDatabase * | xapian_database_new () |
| XapianDatabase * | xapian_database_new_with_path () |
| void | xapian_database_close () |
| void | xapian_database_reopen () |
| char * | xapian_database_get_description () |
| char * | xapian_database_get_uuid () |
| char * | xapian_database_get_metadata () |
| unsigned int | xapian_database_get_doc_count () |
| unsigned int | xapian_database_get_last_doc_id () |
| double | xapian_database_get_average_length () |
| XapianDocument * | xapian_database_get_document () |
| unsigned int | xapian_database_get_term_freq () |
| unsigned int | xapian_database_get_collection_freq () |
| void | xapian_database_add_database () |
| void | xapian_database_compact_to_path () |
| void | xapian_database_compact_to_fd () |
| XapianTermIterator * | xapian_database_enumerate_all_terms () |
| XapianDatabaseBackend | backend | Read / Write / Construct Only |
| XapianDatabaseFlags | flags | Read / Write / Construct Only |
| guint64 | offset | Read / Write / Construct Only |
| gchar * | path | Read / Write / Construct Only |
| enum | XapianDatabaseFlags |
| enum | XapianDatabaseBackend |
| enum | XapianDatabaseCompactFlags |
GEnum ╰── XapianDatabaseBackend GFlags ├── XapianDatabaseCompactFlags ╰── XapianDatabaseFlags GObject ╰── XapianDatabase ╰── XapianWritableDatabase
XapianDatabase is a class that allows read-only access to a Xapian database at a given path.
Typically, you will use XapianDatabase to open a database for querying, by using the XapianEnquire class.
XapianDatabase *
xapian_database_new (GError **error);
Creates and initializes a new, empty XapianDatabase instance.
If the initialization was not successful, error
is set.
the newly created XapianDatabase instance,
or NULL if the initialization failed.
[transfer full]
XapianDatabase * xapian_database_new_with_path (const char *path,GError **error);
Creates and initializes a new XapianDatabase at path
.
If the initialization was not successful, error
is set.
the newly created XapianDatabase instance
for the given path
, or NULL if the initialization failed.
[transfer full]
void
xapian_database_close (XapianDatabase *db);
Explicitly closes a database.
XapianDatabase instances are implicitly closed when being finalized, so you'll rarely need to call this function.
void
xapian_database_reopen (XapianDatabase *db);
Reopens a XapianDatabase.
Since: 1.2
char *
xapian_database_get_description (XapianDatabase *db);
Retrieves a string describing the XapianDatabase.
Typically, this function is used when debugging.
char *
xapian_database_get_uuid (XapianDatabase *db);
Retrieves a unique identifier for a XapianDatabase.
char * xapian_database_get_metadata (XapianDatabase *db,const char *key,GError **error);
Retrieves custom metadata associated to a key inside the XapianDatabase.
In case of error, this function returns NULL and sets
the error
argument.
unsigned int
xapian_database_get_doc_count (XapianDatabase *db);
Retrieves the number of documents in the database.
unsigned int
xapian_database_get_last_doc_id (XapianDatabase *db);
Retrieves the highest document id in use in the database
double
xapian_database_get_average_length (XapianDatabase *db);
Retrieves the average document length in the database
Since: 1.4
XapianDocument * xapian_database_get_document (XapianDatabase *db,unsigned int docid,GError **error);
Retrieves the XapianDocument with the given docid
inside
the database.
If the docid
was not found, error
is set and NULL is
returned.
unsigned int xapian_database_get_term_freq (XapianDatabase *db,const char *term);
Retrieves the term frequency for term
, i.e. the number of different
documents that term indexes.
Since: 1.4
unsigned int xapian_database_get_collection_freq (XapianDatabase *db,const char *term);
Retrieves the collection frequency for term
, i.e. the total number of
times that the term occurs in all documents in the collection.
Since: 1.4
void xapian_database_add_database (XapianDatabase *db,XapianDatabase *new_db);
Adds an existing database (or group of databases) to those
accessed by db
.
void xapian_database_compact_to_path (XapianDatabase *self,const char *path,XapianDatabaseCompactFlags flags);
Compacts the database, and writes the result to the given path.
self |
||
path |
The path to write the compacted database to. |
|
flags |
Flags to compact the database with. |
Since: 1.4
void xapian_database_compact_to_fd (XapianDatabase *self,int fd,XapianDatabaseCompactFlags flags);
Compacts the database, and writes the result to the given fd.
self |
||
fd |
The fd to write the compacted database. |
|
flags |
Flags to compact the database with. |
Since: 1.4
XapianTermIterator * xapian_database_enumerate_all_terms (XapianDatabase *self,const char *prefix);
Start iterating over all terms in the database, optionally restricted to terms with the specified prefix.
Since: 1.4
Flags used when opening a database
|
No flags |
||
|
Do not sync changes to disk |
||
|
Attempt to fully sync changes to disk |
||
|
Update the database in-place |
||
|
Do not create a termlist table |
||
|
Retry the lock |
Since: 1.4
The Xapian database backend to use when opening a database.
Since: 1.4
“backend” property“backend” XapianDatabaseBackend
The backend to use when opening the database.
Flags: Read / Write / Construct Only
Default value: XAPIAN_DATABASE_BACKEND_DEFAULT
Since: 1.4
“flags” property“flags” XapianDatabaseFlags
The flags to use when opening the database.
Flags: Read / Write / Construct Only
Since: 1.4
“offset” property“offset” guint64
The offset inside the database file.
Flags: Read / Write / Construct Only
Default value: 0
Since: 1.4
“path” property“path” gchar *
The path to the database directory.
Flags: Read / Write / Construct Only
Default value: NULL