Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 7598b8f4e8b56b9708b68012e6aa9940 > files > 84

lib64xapian-devel-1.2.12-4.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Xapian: API Documentation: xapian-core: Xapian::DecreasingValueWeightPostingSource Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.5.9 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceXapian.html">Xapian</a>::<a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html">DecreasingValueWeightPostingSource</a>
  </div>
</div>
<div class="contents">
<h1>Xapian::DecreasingValueWeightPostingSource Class Reference</h1><!-- doxytag: class="Xapian::DecreasingValueWeightPostingSource" --><!-- doxytag: inherits="Xapian::ValueWeightPostingSource" -->Read weights from a value which is known to decrease as docid increases.  
<a href="#_details">More...</a>
<p>
<div class="dynheader">
Inheritance diagram for Xapian::DecreasingValueWeightPostingSource:</div>
<div class="dynsection">
<p><center><img src="classXapian_1_1DecreasingValueWeightPostingSource__inherit__graph.png" border="0" usemap="#Xapian_1_1DecreasingValueWeightPostingSource__inherit__map" alt="Inheritance graph"></center>
<map name="Xapian_1_1DecreasingValueWeightPostingSource__inherit__map">
<area shape="rect" href="classXapian_1_1ValueWeightPostingSource.html" title="A posting source which reads weights from a value slot." alt="" coords="41,161,281,188"><area shape="rect" href="classXapian_1_1ValuePostingSource.html" title="A posting source which generates weights from a value slot." alt="" coords="61,84,261,111"><area shape="rect" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings." alt="" coords="80,7,243,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classXapian_1_1DecreasingValueWeightPostingSource-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#1f302377fd46ed471987939be3f24bab">get_weight</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the weight contribution for the current document.  <a href="#1f302377fd46ed471987939be3f24bab"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html">DecreasingValueWeightPostingSource</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#fcaba0011386e195aeb81836fd0adc5d">clone</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clone the posting source.  <a href="#fcaba0011386e195aeb81836fd0adc5d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#9f1d3ffcfbea32d66ebc690426d9be90">name</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Name of the posting source class.  <a href="#9f1d3ffcfbea32d66ebc690426d9be90"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#2d3b48128b61bfd904163706c87065a8">serialise</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Serialise object parameters into a string.  <a href="#2d3b48128b61bfd904163706c87065a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html">DecreasingValueWeightPostingSource</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#5ef4c786055fcfe85ebc99cb98ba8409">unserialise</a> (const std::string &amp;s) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create object given string serialisation returned by <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#2d3b48128b61bfd904163706c87065a8" title="Serialise object parameters into a string.">serialise()</a>.  <a href="#5ef4c786055fcfe85ebc99cb98ba8409"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c">init</a> (const <a class="el" href="classXapian_1_1Database.html">Xapian::Database</a> &amp;db_)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set this <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> to the start of the list of postings.  <a href="#abbd9d95d77e2aa947377c44d1bb733c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#ef2944c8ef7812185907af383a3747f2">next</a> (<a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a> min_wt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Advance the current position to the next matching document.  <a href="#ef2944c8ef7812185907af383a3747f2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c">skip_to</a> (<a class="el" href="namespaceXapian.html#8fa9094bebe1256a7be935a5ede87a64">Xapian::docid</a> min_docid, <a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a> min_wt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Advance to the specified docid.  <a href="#e32da549e3042739f2954233c7a9bb3c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#3ae07f1c25d3b71f437a7cb63a342d5c">check</a> (<a class="el" href="namespaceXapian.html#8fa9094bebe1256a7be935a5ede87a64">Xapian::docid</a> min_docid, <a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a> min_wt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check if the specified docid occurs.  <a href="#3ae07f1c25d3b71f437a7cb63a342d5c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#b9ec69881499b156c9317bc9d491ef91">get_description</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a string describing this object.  <a href="#b9ec69881499b156c9317bc9d491ef91"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="677cd90111fc4a5c8d6f8c8187afb9c4"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::skip_if_in_range" ref="677cd90111fc4a5c8d6f8c8187afb9c4" args="(Xapian::weight min_wt)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#677cd90111fc4a5c8d6f8c8187afb9c4">skip_if_in_range</a> (<a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a> min_wt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Skip the iterator forward if in the decreasing range, and weight is low. <br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="94b692c8c86de5dc9e5e697bbd74a01a"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::items_at_end" ref="94b692c8c86de5dc9e5e697bbd74a01a" args="" -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#94b692c8c86de5dc9e5e697bbd74a01a">items_at_end</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flag, set to true if there are docs after the end of the range. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Read weights from a value which is known to decrease as docid increases. 
<p>
This posting source can be used, like <a class="el" href="classXapian_1_1ValueWeightPostingSource.html" title="A posting source which reads weights from a value slot.">ValueWeightPostingSource</a>, to add a weight contribution to a query based on the values stored in a slot. The values in the slot must be serialised as by <em><a class="el" href="namespaceXapian.html#29a741b4cda98e10ed5f2fc784039065" title="Convert a floating point number to a string, preserving sort order.">sortable_serialise()</a></em>.<p>
However, this posting source is additionally given a range of document IDs, within which the weight is known to be decreasing. ie, for all documents with ids A and B within this range (including the endpoints), where A is less than B, the weight of A is less than or equal to the weight of B. This can allow the posting source to skip to the end of the range quickly if insufficient weight is left in the posting source for a particular source.<p>
By default, the range is assumed to cover all document IDs.<p>
The ordering property can be arranged at index time, or by sorting an indexed database to produce a new, sorted, database. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="3ae07f1c25d3b71f437a7cb63a342d5c"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::check" ref="3ae07f1c25d3b71f437a7cb63a342d5c" args="(Xapian::docid min_docid, Xapian::weight min_wt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Xapian::DecreasingValueWeightPostingSource::check           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#8fa9094bebe1256a7be935a5ede87a64">Xapian::docid</a>&nbsp;</td>
          <td class="paramname"> <em>did</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a>&nbsp;</td>
          <td class="paramname"> <em>min_wt</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Check if the specified docid occurs. 
<p>
The caller is required to ensure that the specified document id <em>did</em> actually exists in the database. If it does, it must move to that document id, and return true. If it does not, it may either:<p>
<ul>
<li>return true, having moved to a definite position (including "at_end"), which must be the same position as <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c" title="Advance to the specified docid.">skip_to()</a> would have moved to.</li></ul>
<p>
or<p>
<ul>
<li>return false, having moved to an "indeterminate" position, such that a subsequent call to <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#ef2944c8ef7812185907af383a3747f2" title="Advance the current position to the next matching document.">next()</a> or <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c" title="Advance to the specified docid.">skip_to()</a> will move to the next matching position after <em>did</em>.</li></ul>
<p>
Generally, this method should act like <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c" title="Advance to the specified docid.">skip_to()</a> and return true if that can be done at little extra cost.<p>
Otherwise it should simply check if a particular docid is present, returning true if it is, and false if it isn't.<p>
The default implementation calls <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c" title="Advance to the specified docid.">skip_to()</a> and always returns true.<p>
<a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will always call <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a> on a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> before calling this for the first time.<p>
Note: in the case of a multi-database search, the docid specified is the docid in the single subdatabase relevant to this posting source. See the <em><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a></em> method for details.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>did</em>&nbsp;</td><td>The document id to check. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>min_wt</em>&nbsp;</td><td>The minimum weight contribution that is needed (this is just a hint which subclasses may ignore). </td></tr>
  </table>
</dl>

<p>Reimplemented from <a class="el" href="classXapian_1_1ValuePostingSource.html#71868e54627098425820f7a76e259197">Xapian::ValuePostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="fcaba0011386e195aeb81836fd0adc5d"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::clone" ref="fcaba0011386e195aeb81836fd0adc5d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html">DecreasingValueWeightPostingSource</a>* Xapian::DecreasingValueWeightPostingSource::clone           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Clone the posting source. 
<p>
The clone should inherit the configuration of the parent, but need not inherit the state. ie, the clone does not need to be in the same iteration position as the original: the matcher will always call <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a> on the clone before attempting to move the iterator, or read the information about the current position of the iterator.<p>
This may return NULL to indicate that cloning is not supported. In this case, the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> may only be used with a single-database search.<p>
The default implementation returns NULL.<p>
Note that the returned object will be deallocated by <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> after use with "delete". If you want to handle the deletion in a special way (for example when wrapping the <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> API for use from another language) then you can define a static <code>operator delete</code> method in your subclass as shown here: <a href="http://trac.xapian.org/ticket/554#comment:1">http://trac.xapian.org/ticket/554#comment:1</a> 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#a157a293a1b54a3d70d1d55f5de26895">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="b9ec69881499b156c9317bc9d491ef91"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::get_description" ref="b9ec69881499b156c9317bc9d491ef91" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::DecreasingValueWeightPostingSource::get_description           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return a string describing this object. 
<p>
This default implementation returns a generic answer. This default it provided to avoid forcing those deriving their own <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclass from having to implement this (they may not care what <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#b9ec69881499b156c9317bc9d491ef91" title="Return a string describing this object.">get_description()</a> gives for their subclass). 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#f39ca50c3edcd5b8e2cde72db07a4382">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="1f302377fd46ed471987939be3f24bab"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::get_weight" ref="1f302377fd46ed471987939be3f24bab" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a> Xapian::DecreasingValueWeightPostingSource::get_weight           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the weight contribution for the current document. 
<p>
This default implementation always returns 0, for convenience when implementing "weight-less" <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclasses.<p>
This method may assume that it will only be called when there is a "current document". In detail: <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will always call <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a> on a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> before calling this for the first time. It will also only call this if the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> reports that it is pointing to a valid document (ie, it will not call it before calling at least one of <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#ef2944c8ef7812185907af383a3747f2" title="Advance the current position to the next matching document.">next()</a>, <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c" title="Advance to the specified docid.">skip_to()</a> or <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#3ae07f1c25d3b71f437a7cb63a342d5c" title="Check if the specified docid occurs.">check()</a>, and will ensure that the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> is not at the end by calling <a class="el" href="classXapian_1_1ValuePostingSource.html#4bb7ea314dbd569f90f89731204cdc40" title="Return true if the current position is past the last entry in this list.">at_end()</a>). 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#b9159e5e12e909272fa2b776bb95cdaa">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="abbd9d95d77e2aa947377c44d1bb733c"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::init" ref="abbd9d95d77e2aa947377c44d1bb733c" args="(const Xapian::Database &amp;db_)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::DecreasingValueWeightPostingSource::init           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1Database.html">Xapian::Database</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>db</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set this <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> to the start of the list of postings. 
<p>
This is called automatically by the matcher prior to each query being processed.<p>
If a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> is used for multiple searches, <em><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a></em> will therefore be called multiple times, and must handle this by using the database passed in the most recent call.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>db</em>&nbsp;</td><td>The database which the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> should iterate through.</td></tr>
  </table>
</dl>
Note: the database supplied to this method must not be modified: in particular, the reopen() method should not be called on it.<p>
Note: in the case of a multi-database search, a separate <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> will be used for each database (the separate PostingSources will be obtained using <em><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#fcaba0011386e195aeb81836fd0adc5d" title="Clone the posting source.">clone()</a></em>), and each <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> will be passed one of the sub-databases as the <em>db</em> parameter here. The <em>db</em> parameter will therefore always refer to a single database. All docids passed to, or returned from, the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> refer to docids in that single database, rather than in the multi-database. 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#c3844351e28448d1de38fe089d626db4">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="9f1d3ffcfbea32d66ebc690426d9be90"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::name" ref="9f1d3ffcfbea32d66ebc690426d9be90" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::DecreasingValueWeightPostingSource::name           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Name of the posting source class. 
<p>
This is used when serialising and unserialising posting sources; for example, for performing remote searches.<p>
If the subclass is in a C++ namespace, the namespace should be included in the name, using "::" as a separator. For example, for a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclass called "FooPostingSource" in the "Xapian" namespace the result of this call should be "Xapian::FooPostingSource".<p>
This should only be implemented if <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#2d3b48128b61bfd904163706c87065a8" title="Serialise object parameters into a string.">serialise()</a> and <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#5ef4c786055fcfe85ebc99cb98ba8409" title="Create object given string serialisation returned by serialise().">unserialise()</a> are also implemented. The default implementation returns an empty string.<p>
If this returns an empty string, <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will assume that <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#2d3b48128b61bfd904163706c87065a8" title="Serialise object parameters into a string.">serialise()</a> and <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#5ef4c786055fcfe85ebc99cb98ba8409" title="Create object given string serialisation returned by serialise().">unserialise()</a> are not implemented. 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#35d0b218fa9db907c36e62d60b900808">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="ef2944c8ef7812185907af383a3747f2"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::next" ref="ef2944c8ef7812185907af383a3747f2" args="(Xapian::weight min_wt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::DecreasingValueWeightPostingSource::next           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a>&nbsp;</td>
          <td class="paramname"> <em>min_wt</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Advance the current position to the next matching document. 
<p>
The <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> starts before the first entry in the list, so <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#ef2944c8ef7812185907af383a3747f2" title="Advance the current position to the next matching document.">next()</a> must be called before any methods which need the context of the current position.<p>
<a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will always call <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a> on a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> before calling this for the first time.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>min_wt</em>&nbsp;</td><td>The minimum weight contribution that is needed (this is just a hint which subclasses may ignore). </td></tr>
  </table>
</dl>

<p>Reimplemented from <a class="el" href="classXapian_1_1ValuePostingSource.html#87b22aac8422f80124b50a456d1d85b0">Xapian::ValuePostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="2d3b48128b61bfd904163706c87065a8"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::serialise" ref="2d3b48128b61bfd904163706c87065a8" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::DecreasingValueWeightPostingSource::serialise           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Serialise object parameters into a string. 
<p>
The serialised parameters should represent the configuration of the posting source, but need not (indeed, should not) represent the current iteration state.<p>
If you don't want to support the remote backend, you can use the default implementation which simply throws <a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a>. 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#1bdc574c2f1c02472a4ec5fee697af87">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="e32da549e3042739f2954233c7a9bb3c"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::skip_to" ref="e32da549e3042739f2954233c7a9bb3c" args="(Xapian::docid min_docid, Xapian::weight min_wt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::DecreasingValueWeightPostingSource::skip_to           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#8fa9094bebe1256a7be935a5ede87a64">Xapian::docid</a>&nbsp;</td>
          <td class="paramname"> <em>did</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a>&nbsp;</td>
          <td class="paramname"> <em>min_wt</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Advance to the specified docid. 
<p>
If the specified docid isn't in the list, position ourselves on the first document after it (or <a class="el" href="classXapian_1_1ValuePostingSource.html#4bb7ea314dbd569f90f89731204cdc40" title="Return true if the current position is past the last entry in this list.">at_end()</a> if no greater docids are present).<p>
If the current position is already the specified docid, this method will leave the position unmodified.<p>
If the specified docid is earlier than the current position, the behaviour is unspecified. A sensible behaviour would be to leave the current position unmodified, but it is also reasonable to move to the specified docid.<p>
The default implementation calls <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#ef2944c8ef7812185907af383a3747f2" title="Advance the current position to the next matching document.">next()</a> repeatedly, which works but <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#e32da549e3042739f2954233c7a9bb3c" title="Advance to the specified docid.">skip_to()</a> can often be implemented much more efficiently.<p>
<a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will always call <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a> on a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> before calling this for the first time.<p>
Note: in the case of a multi-database search, the docid specified is the docid in the single subdatabase relevant to this posting source. See the <em><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#abbd9d95d77e2aa947377c44d1bb733c" title="Set this PostingSource to the start of the list of postings.">init()</a></em> method for details.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>did</em>&nbsp;</td><td>The document id to advance to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>min_wt</em>&nbsp;</td><td>The minimum weight contribution that is needed (this is just a hint which subclasses may ignore). </td></tr>
  </table>
</dl>

<p>Reimplemented from <a class="el" href="classXapian_1_1ValuePostingSource.html#f11095a4355f96d7bc12074a5a91cd93">Xapian::ValuePostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="5ef4c786055fcfe85ebc99cb98ba8409"></a><!-- doxytag: member="Xapian::DecreasingValueWeightPostingSource::unserialise" ref="5ef4c786055fcfe85ebc99cb98ba8409" args="(const std::string &amp;s) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html">DecreasingValueWeightPostingSource</a>* Xapian::DecreasingValueWeightPostingSource::unserialise           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>s</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create object given string serialisation returned by <a class="el" href="classXapian_1_1DecreasingValueWeightPostingSource.html#2d3b48128b61bfd904163706c87065a8" title="Serialise object parameters into a string.">serialise()</a>. 
<p>
Note that the returned object will be deallocated by <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> after use with "delete". If you want to handle the deletion in a special way (for example when wrapping the <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> API for use from another language) then you can define a static <code>operator delete</code> method in your subclass as shown here: <a href="http://trac.xapian.org/ticket/554#comment:1">http://trac.xapian.org/ticket/554#comment:1</a><p>
If you don't want to support the remote backend, you can use the default implementation which simply throws <a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>A serialised instance of this <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclass. </td></tr>
  </table>
</dl>

<p>Reimplemented from <a class="el" href="classXapian_1_1ValueWeightPostingSource.html#ff018c57b785507a3bba82e85ec7fb63">Xapian::ValueWeightPostingSource</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>xapian/<a class="el" href="postingsource_8h.html">postingsource.h</a></ul>
</div>
<hr>
<address><small>
Documentation for Xapian (version 1.2.12).<br>
Generated on 27 Jun 2012 by
<a href="http://www.doxygen.org/">Doxygen 1.5.9</a>.
</small></address>
</body>
</html>