<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Soprano: Soprano::Index::CLuceneIndex Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <script type="text/javascript"> function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function addClass(ele,cls) { if (!this.hasClass(ele,cls)) ele.className += " "+cls; } function removeClass(ele,cls) { if (hasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } function toggleVisibility(linkObj) { var base = linkObj.getAttribute('id'); var summary = document.getElementById(base + '-summary'); var content = document.getElementById(base + '-content'); var trigger = document.getElementById(base + '-trigger'); if ( hasClass(linkObj,'closed') ) { summary.style.display = 'none'; content.style.display = 'block'; trigger.src = 'open.png'; removeClass(linkObj,'closed'); addClass(linkObj,'opened'); } else if ( hasClass(linkObj,'opened') ) { summary.style.display = 'block'; content.style.display = 'none'; trigger.src = 'closed.png'; removeClass(linkObj,'opened'); addClass(linkObj,'closed'); } return false; } </script> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related 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="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespaceSoprano.html">Soprano</a> </li> <li><a class="el" href="namespaceSoprano_1_1Index.html">Index</a> </li> <li><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html">Soprano::Index::CLuceneIndex</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-static-methods">Static Public Member Functions</a> </div> <div class="headertitle"> <h1>Soprano::Index::CLuceneIndex Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="Soprano::Index::CLuceneIndex" --><!-- doxytag: inherits="Soprano::Error::ErrorCache" --> <p>The <a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html" title="The CLuceneIndex provides a wrapper around a CLucene index which stores RDF statements.">CLuceneIndex</a> provides a wrapper around a CLucene index which stores RDF statements. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="cluceneindex_8h_source.html">Soprano/Index/CLuceneIndex</a>></code></p> <div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png"/> Inheritance diagram for Soprano::Index::CLuceneIndex:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"><img src="classSoprano_1_1Index_1_1CLuceneIndex__inherit__graph.png" border="0" usemap="#Soprano_1_1Index_1_1CLuceneIndex_inherit__map" alt="Inheritance graph"/></div> <map name="Soprano_1_1Index_1_1CLuceneIndex_inherit__map" id="Soprano_1_1Index_1_1CLuceneIndex_inherit__map"> <area shape="rect" id="node2" href="classSoprano_1_1Error_1_1ErrorCache.html" title="Core class of Soprano's exception system." alt="" coords="17,5,196,35"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classSoprano_1_1Index_1_1CLuceneIndex-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a44771536d24505aaa133712f9799a6c1">CLuceneIndex</a> (lucene::analysis::Analyzer *analyzer=0)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a2d5b396a0a0b9fcbf39107c939656fd0">~CLuceneIndex</a> ()</td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a1e0bf0b3a0e0e6da1718ddff849c1d77">open</a> (const <a class="elRef" href="qstring.html">QString</a> &folder, bool force=false)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#afe3d7c7e139fe9404503e55411fc7407">close</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#aff78b657c486c3d0376ff4eed83d64f7">isOpen</a> () const </td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#ab6e85037761b7c8c5cea37d1c578cb9b">setQueryAnalyzer</a> (lucene::analysis::Analyzer *analyzer)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">lucene::analysis::Analyzer * </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a4f93a9311f08e9f686d76857b3e1e89a">queryAnalyzer</a> () const </td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#abc74eddfa7d5e53fb7cc3df35710bcec">resourceCount</a> () const </td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#aa08293f5eedb824e3ca354530ea851a4">startTransaction</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#ab8892943cfcec07d3c08c7b1dfb69c91">closeTransaction</a> (int id)</td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceSoprano_1_1Error.html#aef1bd25c5b6705951735e0fb5c5ff525">Error::ErrorCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#aad78dd4f785a2d596668df9d9cc83616">addStatement</a> (const <a class="el" href="classSoprano_1_1Statement.html">Soprano::Statement</a> &)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceSoprano_1_1Error.html#aef1bd25c5b6705951735e0fb5c5ff525">Error::ErrorCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#af50cee65c82e551b748276ac11dcb902">removeStatement</a> (const <a class="el" href="classSoprano_1_1Statement.html">Soprano::Statement</a> &)</td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">lucene::document::Document * </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a702169a657b3550fe96e3d9734fa5600">documentForResource</a> (const <a class="el" href="classSoprano_1_1Node.html">Node</a> &resource)</td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Iterator.html">Iterator</a>< <a class="el" href="classSoprano_1_1Index_1_1QueryHit.html">QueryHit</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a940bbeca2c34eba3f4ed4fea6e612d3c">search</a> (const <a class="elRef" href="qstring.html">QString</a> &query)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Iterator.html">Iterator</a>< <a class="el" href="classSoprano_1_1Index_1_1QueryHit.html">QueryHit</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a8e7a9c81b227567869d1f166bda88b56">search</a> (lucene::search::Query *query)</td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpd41d8cd98f00b204e9800998ecf8427e"></a> </p> </div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#ad8266668b4467b10948c9793882c0236">dump</a> (<a class="elRef" href="qtextstream.html">QTextStream</a> &) const </td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a6f73bb87f86c62d0297e91aab1349a38">clear</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a590f9bc8879e847e95c5ee4c44299cc1">optimize</a> ()</td></tr> <tr><td colspan="2"><h2><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classSoprano_1_1Node.html">Soprano::Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a5294727c7fd947114dda707dd5eb1e38">getResource</a> (lucene::document::Document *document)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="elRef" href="qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a26fcaa0f55169b7f7bd83f77357986f1">defaultSearchField</a> ()</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>The <a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html" title="The CLuceneIndex provides a wrapper around a CLucene index which stores RDF statements.">CLuceneIndex</a> provides a wrapper around a CLucene index which stores RDF statements. </p> <p>It is used by the <a class="el" href="classSoprano_1_1Index_1_1IndexFilterModel.html" title="The IndexFilterModel provides a full text index around any Soprano Model.">IndexFilterModel</a> to actually handle the index. It has been made visible in the public API to provide the possibility for advanced queries and data modifications.</p> <p><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html" title="The CLuceneIndex provides a wrapper around a CLucene index which stores RDF statements.">CLuceneIndex</a> is thread-safe.</p> <p><b>Data organization</b></p> <p>In the Soprano index each resource gets its own clucene document. Only statements with literal objects are indexed. The clucene is identified through the statements' subject and then a new field is created that uses the statement's predicate as field name and the statement's object as value. The index ignores all context information.</p> <dl class="warning"><dt><b>Warning:</b></dt><dd><b>The API is subject to change. Most likely CLucene classes will be wrapped and hidden from the public API.</b></dd></dl> <dl class="author"><dt><b>Author:</b></dt><dd>Sebastian Trueg <<a href="mailto:trueg@kde.org">trueg@kde.org</a>> </dd></dl> <p>Definition at line <a class="el" href="cluceneindex_8h_source.html#l00075">75</a> of file <a class="el" href="cluceneindex_8h_source.html">cluceneindex.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a44771536d24505aaa133712f9799a6c1"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::CLuceneIndex" ref="a44771536d24505aaa133712f9799a6c1" args="(lucene::analysis::Analyzer *analyzer=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Soprano::Index::CLuceneIndex::CLuceneIndex </td> <td>(</td> <td class="paramtype">lucene::analysis::Analyzer * </td> <td class="paramname"> <em>analyzer</em> = <code>0</code></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>analyzer</em> </td><td>The analyzer to be used. If 0 a standard analyzer will be created. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a2d5b396a0a0b9fcbf39107c939656fd0"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::~CLuceneIndex" ref="a2d5b396a0a0b9fcbf39107c939656fd0" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Soprano::Index::CLuceneIndex::~CLuceneIndex </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor.</p> <p>Calls <a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#afe3d7c7e139fe9404503e55411fc7407">close()</a>. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a1e0bf0b3a0e0e6da1718ddff849c1d77"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::open" ref="a1e0bf0b3a0e0e6da1718ddff849c1d77" args="(const QString &folder, bool force=false)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Soprano::Index::CLuceneIndex::open </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"> <em>folder</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>force</em> = <code>false</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Open the index. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>folder</em> </td><td>The folder where the index is stored. </td></tr> <tr><td valign="top"></td><td valign="top"><em>force</em> </td><td>If true any CLucene locks on the folder are removed. This is useful if a previous session crashed and left an unused lock lying around. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="afe3d7c7e139fe9404503e55411fc7407"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::close" ref="afe3d7c7e139fe9404503e55411fc7407" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Index::CLuceneIndex::close </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Close the index. Write back any changes, close any open transactions. (Is called in <a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a2d5b396a0a0b9fcbf39107c939656fd0">~CLuceneIndex()</a>) </p> </div> </div> <a class="anchor" id="aff78b657c486c3d0376ff4eed83d64f7"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::isOpen" ref="aff78b657c486c3d0376ff4eed83d64f7" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Soprano::Index::CLuceneIndex::isOpen </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> If the index has been opened successfully. </dd></dl> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a1e0bf0b3a0e0e6da1718ddff849c1d77">open()</a> </dd></dl> </div> </div> <a class="anchor" id="ab6e85037761b7c8c5cea37d1c578cb9b"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::setQueryAnalyzer" ref="ab6e85037761b7c8c5cea37d1c578cb9b" args="(lucene::analysis::Analyzer *analyzer)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Index::CLuceneIndex::setQueryAnalyzer </td> <td>(</td> <td class="paramtype">lucene::analysis::Analyzer * </td> <td class="paramname"> <em>analyzer</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Optionally set the analyzer to be used for query parsing. By default the index analyzer specified in the constructor is used.</p> <p><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html" title="The CLuceneIndex provides a wrapper around a CLucene index which stores RDF statements.">CLuceneIndex</a> will not take ownership of the analyzer.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#a940bbeca2c34eba3f4ed4fea6e612d3c">search(const QString&)</a></dd></dl> <dl class="since"><dt><b>Since:</b></dt><dd>2.3 </dd></dl> </div> </div> <a class="anchor" id="a4f93a9311f08e9f686d76857b3e1e89a"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::queryAnalyzer" ref="a4f93a9311f08e9f686d76857b3e1e89a" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">lucene::analysis::Analyzer* Soprano::Index::CLuceneIndex::queryAnalyzer </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Get the query analyzer set in setQueryAnalyzer. This method is only provided for convenience.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>The analyzer set in setQueryAnalyzer or 0 if none was set.</dd></dl> <dl class="since"><dt><b>Since:</b></dt><dd>2.3 </dd></dl> </div> </div> <a class="anchor" id="abc74eddfa7d5e53fb7cc3df35710bcec"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::resourceCount" ref="abc74eddfa7d5e53fb7cc3df35710bcec" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int Soprano::Index::CLuceneIndex::resourceCount </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Get the number of indexed resources.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>The number of indexed resoruces or -1 on error (In the case of error <a class="el" href="classSoprano_1_1Error_1_1ErrorCache.html#a3251b8052cdf932d59a523ca215d21c9">lastError()</a> provides more information. </dd></dl> </div> </div> <a class="anchor" id="aa08293f5eedb824e3ca354530ea851a4"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::startTransaction" ref="aa08293f5eedb824e3ca354530ea851a4" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int Soprano::Index::CLuceneIndex::startTransaction </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Start a new transaction. After calling this method multiple fields and statements may be added to the index and nothing is written back to disk. A transaction has to be closed. Otherwise the data will not be written to the index. (All transactions are closed on deletion.)</p> <p>Methods such as addStatement will start and close a transaction internally if none has been started before.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>A transaction id that has to be used to close the transaction. This is a safety mechanism to ensure that no other user closes one's transaction. If another transaction has already been started 0 is returned. </dd></dl> </div> </div> <a class="anchor" id="ab8892943cfcec07d3c08c7b1dfb69c91"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::closeTransaction" ref="ab8892943cfcec07d3c08c7b1dfb69c91" args="(int id)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Soprano::Index::CLuceneIndex::closeTransaction </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>id</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Close a transaction and write the changes back to the index.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>The transaction ID as returned by <a class="el" href="classSoprano_1_1Index_1_1CLuceneIndex.html#aa08293f5eedb824e3ca354530ea851a4">startTransaction()</a></td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if the transaction was closed, false if no transaction was started, a wrong transaction id has been supplied, or a clucene error occured. </dd></dl> </div> </div> <a class="anchor" id="aad78dd4f785a2d596668df9d9cc83616"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::addStatement" ref="aad78dd4f785a2d596668df9d9cc83616" args="(const Soprano::Statement &)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespaceSoprano_1_1Error.html#aef1bd25c5b6705951735e0fb5c5ff525">Error::ErrorCode</a> Soprano::Index::CLuceneIndex::addStatement </td> <td>(</td> <td class="paramtype">const <a class="el" href="classSoprano_1_1Statement.html">Soprano::Statement</a> & </td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Indexes a statement. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>An error code or 0 on success </dd></dl> </div> </div> <a class="anchor" id="af50cee65c82e551b748276ac11dcb902"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::removeStatement" ref="af50cee65c82e551b748276ac11dcb902" args="(const Soprano::Statement &)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespaceSoprano_1_1Error.html#aef1bd25c5b6705951735e0fb5c5ff525">Error::ErrorCode</a> Soprano::Index::CLuceneIndex::removeStatement </td> <td>(</td> <td class="paramtype">const <a class="el" href="classSoprano_1_1Statement.html">Soprano::Statement</a> & </td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Removes a statement from the index. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>An error code or 0 on success </dd></dl> </div> </div> <a class="anchor" id="a702169a657b3550fe96e3d9734fa5600"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::documentForResource" ref="a702169a657b3550fe96e3d9734fa5600" args="(const Node &resource)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">lucene::document::Document* Soprano::Index::CLuceneIndex::documentForResource </td> <td>(</td> <td class="paramtype">const <a class="el" href="classSoprano_1_1Node.html">Node</a> & </td> <td class="paramname"> <em>resource</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Get a document for a specific resource. This is only possible after starting a transaction.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>resource</em> </td><td>The resource for which a document is requested.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The document representing the resource or 0 if no transaction has been started or a clucene error occured.</dd></dl> <dl class="warning"><dt><b>Warning:</b></dt><dd>This is an advanced method. Calling this method is thread-safe but using the returned document is not. </dd></dl> </div> </div> <a class="anchor" id="a940bbeca2c34eba3f4ed4fea6e612d3c"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::search" ref="a940bbeca2c34eba3f4ed4fea6e612d3c" args="(const QString &query)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classSoprano_1_1Iterator.html">Iterator</a><<a class="el" href="classSoprano_1_1Index_1_1QueryHit.html">QueryHit</a>> Soprano::Index::CLuceneIndex::search </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"> <em>query</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Evaluates the given query. Each hit is a resource and a score. Resource properties may be read from the model.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>query</em> </td><td>The query in the CLucene query language.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The results as an iterator over <a class="el" href="classSoprano_1_1Index_1_1QueryHit.html" title="QueryHit represents a hit from an IndexFilterModel query. It basically is an RDF resource combined wi...">QueryHit</a> objects or an invalid iterator on error. </dd></dl> </div> </div> <a class="anchor" id="a8e7a9c81b227567869d1f166bda88b56"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::search" ref="a8e7a9c81b227567869d1f166bda88b56" args="(lucene::search::Query *query)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classSoprano_1_1Iterator.html">Iterator</a><<a class="el" href="classSoprano_1_1Index_1_1QueryHit.html">QueryHit</a>> Soprano::Index::CLuceneIndex::search </td> <td>(</td> <td class="paramtype">lucene::search::Query * </td> <td class="paramname"> <em>query</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Evaluates the given query. Each hit is a resource and a score. Resource properties may be read from the model.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>query</em> </td><td>The query to evaluate. The iterator takes ownership of the query. Do not delete.it! (If anyone using this understands the weird CLucene memory management enough to fix this issue, please...)</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The results as an iterator over <a class="el" href="classSoprano_1_1Index_1_1QueryHit.html" title="QueryHit represents a hit from an IndexFilterModel query. It basically is an RDF resource combined wi...">QueryHit</a> objects or an invalid iterator on error.</dd></dl> <dl class="warning"><dt><b>Warning:</b></dt><dd>The result iterator uses the query object. </dd></dl> </div> </div> <a class="anchor" id="a5294727c7fd947114dda707dd5eb1e38"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::getResource" ref="a5294727c7fd947114dda707dd5eb1e38" args="(lucene::document::Document *document)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classSoprano_1_1Node.html">Soprano::Node</a> Soprano::Index::CLuceneIndex::getResource </td> <td>(</td> <td class="paramtype">lucene::document::Document * </td> <td class="paramname"> <em>document</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the Resource corresponding with the specified Document. </p> </div> </div> <a class="anchor" id="a26fcaa0f55169b7f7bd83f77357986f1"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::defaultSearchField" ref="a26fcaa0f55169b7f7bd83f77357986f1" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="elRef" href="qstring.html">QString</a> Soprano::Index::CLuceneIndex::defaultSearchField </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>This is a temporary method which supports the advanced query interface based on CLucene classes.</p> <p>The Soprano index creates one special field for each indexed resource which contains all data to allow simple queries without property names or URIs.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>The name of the default CLucene search field to be queried when no properties are known. </dd></dl> </div> </div> <a class="anchor" id="ad8266668b4467b10948c9793882c0236"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::dump" ref="ad8266668b4467b10948c9793882c0236" args="(QTextStream &) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Index::CLuceneIndex::dump </td> <td>(</td> <td class="paramtype"><a class="elRef" href="qtextstream.html">QTextStream</a> & </td> <td class="paramname"></td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Dump the index contents to the stream </p> </div> </div> <a class="anchor" id="a6f73bb87f86c62d0297e91aab1349a38"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::clear" ref="a6f73bb87f86c62d0297e91aab1349a38" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Index::CLuceneIndex::clear </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Clear the index, i.e. delete all entries.</p> <dl class="since"><dt><b>Since:</b></dt><dd>2.1 </dd></dl> </div> </div> <a class="anchor" id="a590f9bc8879e847e95c5ee4c44299cc1"></a><!-- doxytag: member="Soprano::Index::CLuceneIndex::optimize" ref="a590f9bc8879e847e95c5ee4c44299cc1" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Index::CLuceneIndex::optimize </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Optimize the index for search. This makes sense after adding or removing a large number of statements.</p> <dl class="since"><dt><b>Since:</b></dt><dd>2.2 </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>/builddir/build/BUILD/soprano-2.5.2/index/<a class="el" href="cluceneindex_8h_source.html">cluceneindex.h</a></li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Oct 21 2010 for Soprano by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>