XapianMSet

XapianMSet — Set of matching documents

Functions

Object Hierarchy

    GObject
    ╰── XapianMSet

Description

XapianMSet represents a set of documents in a XapianDatabase matching a specific XapianQuery performed by a XapianEnquire instance.

You can query the whole set for information on the results, but typically you will iterate over the XapianMSet using an instance of the XapianMSetIterator class.

Functions

xapian_mset_get_firstitem ()

unsigned int
xapian_mset_get_firstitem (XapianMSet *mset);

Retrieves the index of the first item in the mset .

Parameters

mset

a XapianMSet

 

Returns

the index of the first item


xapian_mset_get_termfreq ()

unsigned int
xapian_mset_get_termfreq (XapianMSet *mset,
                          const char *term);

Retrieves the frequency of the given term .

Parameters

mset

a XapianMSet

 

term

a term

 

Returns

the frequency of the term


xapian_mset_get_termweight ()

double
xapian_mset_get_termweight (XapianMSet *mset,
                            const char *term);

Retrieves the weight of the given term .

Parameters

mset

a XapianMSet

 

term

the term to use

 

Returns

the weight of the term


xapian_mset_get_matches_lower_bound ()

unsigned int
xapian_mset_get_matches_lower_bound (XapianMSet *mset);

Retrieves the lower bound of the matching documents in the database.

Parameters

mset

a XapianMSet

 

Returns

a lower bound of documents


xapian_mset_get_matches_estimated ()

unsigned int
xapian_mset_get_matches_estimated (XapianMSet *mset);

Retrieves an estimation of the matching documents in the database.

Parameters

mset

a XapianMSet

 

Returns

an estimated number of documents


xapian_mset_get_matches_upper_bound ()

unsigned int
xapian_mset_get_matches_upper_bound (XapianMSet *mset);

Retrieves the upper bound of the matching documents in the database.

Parameters

mset

a XapianMSet

 

Returns

an upper bound of documents


xapian_mset_get_uncollapsed_matches_lower_bound ()

unsigned int
xapian_mset_get_uncollapsed_matches_lower_bound
                               (XapianMSet *mset);

Retrieves the lower bound of the matching documents in the database if collapsing was not used.

Parameters

mset

a XapianMSet

 

Returns

a lower bound of documents


xapian_mset_get_uncollapsed_matches_estimated ()

unsigned int
xapian_mset_get_uncollapsed_matches_estimated
                               (XapianMSet *mset);

Retrieves an estimated number of matching documents in the database if collapsing was not used.

Parameters

mset

a XapianMSet

 

Returns

an estimate of matching documents


xapian_mset_get_uncollapsed_matches_upper_bound ()

unsigned int
xapian_mset_get_uncollapsed_matches_upper_bound
                               (XapianMSet *mset);

Retrieves the upper bound of the matching documents in the database if collapsing was not used.

Parameters

mset

a XapianMSet

 

Returns

an upper bound of matching documents


xapian_mset_get_max_possible ()

double
xapian_mset_get_max_possible (XapianMSet *mset);

The maximum possible weight in the mset .

See also: xapian_mset_get_max_attained()

Parameters

mset

a XapianMSet

 

Returns

the maximum weight in the set


xapian_mset_get_max_attained ()

double
xapian_mset_get_max_attained (XapianMSet *mset);

The greatest weight which is attained by any document in the database.

If mset was the result of xapian_enquire_get_mset() with a first item set to 0, the returned value is the weight of the first item in the mset .

Parameters

mset

a XapianMSet

 

Returns

the maximum weight in the database


xapian_mset_get_size ()

unsigned int
xapian_mset_get_size (XapianMSet *mset);

Retrieves the number of items in the mset .

Parameters

mset

a XapianMSet

 

Returns

the number of items


xapian_mset_is_empty ()

gboolean
xapian_mset_is_empty (XapianMSet *mset);

Checks whether the mset is empty.

Parameters

mset

a XapianMSet

 

Returns

TRUE if the set is empty, and FALSE otherwise


xapian_mset_convert_to_percent ()

int
xapian_mset_convert_to_percent (XapianMSet *mset,
                                double weight);

Converts a weight, typically returned by xapian_mset_iterator_get_weight(), into a percentage.

Parameters

mset

a XapianMSet

 

weight

the weight of an item

 

Returns

the weight of an item expressed as a percentage


xapian_mset_get_begin ()

XapianMSetIterator *
xapian_mset_get_begin (XapianMSet *mset);

Creates an iterator placed before the beginning of the mset .

In order to access the contents of the mset through the XapianMSetIterator API you will have to advance the iterator first, e.g.:

1
2
3
4
5
6
7
8
XapianMSetIter *iter = xapian_mset_get_begin (mset);

while (xapian_mset_iterator_next (iter))
  {
    // ...
  }

g_object_unref (iter);

Parameters

mset

a XapianMSet

 

Returns

the newly created XapianMSetIterator instance.

[transfer full]


xapian_mset_get_end ()

XapianMSetIterator *
xapian_mset_get_end (XapianMSet *mset);

Creates a new XapianMSetIterator placed after the end of the mset .

In order to access the contents of the mset through the XapianMSetIterator API you will have to advance the iterator first, e.g.:

1
2
3
4
5
6
7
8
XapianMSetIter *iter = xapian_mset_get_end (mset);

while (xapian_mset_iterator_prev (iter))
  {
    // ...
  }

g_object_unref (iter);

Parameters

mset

a XapianMSet

 

Returns

the newly created XapianMSetIterator instance.

[transfer full]

Types and Values