blob: bb085a2739cfff157280b3aae4376496109c75d0 [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.Search.Collector 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_search.html">Search</a></li><li class="navelem"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html">Collector</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="class_lucene_1_1_net_1_1_search_1_1_collector-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Lucene.Net.Search.Collector Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc.
<a href="class_lucene_1_1_net_1_1_search_1_1_collector.html#details">More...</a></p>
<p>Inherited by Lucene.Net.Demo.SearchFiles.AnonymousClassCollector, Lucene.Net.Index.Memory.MemoryIndex.FillingCollector, Lucene.Net.Search.BooleanScorer.BooleanScorerCollector, Lucene.Net.Search.MultiSearcher.AnonymousClassCollector, Lucene.Net.Search.ParallelMultiSearcher.AnonymousClassCollector1, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_positive_scores_only_collector.html">Lucene.Net.Search.PositiveScoresOnlyCollector</a>, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_time_limiting_collector.html">Lucene.Net.Search.TimeLimitingCollector</a>, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_top_docs_collector_3_01_t_01_4.html">Lucene.Net.Search.TopDocsCollector&lt; T &gt;</a>, WorldNet.Net.SynExpand.CollectorImpl, WorldNet.Net.SynLookup.CollectorImpl, and WorldNet.Net.SynLookup.CountingCollector.</p>
<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:aa8d9d434cf08dd3422210a7c00ec9e80"><td class="memItemLeft" align="right" valign="top">abstract void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#aa8d9d434cf08dd3422210a7c00ec9e80">SetScorer</a> (<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_scorer.html">Scorer</a> scorer)</td></tr>
<tr class="memdesc:aa8d9d434cf08dd3422210a7c00ec9e80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before successive calls to <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a>. Implementations that need the score of the current document (passed-in to <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a>), should save the passed-in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_scorer.html" title="Expert: Common scoring functionality for different types of queries.">Scorer</a> and call scorer.score() when needed. <a href="#aa8d9d434cf08dd3422210a7c00ec9e80"></a><br/></td></tr>
<tr class="separator:aa8d9d434cf08dd3422210a7c00ec9e80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a125e477dc1b59bbdb22fa71eeac4fd8b"><td class="memItemLeft" align="right" valign="top">abstract void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b">Collect</a> (int doc)</td></tr>
<tr class="memdesc:a125e477dc1b59bbdb22fa71eeac4fd8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called once for every document matching a query, with the unbased document number. <a href="#a125e477dc1b59bbdb22fa71eeac4fd8b"></a><br/></td></tr>
<tr class="separator:a125e477dc1b59bbdb22fa71eeac4fd8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8ff0ddcfa363877a8bb87a31ff38d5d"><td class="memItemLeft" align="right" valign="top">abstract void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#aa8ff0ddcfa363877a8bb87a31ff38d5d">SetNextReader</a> (<a class="el" href="_more_like_this_8cs.html#a2a6914ea10bbe06764856e29e5674e66">IndexReader</a> reader, int docBase)</td></tr>
<tr class="memdesc:aa8ff0ddcfa363877a8bb87a31ff38d5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before collecting from each IndexReader. All doc ids in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a> will correspond to reader. <a href="#aa8ff0ddcfa363877a8bb87a31ff38d5d"></a><br/></td></tr>
<tr class="separator:aa8ff0ddcfa363877a8bb87a31ff38d5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:a07ed980f78f4da95c2968646c8b0c279"><td class="memItemLeft" align="right" valign="top">abstract bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a07ed980f78f4da95c2968646c8b0c279">AcceptsDocsOutOfOrder</a><code> [get]</code></td></tr>
<tr class="memdesc:a07ed980f78f4da95c2968646c8b0c279"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return <code>true</code> if this collector does not require the matching docIDs to be delivered in int sort order (smallest to largest) to <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect</a>. Most <a class="el" href="namespace_lucene.html">Lucene</a> <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html" title="The abstract base class for queries. Instantiable subclasses are: TermQuery MultiTermQuery BooleanQ...">Query</a> implementations will visit matching docIDs in order. However, some queries (currently limited to certain cases of <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_boolean_query.html" title="A Query that matches documents matching boolean combinations of other queries, e.g. TermQuerys, PhraseQuerys or other BooleanQuerys. ">BooleanQuery</a>) can achieve faster searching if the <code><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a></code> allows them to deliver the docIDs out of order. Many collectors don't mind getting docIDs out of order, so it's important to return <code>true</code> here. <a href="#a07ed980f78f4da95c2968646c8b0c279"></a><br/></td></tr>
<tr class="separator:a07ed980f78f4da95c2968646c8b0c279"><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>Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. </p>
<p><a class="el" href="namespace_lucene.html">Lucene</a>'s core collectors are derived from <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a>. Likely your application can use one of these classes, or subclass TopDocsCollector{T}, instead of implementing <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a> directly:</p>
<ul>
<li>
<p class="startli">TopDocsCollector{T} is an abstract base class that assumes you will retrieve the top N docs, according to some criteria, after collection is done. </p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_top_score_doc_collector.html" title="A Collector implementation that collects the top-scoring hits, returning them as a TopDocs...">TopScoreDocCollector</a> is a concrete subclass TopDocsCollector{T} and sorts according to score + docID. This is used internally by the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_index_searcher.html" title="Implements search over a single IndexReader.">IndexSearcher</a> search methods that do not take an explicit <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_sort.html" title="Encapsulates sort criteria for returned hits.">Sort</a>. It is likely the most frequently used collector.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_top_field_collector.html" title="A Collector that sorts by SortField using FieldComparators. See the Create method for instantiating a...">TopFieldCollector</a> subclasses TopDocsCollector{T} and sorts according to a specified <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_sort.html" title="Encapsulates sort criteria for returned hits.">Sort</a> object (sort by field). This is used internally by the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_index_searcher.html" title="Implements search over a single IndexReader.">IndexSearcher</a> search methods that take an explicit <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_sort.html" title="Encapsulates sort criteria for returned hits.">Sort</a>.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_time_limiting_collector.html" title="The TimeLimitingCollector is used to timeout search requests that take longer than the maximum allowe...">TimeLimitingCollector</a>, which wraps any other <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a> and aborts the search if it's taken too much time.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_positive_scores_only_collector.html" title="A Collector implementation which wraps another Collector and makes sure only documents with scores &gt; ...">PositiveScoresOnlyCollector</a> wraps any other <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a> and prevents collection of hits whose score is &lt;= 0.0</p>
<p class="endli"></p>
</li>
</ul>
<p><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a> decouples the score from the collected doc: the score computation is skipped entirely if it's not needed. Collectors that do need the score should implement the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#aa8d9d434cf08dd3422210a7c00ec9e80" title="Called before successive calls to Collect(int). Implementations that need the score of the current do...">SetScorer</a> method, to hold onto the passed <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_scorer.html" title="Expert: Common scoring functionality for different types of queries.">Scorer</a> instance, and call <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_scorer.html#a9e45575b3a407f5cb224b51405893c3f" title="Returns the score of the current document matching the query. Initially invalid, until DocIdSetIterat...">Scorer.Score()</a> within the collect method to compute the current hit's score. If your collector may request the score for a single hit multiple times, you should use <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_score_caching_wrapping_scorer.html" title="A Scorer which wraps another scorer and caches the score of the current document. Successive calls to...">ScoreCachingWrappingScorer</a>. </p>
<p><b>NOTE:</b> The doc that is passed to the collect method is relative to the current reader. If your collector needs to resolve this to the docID space of the Multi*Reader, you must re-base it by recording the docBase from the most recent setNextReader call. Here's a simple example showing how to collect docIDs into a BitSet:</p>
<p><code> <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_searcher.html" title="An abstract base class for search implementations. Implements the main search methods.">Searcher</a> searcher = new IndexSearcher(indexReader); final BitSet bits = new BitSet(indexReader.MaxDoc); searcher.search(query, new Collector() { private int docBase;</code></p>
<p><code> <em>// ignore scorer</em> public void setScorer(Scorer scorer) { }</code></p>
<p><code> <em>// accept docs out of order (for a BitSet it doesn't matter)</em> public boolean acceptsDocsOutOfOrder() { return true; }</code></p>
<p><code> public void collect(int doc) { bits.set(doc + docBase); }</code></p>
<p><code> public void setNextReader(IndexReader reader, int docBase) { this.docBase = docBase; } }); </code></p>
<p>Not all collectors will need to rebase the docID. For example, a collector that simply counts the total number of hits would skip it.</p>
<p><b>NOTE:</b> Prior to 2.9, <a class="el" href="namespace_lucene.html">Lucene</a> silently filtered out hits with score &lt;= 0. As of 2.9, the core Collectors no longer do that. It's very unusual to have such hits (a negative query boost, or function query returning negative custom scores, could cause it to happen). If you need that behavior, use <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_positive_scores_only_collector.html" title="A Collector implementation which wraps another Collector and makes sure only documents with scores &gt; ...">PositiveScoresOnlyCollector</a> .</p>
<p><b>NOTE:</b> This API is experimental and might change in incompatible ways in the next release.</p>
<p>&lt;since&gt; 2.9 &lt;/since&gt; </p>
<p>Definition at line <a class="el" href="_collector_8cs_source.html#l00125">125</a> of file <a class="el" href="_collector_8cs_source.html">Collector.cs</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a125e477dc1b59bbdb22fa71eeac4fd8b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">abstract void Lucene.Net.Search.Collector.Collect </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>doc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called once for every document matching a query, with the unbased document number. </p>
<p>Note: This is called in an inner search loop. For good search performance, implementations of this method should not call <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_searcher.html#a9d0023e8f18632fe0709e9c40155dbca" title="Expert: Returns the stored fields of document i.">Searcher.Doc(int)</a> or <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_reader.html#ae5a8698ada40868908ea27f502337ee2" title="Returns the stored fields of the nth Document in this index. NOTE: for performance reasons...">Lucene.Net.Index.IndexReader.Document(int)</a> on every hit. Doing so can slow searches by an order of magnitude or more. </p>
<p>Implemented in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_time_limiting_collector.html#a2bd9898cd61387b02277e98a42497451">Lucene.Net.Search.TimeLimitingCollector</a>, and <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_positive_scores_only_collector.html#ae1f6497efeb1a072b86f9a1bfcedaeb6">Lucene.Net.Search.PositiveScoresOnlyCollector</a>.</p>
</div>
</div>
<a class="anchor" id="aa8ff0ddcfa363877a8bb87a31ff38d5d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">abstract void Lucene.Net.Search.Collector.SetNextReader </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_more_like_this_8cs.html#a2a6914ea10bbe06764856e29e5674e66">IndexReader</a>&#160;</td>
<td class="paramname"><em>reader</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>docBase</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before collecting from each IndexReader. All doc ids in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a> will correspond to reader. </p>
<p>Add docBase to the current IndexReaders internal document id to re-base ids in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">reader</td><td>next IndexReader </td></tr>
<tr><td class="paramname">docBase</td><td></td></tr>
</table>
</dd>
</dl>
<p>Implemented in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_time_limiting_collector.html#afb6a8d9b61637385eae21703872a4bee">Lucene.Net.Search.TimeLimitingCollector</a>, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_top_score_doc_collector.html#a976cb3501a573e50b163445bf4fd09d7">Lucene.Net.Search.TopScoreDocCollector</a>, and <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_positive_scores_only_collector.html#af9483f8889796a6ea366920c83e0de6a">Lucene.Net.Search.PositiveScoresOnlyCollector</a>.</p>
</div>
</div>
<a class="anchor" id="aa8d9d434cf08dd3422210a7c00ec9e80"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">abstract void Lucene.Net.Search.Collector.SetScorer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_scorer.html">Scorer</a>&#160;</td>
<td class="paramname"><em>scorer</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called before successive calls to <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a>. Implementations that need the score of the current document (passed-in to <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect(int)</a>), should save the passed-in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_scorer.html" title="Expert: Common scoring functionality for different types of queries.">Scorer</a> and call scorer.score() when needed. </p>
<p>Implemented in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_time_limiting_collector.html#a47f045a3b6aea81b78c833ef3ada3ac7">Lucene.Net.Search.TimeLimitingCollector</a>, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_top_score_doc_collector.html#a9034980204c042c188d73ada27e3a829">Lucene.Net.Search.TopScoreDocCollector</a>, and <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_positive_scores_only_collector.html#ac2694d0b548173c51a10045a8d7bc8b2">Lucene.Net.Search.PositiveScoresOnlyCollector</a>.</p>
</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a class="anchor" id="a07ed980f78f4da95c2968646c8b0c279"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">abstract bool Lucene.Net.Search.Collector.AcceptsDocsOutOfOrder</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return <code>true</code> if this collector does not require the matching docIDs to be delivered in int sort order (smallest to largest) to <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html#a125e477dc1b59bbdb22fa71eeac4fd8b" title="Called once for every document matching a query, with the unbased document number.">Collect</a>. Most <a class="el" href="namespace_lucene.html">Lucene</a> <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html" title="The abstract base class for queries. Instantiable subclasses are: TermQuery MultiTermQuery BooleanQ...">Query</a> implementations will visit matching docIDs in order. However, some queries (currently limited to certain cases of <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_boolean_query.html" title="A Query that matches documents matching boolean combinations of other queries, e.g. TermQuerys, PhraseQuerys or other BooleanQuerys. ">BooleanQuery</a>) can achieve faster searching if the <code><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_collector.html" title="Expert: Collectors are primarily meant to be used to gather raw results from a search, and implement sorting or custom result filtering, collation, etc. ">Collector</a></code> allows them to deliver the docIDs out of order. Many collectors don't mind getting docIDs out of order, so it's important to return <code>true</code> here. </p>
<p>Definition at line <a class="el" href="_collector_8cs_source.html#l00174">174</a> of file <a class="el" href="_collector_8cs_source.html">Collector.cs</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>core/Search/<a class="el" href="_collector_8cs_source.html">Collector.cs</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jan 3 2013 02:12:56 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>