xapian-core
1.5.0
|
Compact a database, or merge and compact several. More...
Public Types | |
enum | compaction_level { STANDARD = 0, FULL = 1, FULLER = 2 } |
Compaction level. More... | |
Public Member Functions | |
virtual void | set_status (const std::string &table, const std::string &status) |
Update progress. More... | |
virtual std::string | resolve_duplicate_metadata (const std::string &key, size_t num_tags, const std::string tags[]) |
Resolve multiple user metadata entries with the same key. More... | |
Compact a database, or merge and compact several.
|
virtual |
Resolve multiple user metadata entries with the same key.
When merging, if the same user metadata key is set in more than one input, then this method is called to allow this to be resolving in an appropriate way.
The default implementation just returns tags[0].
For multipass this will currently get called multiple times for the same key if there are duplicates to resolve in each pass, but this may change in the future.
Since 1.4.6, an implementation of this method can return an empty string to indicate that the appropriate result is to not set a value for this user metadata key in the output database. In older versions, you should not return an empty string.
key | The metadata key with duplicate entries. |
num_tags | How many tags there are. |
tags | An array of num_tags strings containing the tags to merge. |
|
virtual |
Update progress.
Subclass this method if you want to get progress updates during compaction. This is called for each table first with empty status, And then one or more times with non-empty status.
The default implementation does nothing.
table | The table currently being compacted. |
status | A status message. |