blob: feea68310c7fff14ac3726617e93211be681d03a [file] [log] [blame]
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3"/>
<title>Lucene.Net: Lucene.Net.Index.CheckIndex Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="lucene-net-icon-128x128.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Lucene.Net
&#160;<span id="projectnumber">3.0.3</span>
</div>
<div id="projectbrief">Lucene.Net is a .NET port of the Java Lucene Indexing Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="Index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Packages</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>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Properties</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_lucene.html">Lucene</a></li><li class="navelem"><a class="el" href="namespace_lucene_1_1_net.html">Net</a></li><li class="navelem"><a class="el" href="namespace_lucene_1_1_net_1_1_index.html">Index</a></li><li class="navelem"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html">CheckIndex</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_lucene_1_1_net_1_1_index_1_1_check_index-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Lucene.Net.Index.CheckIndex Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Basic tool and API to check the health of an index and write a new segments file that removes reference to problematic segments.
<a href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returned from <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#a57737c05b66f447aaaf2e5e730be02c3" title="Returns a Status instance detailing the state of the index.">CheckIndex_Renamed_Method()</a> detailing the health and status of the index. <a href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adaf818df0f3a5716f94fa20a9b6448e7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#adaf818df0f3a5716f94fa20a9b6448e7">CheckIndex</a> (<a class="el" href="_syns2_index_8cs.html#aada057080323f6e867d8f9c189276716">Directory</a> dir)</td></tr>
<tr class="memdesc:adaf818df0f3a5716f94fa20a9b6448e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html" title="Basic tool and API to check the health of an index and write a new segments file that removes referen...">CheckIndex</a> on the directory. <a href="#adaf818df0f3a5716f94fa20a9b6448e7"></a><br/></td></tr>
<tr class="separator:adaf818df0f3a5716f94fa20a9b6448e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c281f925ea0402e66313c3fef6c3c79"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#a7c281f925ea0402e66313c3fef6c3c79">SetInfoStream</a> (StreamWriter @out)</td></tr>
<tr class="memdesc:a7c281f925ea0402e66313c3fef6c3c79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set infoStream where messages should go. If null, no messages are printed <a href="#a7c281f925ea0402e66313c3fef6c3c79"></a><br/></td></tr>
<tr class="separator:a7c281f925ea0402e66313c3fef6c3c79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57737c05b66f447aaaf2e5e730be02c3"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#a57737c05b66f447aaaf2e5e730be02c3">CheckIndex_Renamed_Method</a> ()</td></tr>
<tr class="memdesc:a57737c05b66f447aaaf2e5e730be02c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html" title="Returned from CheckIndex_Renamed_Method() detailing the health and status of the index.">Status</a> instance detailing the state of the index. <a href="#a57737c05b66f447aaaf2e5e730be02c3"></a><br/></td></tr>
<tr class="separator:a57737c05b66f447aaaf2e5e730be02c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6935812af182afc89f2baed1da5fdfe"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#aa6935812af182afc89f2baed1da5fdfe">CheckIndex_Renamed_Method</a> (List&lt; string &gt; onlySegments)</td></tr>
<tr class="memdesc:aa6935812af182afc89f2baed1da5fdfe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html" title="Returned from CheckIndex_Renamed_Method() detailing the health and status of the index.">Status</a> instance detailing the state of the index. <a href="#aa6935812af182afc89f2baed1da5fdfe"></a><br/></td></tr>
<tr class="separator:aa6935812af182afc89f2baed1da5fdfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b4986e6d70fc625be3ff69cd59858ff"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#a1b4986e6d70fc625be3ff69cd59858ff">FixIndex</a> (<a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a> result)</td></tr>
<tr class="memdesc:a1b4986e6d70fc625be3ff69cd59858ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Repairs the index using previously returned result from <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html" title="Basic tool and API to check the health of an index and write a new segments file that removes referen...">CheckIndex</a>. Note that this does not remove any of the unreferenced files after it's done; you must separately open an <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_writer.html" title="An IndexWriter creates and maintains an index. The create argument to the constructor determines whet...">IndexWriter</a>, which deletes unreferenced files when it's created. <a href="#a1b4986e6d70fc625be3ff69cd59858ff"></a><br/></td></tr>
<tr class="separator:a1b4986e6d70fc625be3ff69cd59858ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a163ed262f2054382e2370c6a212143a3"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html#a163ed262f2054382e2370c6a212143a3">Main</a> (System.String[] args)</td></tr>
<tr class="memdesc:a163ed262f2054382e2370c6a212143a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Command-line interface to check and fix an index. Run it like this: <a href="#a163ed262f2054382e2370c6a212143a3"></a><br/></td></tr>
<tr class="separator:a163ed262f2054382e2370c6a212143a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Basic tool and API to check the health of an index and write a new segments file that removes reference to problematic segments. </p>
<p>As this tool checks every byte in the index, on a large index it can take quite a long time to run.</p>
<p><b>WARNING</b>: this tool and API is new and experimental and is subject to suddenly change in the next release. Please make a complete backup of your index before using this to fix your index! </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00043">43</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="adaf818df0f3a5716f94fa20a9b6448e7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Lucene.Net.Index.CheckIndex.CheckIndex </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_syns2_index_8cs.html#aada057080323f6e867d8f9c189276716">Directory</a>&#160;</td>
<td class="paramname"><em>dir</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a new <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html" title="Basic tool and API to check the health of an index and write a new segments file that removes referen...">CheckIndex</a> on the directory. </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00255">255</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a57737c05b66f447aaaf2e5e730be02c3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a> Lucene.Net.Index.CheckIndex.CheckIndex_Renamed_Method </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html" title="Returned from CheckIndex_Renamed_Method() detailing the health and status of the index.">Status</a> instance detailing the state of the index. </p>
<p>As this method checks every byte in the index, on a large index it can take quite a long time to run.</p>
<p><b>WARNING</b>: make sure you only call this when the index is not opened by any writer. </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00306">306</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div>
</div>
<a class="anchor" id="aa6935812af182afc89f2baed1da5fdfe"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a> Lucene.Net.Index.CheckIndex.CheckIndex_Renamed_Method </td>
<td>(</td>
<td class="paramtype">List&lt; string &gt;&#160;</td>
<td class="paramname"><em>onlySegments</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html" title="Returned from CheckIndex_Renamed_Method() detailing the health and status of the index.">Status</a> instance detailing the state of the index. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">onlySegments</td><td>list of specific segment names to check</td></tr>
</table>
</dd>
</dl>
<p>As this method checks every byte in the specified segments, on a large index it can take quite a long time to run.</p>
<p><b>WARNING</b>: make sure you only call this when the index is not opened by any writer. </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00325">325</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div>
</div>
<a class="anchor" id="a1b4986e6d70fc625be3ff69cd59858ff"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void Lucene.Net.Index.CheckIndex.FixIndex </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index_1_1_status.html">Status</a>&#160;</td>
<td class="paramname"><em>result</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Repairs the index using previously returned result from <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html" title="Basic tool and API to check the health of an index and write a new segments file that removes referen...">CheckIndex</a>. Note that this does not remove any of the unreferenced files after it's done; you must separately open an <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_writer.html" title="An IndexWriter creates and maintains an index. The create argument to the constructor determines whet...">IndexWriter</a>, which deletes unreferenced files when it's created. </p>
<p><b>WARNING</b>: this writes a new segments file into the index, effectively removing all documents in broken segments from the index. BE CAREFUL.</p>
<p><b>WARNING</b>: Make sure you only call this when the index is not opened by any writer. </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00859">859</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div>
</div>
<a class="anchor" id="a163ed262f2054382e2370c6a212143a3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void Lucene.Net.Index.CheckIndex.Main </td>
<td>(</td>
<td class="paramtype">System.String[]&#160;</td>
<td class="paramname"><em>args</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Command-line interface to check and fix an index. Run it like this: </p>
<p><code> java -ea:<a class="el" href="namespace_lucene_1_1_net.html">Lucene.Net</a>... <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_check_index.html" title="Basic tool and API to check the health of an index and write a new segments file that removes referen...">Lucene.Net.Index.CheckIndex</a> pathToIndex [-fix] [-segment X] [-segment Y] </code> </p>
<ul>
<li>
<code>-fix</code>: actually write a new segments_N file, removing any problematic segments </li>
<li>
<code>-segment X</code>: only check the specified segment(s). This can be specified multiple times, to check more than one segment, eg <code>-segment _2 -segment _a</code>. You can't use this with the -fix option. </li>
</ul>
<p><b>WARNING</b>: <code>-fix</code> should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned! </p>
<p>Run without -fix, this tool will open the index, report version information and report any exceptions it hits and what action it would take if -fix were specified. With -fix, this tool will remove any segments that have issues and write a new segments_N file. This means all documents contained in the affected segments will be removed. </p>
<p>This tool exits with exit code 1 if the index cannot be opened or has any corruption, else 0. </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00908">908</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div>
</div>
<a class="anchor" id="a7c281f925ea0402e66313c3fef6c3c79"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void Lucene.Net.Index.CheckIndex.SetInfoStream </td>
<td>(</td>
<td class="paramtype">StreamWriter @&#160;</td>
<td class="paramname"><em>out</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set infoStream where messages should go. If null, no messages are printed </p>
<p>Definition at line <a class="el" href="_check_index_8cs_source.html#l00264">264</a> of file <a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>core/Index/<a class="el" href="_check_index_8cs_source.html">CheckIndex.cs</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jan 3 2013 02:12:49 for Lucene.Net by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3
</small></address>
</body>
</html>