blob: 56dd7a569b212edac71905266af4d8545e0ef894 [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.Function.CustomScoreProvider 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="namespace_lucene_1_1_net_1_1_search_1_1_function.html">Function</a></li><li class="navelem"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html">CustomScoreProvider</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Lucene.Net.Search.Function.CustomScoreProvider Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>An instance of this subclass should be returned by <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_query.html#aab7ecc65053fd215dd983cc6dbac19a5" title="Returns a CustomScoreProvider that calculates the custom scores for the given IndexReader. The default implementation returns a default implementation as specified in the docs of CustomScoreProvider. ">CustomScoreQuery.GetCustomScoreProvider</a>, if you want to modify the custom score calculation of a <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_query.html" title="Query that sets document score as a programmatic function of several (sub) scores: the score of its s...">CustomScoreQuery</a>.
<a href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#details">More...</a></p>
<p>Inherited by Lucene.Net.Search.Function.CustomScoreQuery.AnonymousCustomScoreProvider.</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:a24ca19546c507a8ac43afeb614c4b5e5"><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_search_1_1_function_1_1_custom_score_provider.html#a24ca19546c507a8ac43afeb614c4b5e5">CustomScoreProvider</a> (<a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_reader.html">IndexReader</a> <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#a3ddefc6b3e8f45370c78abf6ba1408e8">reader</a>)</td></tr>
<tr class="memdesc:a24ca19546c507a8ac43afeb614c4b5e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new instance of the provider class for the given IndexReader. <a href="#a24ca19546c507a8ac43afeb614c4b5e5"></a><br/></td></tr>
<tr class="separator:a24ca19546c507a8ac43afeb614c4b5e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1c26916728c081c59f8dc7add5b5c25"><td class="memItemLeft" align="right" valign="top">virtual float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#aa1c26916728c081c59f8dc7add5b5c25">CustomScore</a> (int doc, float subQueryScore, float[] valSrcScores)</td></tr>
<tr class="memdesc:aa1c26916728c081c59f8dc7add5b5c25"><td class="mdescLeft">&#160;</td><td class="mdescRight"> <a href="#aa1c26916728c081c59f8dc7add5b5c25"></a><br/></td></tr>
<tr class="separator:aa1c26916728c081c59f8dc7add5b5c25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2d49405872ae745fb70f9d433d4d823"><td class="memItemLeft" align="right" valign="top">virtual float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#ac2d49405872ae745fb70f9d433d4d823">CustomScore</a> (int doc, float subQueryScore, float valSrcScore)</td></tr>
<tr class="memdesc:ac2d49405872ae745fb70f9d433d4d823"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a custom score by the subQuery score and the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html" title="Expert: A Query that sets the scores of document to the values obtained from a ValueSource. This query provides a score for each and every undeleted document in the index. The value source can be based on a (cached) value of an indexed field, but it can also be based on an external source, e.g. values read from an external database. Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc).">ValueSourceQuery</a> score. Subclasses can override this method to modify the custom score. If your custom scoring is different than the default herein you should override at least one of the two customScore() methods. If the number of ValueSourceQueries is always &lt; 2 it is sufficient to override this customScore() method, which is simpler. The default computation herein is a multiplication of the two scores: <a href="#ac2d49405872ae745fb70f9d433d4d823"></a><br/></td></tr>
<tr class="separator:ac2d49405872ae745fb70f9d433d4d823"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fda9d634c570250730a2be42a9c96d6"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#a1fda9d634c570250730a2be42a9c96d6">CustomExplain</a> (int doc, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a> subQueryExpl, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>[] valSrcExpls)</td></tr>
<tr class="memdesc:a1fda9d634c570250730a2be42a9c96d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Explain the custom score. Whenever overriding <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#aa1c26916728c081c59f8dc7add5b5c25">CustomScore(int, float, float[])</a>, this method should also be overridden to provide the correct explanation for the part of the custom scoring. <a href="#a1fda9d634c570250730a2be42a9c96d6"></a><br/></td></tr>
<tr class="separator:a1fda9d634c570250730a2be42a9c96d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93213133dcb717f46ac2c9f3b0230514"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#a93213133dcb717f46ac2c9f3b0230514">CustomExplain</a> (int doc, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a> subQueryExpl, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a> valSrcExpl)</td></tr>
<tr class="memdesc:a93213133dcb717f46ac2c9f3b0230514"><td class="mdescLeft">&#160;</td><td class="mdescRight">Explain the custom score. Whenever overriding <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#ac2d49405872ae745fb70f9d433d4d823" title="Compute a custom score by the subQuery score and the ValueSourceQuery score. Subclasses can override ...">CustomScore(int, float, float)</a>, this method should also be overridden to provide the correct explanation for the part of the custom scoring. <a href="#a93213133dcb717f46ac2c9f3b0230514"></a><br/></td></tr>
<tr class="separator:a93213133dcb717f46ac2c9f3b0230514"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a3ddefc6b3e8f45370c78abf6ba1408e8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_reader.html">IndexReader</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#a3ddefc6b3e8f45370c78abf6ba1408e8">reader</a></td></tr>
<tr class="separator:a3ddefc6b3e8f45370c78abf6ba1408e8"><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>An instance of this subclass should be returned by <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_query.html#aab7ecc65053fd215dd983cc6dbac19a5" title="Returns a CustomScoreProvider that calculates the custom scores for the given IndexReader. The default implementation returns a default implementation as specified in the docs of CustomScoreProvider. ">CustomScoreQuery.GetCustomScoreProvider</a>, if you want to modify the custom score calculation of a <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_query.html" title="Query that sets document score as a programmatic function of several (sub) scores: the score of its s...">CustomScoreQuery</a>. </p>
<p>Since <a class="el" href="namespace_lucene.html">Lucene</a> 2.9, queries operate on each segment of an <a class="el" href="namespace_lucene_1_1_net_1_1_index.html">Index</a> separately, so overriding the similar (now deprecated) methods in <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_query.html" title="Query that sets document score as a programmatic function of several (sub) scores: the score of its s...">CustomScoreQuery</a> is no longer suitable, as the supplied <code>doc</code> ID is per-segment and without knowledge of the IndexReader you cannot access the document or <a class="el" href="interface_lucene_1_1_net_1_1_search_1_1_field_cache.html">FieldCache</a>.</p>
<p>.experimental </p>
<dl class="section since"><dt>Since</dt><dd>2.9.2 </dd></dl>
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00039">39</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a24ca19546c507a8ac43afeb614c4b5e5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Lucene.Net.Search.Function.CustomScoreProvider.CustomScoreProvider </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_reader.html">IndexReader</a>&#160;</td>
<td class="paramname"><em>reader</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new instance of the provider class for the given IndexReader. </p>
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00047">47</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a1fda9d634c570250730a2be42a9c96d6"></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_search_1_1_explanation.html">Explanation</a> Lucene.Net.Search.Function.CustomScoreProvider.CustomExplain </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>doc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>&#160;</td>
<td class="paramname"><em>subQueryExpl</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>[]&#160;</td>
<td class="paramname"><em>valSrcExpls</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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Explain the custom score. Whenever overriding <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#aa1c26916728c081c59f8dc7add5b5c25">CustomScore(int, float, float[])</a>, this method should also be overridden to provide the correct explanation for the part of the custom scoring. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">doc</td><td>doc being explained</td></tr>
<tr><td class="paramname">subQueryExpl</td><td>explanation for the sub-query part</td></tr>
<tr><td class="paramname">valSrcExpls</td><td>explanation for the value source part</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an explanation for the custom score</dd></dl>
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00126">126</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div>
</div>
<a class="anchor" id="a93213133dcb717f46ac2c9f3b0230514"></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_search_1_1_explanation.html">Explanation</a> Lucene.Net.Search.Function.CustomScoreProvider.CustomExplain </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>doc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>&#160;</td>
<td class="paramname"><em>subQueryExpl</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_explanation.html">Explanation</a>&#160;</td>
<td class="paramname"><em>valSrcExpl</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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Explain the custom score. Whenever overriding <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#ac2d49405872ae745fb70f9d433d4d823" title="Compute a custom score by the subQuery score and the ValueSourceQuery score. Subclasses can override ...">CustomScore(int, float, float)</a>, this method should also be overridden to provide the correct explanation for the part of the custom scoring. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">doc</td><td>doc being explained</td></tr>
<tr><td class="paramname">subQueryExpl</td><td>explanation for the sub-query part</td></tr>
<tr><td class="paramname">valSrcExpl</td><td>explanation for the value source part</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an explanation for the custom score</dd></dl>
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00161">161</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div>
</div>
<a class="anchor" id="aa1c26916728c081c59f8dc7add5b5c25"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual float Lucene.Net.Search.Function.CustomScoreProvider.CustomScore </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>doc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>subQueryScore</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float[]&#160;</td>
<td class="paramname"><em>valSrcScores</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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p></p>
<ul>
<li>Compute a custom score by the subQuery score and a number of <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html" title="Expert: A Query that sets the scores of document to the values obtained from a ValueSource. This query provides a score for each and every undeleted document in the index. The value source can be based on a (cached) value of an indexed field, but it can also be based on an external source, e.g. values read from an external database. Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc).">ValueSourceQuery</a> scores. </li>
</ul>
<p>Subclasses can override this method to modify the custom score. </p>
<p>If your custom scoring is different than the default herein you should override at least one of the two customScore() methods. If the number of ValueSourceQueries is always &lt; 2 it is sufficient to override the other <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_custom_score_provider.html#ac2d49405872ae745fb70f9d433d4d823">CustomScore()</a> method, which is simpler. </p>
<p>The default computation herein is a multiplication of given scores: </p>
<pre>
ModifiedScore = valSrcScore * valSrcScores[0] * valSrcScores[1] * ...
</pre> <dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">doc</td><td>id of scored doc</td></tr>
<tr><td class="paramname">subQueryScore</td><td>score of that doc by the subQuery</td></tr>
<tr><td class="paramname">valSrcScores</td><td>scores of that doc by the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html" title="Expert: A Query that sets the scores of document to the values obtained from a ValueSource. This query provides a score for each and every undeleted document in the index. The value source can be based on a (cached) value of an indexed field, but it can also be based on an external source, e.g. values read from an external database. Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc).">ValueSourceQuery</a></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>custom score</dd></dl>
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00074">74</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div>
</div>
<a class="anchor" id="ac2d49405872ae745fb70f9d433d4d823"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual float Lucene.Net.Search.Function.CustomScoreProvider.CustomScore </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>doc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>subQueryScore</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>valSrcScore</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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Compute a custom score by the subQuery score and the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html" title="Expert: A Query that sets the scores of document to the values obtained from a ValueSource. This query provides a score for each and every undeleted document in the index. The value source can be based on a (cached) value of an indexed field, but it can also be based on an external source, e.g. values read from an external database. Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc).">ValueSourceQuery</a> score. Subclasses can override this method to modify the custom score. If your custom scoring is different than the default herein you should override at least one of the two customScore() methods. If the number of ValueSourceQueries is always &lt; 2 it is sufficient to override this customScore() method, which is simpler. The default computation herein is a multiplication of the two scores: </p>
<pre>
ModifiedScore = subQueryScore * valSrcScore
</pre> <dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">doc</td><td>id of scored doc</td></tr>
<tr><td class="paramname">subQueryScore</td><td>score of that doc by the subQuery</td></tr>
<tr><td class="paramname">valSrcScore</td><td>score of that doc by the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html" title="Expert: A Query that sets the scores of document to the values obtained from a ValueSource. This query provides a score for each and every undeleted document in the index. The value source can be based on a (cached) value of an indexed field, but it can also be based on an external source, e.g. values read from an external database. Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc).">ValueSourceQuery</a></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>custom score</dd></dl>
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00111">111</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a3ddefc6b3e8f45370c78abf6ba1408e8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_reader.html">IndexReader</a> Lucene.Net.Search.Function.CustomScoreProvider.reader</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_custom_score_provider_8cs_source.html#l00042">42</a> of file <a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>core/Search/Function/<a class="el" href="_custom_score_provider_8cs_source.html">CustomScoreProvider.cs</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jan 3 2013 02:12:58 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>