blob: 512c549aa6343e147681cac30fe52caa003c78b3 [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: core/Search/Function/FieldScoreQuery.cs File 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><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><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="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#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="dir_1efe588324fc547683bba4a3f1bac847.html">core</a></li><li class="navelem"><a class="el" href="dir_56f9b3c34a852b92179da152ee78b823.html">Search</a></li><li class="navelem"><a class="el" href="dir_cb123a44de33b5e9808df0e59b6a0beb.html">Function</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> </div>
<div class="headertitle">
<div class="title">FieldScoreQuery.cs File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a href="_field_score_query_8cs_source.html">Go to the source code of this file.</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_search_1_1_function_1_1_field_score_query.html">Lucene.Net.Search.Function.FieldScoreQuery</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A query that scores each document as the value of the numeric input field. The query matches all documents, and scores each document according to the numeric value of that field. It is assumed, and expected, that: </p>
<ul>
<li>
The field used here is indexed, and has exactly one token in every scored document. </li>
<li>
Best if this field is un_tokenized. </li>
<li>
That token is parsable to the selected type. </li>
</ul>
Combining this query in a FunctionQuery allows much freedom in affecting document scores. Note, that with this freedom comes responsibility: it is more than likely that the default <a class="el" href="namespace_lucene.html">Lucene</a> scoring is superior in quality to scoring modified as explained here. However, in some cases, and certainly for research experiments, this capability may turn useful. When contructing this query, select the appropriate type. That type should match the data stored in the field. So in fact the "right" type should be selected before indexing. <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html" title="Type of score field, indicating how field values are interpreted/parsed. The type selected at search ...">Type</a> selection has effect on the RAM usage: </p>
<ul>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a19d455a56dcb987761f48be5a2c70734" title="field values are interpreted as numeric byte values. ">Type.BYTE</a> consumes 1 * maxDocs bytes. </li>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a0660831879e37f62039b8f6d818cbb55" title="field values are interpreted as numeric short values. ">Type.SHORT</a> consumes 2 * maxDocs bytes. </li>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a0bed4cfe167cec1b6fb0bd2c4f4dfb1e" title="field values are interpreted as numeric int values. ">Type.INT</a> consumes 4 * maxDocs bytes. </li>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a63d1ff19cf53472209bc4b1ad3745846" title="field values are interpreted as numeric float values. ">Type.FLOAT</a> consumes 8 * maxDocs bytes. </li>
</ul>
<b>Caching:</b> Values for the numeric field are loaded once and cached in memory for further use with the same IndexReader. To take advantage of this, it is extremely important to reuse index-readers or index-searchers, otherwise, for instance if for each query a new index reader is opened, large penalties would be paid for loading the field values into memory over and over again! <a href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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_search_1_1_function_1_1_field_score_query_1_1_type.html">Lucene.Net.Search.Function.FieldScoreQuery.Type</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html" title="Type of score field, indicating how field values are interpreted/parsed. The type selected at search ...">Type</a> of score field, indicating how field values are interpreted/parsed. The type selected at search search time should match the data stored in the field. Different types have different RAM requirements: </p>
<ul>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a19d455a56dcb987761f48be5a2c70734" title="field values are interpreted as numeric byte values. ">BYTE</a> consumes 1 * maxDocs bytes. </li>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a0660831879e37f62039b8f6d818cbb55" title="field values are interpreted as numeric short values. ">SHORT</a> consumes 2 * maxDocs bytes. </li>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a0bed4cfe167cec1b6fb0bd2c4f4dfb1e" title="field values are interpreted as numeric int values. ">INT</a> consumes 4 * maxDocs bytes. </li>
<li>
<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html#a63d1ff19cf53472209bc4b1ad3745846" title="field values are interpreted as numeric float values. ">FLOAT</a> consumes 8 * maxDocs bytes. </li>
</ul>
<a href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.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="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespace_lucene_1_1_net_1_1_search_1_1_function"><td class="memItemLeft" align="right" valign="top">package &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_lucene_1_1_net_1_1_search_1_1_function.html">Lucene.Net.Search.Function</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jan 3 2013 02:12:47 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>