Top |
XapianEnquire * | xapian_enquire_new () |
void | xapian_enquire_set_query () |
XapianQuery * | xapian_enquire_get_query () |
void | xapian_enquire_set_collapse_key () |
void | xapian_enquire_set_collapse_key_full () |
void | xapian_enquire_set_cutoff () |
void | xapian_enquire_set_cutoff_full () |
void | xapian_enquire_set_sort_by_value () |
XapianMSet * | xapian_enquire_get_mset () |
XapianEnquire is a class used to perform queries on XapianDatabase.
Typically, you create a new XapianEnquire instance for a specific XapianDatabase (which may contain multiple groups of databases), and assign a XapianQuery to the XapianEnquire instance; then you retrieve the set of matching documents through XapianMSet.
XapianEnquire * xapian_enquire_new (XapianDatabase *db
,GError **error
);
Creates and initializes a new XapianEnquire instance for the given XapianDatabase.
If the initializion failed, error
is set, and this function
will return NULL
.
void xapian_enquire_set_query (XapianEnquire *enquire
,XapianQuery *query
,unsigned int qlen
);
Sets the XapianQuery for the XapianEnquire instance.
XapianQuery *
xapian_enquire_get_query (XapianEnquire *enquire
);
Retrieves the XapianQuery set using xapian_enquire_set_query()
.
void xapian_enquire_set_collapse_key (XapianEnquire *enquire
,unsigned int collapse_key
);
Sets the collapse key for the XapianEnquire instance with the default collapse_max value of 1.
Since: 1.2
void xapian_enquire_set_collapse_key_full (XapianEnquire *enquire
,unsigned int collapse_key
,unsigned int collapse_max
);
Sets the collapse key for the XapianEnquire instance.
enquire |
||
collapse_key |
value number to collapse on |
|
collapse_max |
Max number of items with the same key to leave after collapsing |
Since: 1.2
void xapian_enquire_set_cutoff (XapianEnquire *enquire
,gfloat percent_cutoff
);
Set the percentage cutoffs with no weight cutoff.
enquire |
||
percent_cutoff |
Minimum percentage score for returned documents. If a document has a lower percentage score than this, it will not appear in the MSet. |
Since: 1.2
void xapian_enquire_set_cutoff_full (XapianEnquire *enquire
,gfloat percent_cutoff
,unsigned int weight_cutoff
);
Set the percentage and weight cutoffs.
enquire |
||
percent_cutoff |
Minimum percentage score for returned documents. If a document has a lower percentage score than this, it will not appear in the MSet. |
|
weight_cutoff |
Minimum weight for a document to be returned. If a document has a lower score that this, it will not appear in the MSet |
Since: 1.2
void xapian_enquire_set_sort_by_value (XapianEnquire *enquire
,unsigned int sort_key
,gboolean reverse
);
Set the sorting to be by value only.
Note that sorting by values uses a string comparison; to use this function to sort by a numeric
value you will have to store the values in a way that sorts appropriately, for instance by padding
the numbers using leading zeros — e.g. 001, 002, 003, ...
.
Since: 1.2
XapianMSet * xapian_enquire_get_mset (XapianEnquire *enquire
,unsigned int first
,unsigned int max_items
,GError **error
);
Retrieves max_items
items matching the XapianQuery used with
the enquire
instance.
If first
is zero, the first item returned will be the one with
the highest score. If non-zero, the value will be the number of
items ignored. A combination of first
and max_items
can be used
to paginate the matching results.
In case of error, error
will be set, and this function will
return NULL
.
enquire |
||
first |
the first item in the result set |
|
max_items |
the maximum number of results to return |
|
error |
return location for a GError |
“database”
property“database” XapianDatabase *
The XapianDatabase to query.
Flags: Read / Write / Construct Only