blob: b4754bd022eb71a526f65e231b251ae54dc907af [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.FieldScoreQuery 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_field_score_query.html">FieldScoreQuery</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="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Lucene.Net.Search.Function.FieldScoreQuery Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>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></p>
<p>Inherits <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html">Lucene.Net.Search.Function.ValueSourceQuery</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_1_1_type.html">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="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7da7cbe77e3d3a7414745fb92224bbc1"><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_field_score_query.html#a7da7cbe77e3d3a7414745fb92224bbc1">FieldScoreQuery</a> (System.String field, <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query_1_1_type.html">Type</a> type)</td></tr>
<tr class="memdesc:a7da7cbe77e3d3a7414745fb92224bbc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query.html" title="A query that scores each document as the value of the numeric input field. The query matches all docu...">FieldScoreQuery</a> - a query that scores each document as the value of the numeric input field. The <code>type</code> param tells how to parse the field string values into a numeric score value. <a href="#a7da7cbe77e3d3a7414745fb92224bbc1"></a><br/></td></tr>
<tr class="separator:a7da7cbe77e3d3a7414745fb92224bbc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html">Lucene.Net.Search.Function.ValueSourceQuery</a></td></tr>
<tr class="memitem:ae37b11533fb4188b755c1e840968e2d8 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><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_value_source_query.html#ae37b11533fb4188b755c1e840968e2d8">ValueSourceQuery</a> (<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source.html">ValueSource</a> valSrc)</td></tr>
<tr class="memdesc:ae37b11533fb4188b755c1e840968e2d8 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a value source query <a href="#ae37b11533fb4188b755c1e840968e2d8"></a><br/></td></tr>
<tr class="separator:ae37b11533fb4188b755c1e840968e2d8 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a582ddb08dbda3a74848b7caf5ebc0f1e inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Query</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_value_source_query.html#a582ddb08dbda3a74848b7caf5ebc0f1e">Rewrite</a> (<a class="el" href="class_lucene_1_1_net_1_1_index_1_1_index_reader.html">IndexReader</a> reader)</td></tr>
<tr class="memdesc:a582ddb08dbda3a74848b7caf5ebc0f1e inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: called to re-write queries into primitive queries. For example, a <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_prefix_query.html" title="A Query that matches documents containing terms with a specified prefix. A PrefixQuery is built by Qu...">PrefixQuery</a> will be rewritten into a <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> that consists of TermQuerys. <a href="#a582ddb08dbda3a74848b7caf5ebc0f1e"></a><br/></td></tr>
<tr class="separator:a582ddb08dbda3a74848b7caf5ebc0f1e inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa88b655a781b4794f3cd51a129d3b019 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html#aa88b655a781b4794f3cd51a129d3b019">ExtractTerms</a> (System.Collections.Generic.ISet&lt; <a class="el" href="class_lucene_1_1_net_1_1_index_1_1_term.html">Term</a> &gt; terms)</td></tr>
<tr class="memdesc:aa88b655a781b4794f3cd51a129d3b019 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: adds all terms occuring in this query to the terms set. Only works if this query is in its <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html#a582ddb08dbda3a74848b7caf5ebc0f1e">rewritten</a> form. <a href="#aa88b655a781b4794f3cd51a129d3b019"></a><br/></td></tr>
<tr class="separator:aa88b655a781b4794f3cd51a129d3b019 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52a0214cfa53bca22bf9871ad192fbc5 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_weight.html">Weight</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_value_source_query.html#a52a0214cfa53bca22bf9871ad192fbc5">CreateWeight</a> (<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_searcher.html">Searcher</a> searcher)</td></tr>
<tr class="memdesc:a52a0214cfa53bca22bf9871ad192fbc5 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: Constructs an appropriate <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_weight.html" title="Expert: Calculate query weights and build query scorers. The purpose of Weight is to ensure searching...">Weight</a> implementation for this query. <a href="#a52a0214cfa53bca22bf9871ad192fbc5"></a><br/></td></tr>
<tr class="separator:a52a0214cfa53bca22bf9871ad192fbc5 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07fbd5b6d76802b523a66df87d04112d inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override System.String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html#a07fbd5b6d76802b523a66df87d04112d">ToString</a> (System.String field)</td></tr>
<tr class="memdesc:a07fbd5b6d76802b523a66df87d04112d inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints a query to a string, with <code>field</code> assumed to be the default field and omitted. The representation used is one that is supposed to be readable by <a class="el" href="class_lucene_1_1_net_1_1_query_parsers_1_1_query_parser.html">QueryParser</a>. However, there are the following limitations: </p>
<ul>
<li>
If the query was created by the parser, the printed representation may not be exactly what was parsed. For example, characters that need to be escaped will be represented without the required backslash. </li>
<li>
Some of the more complicated queries (e.g. span queries) don't have a representation that can be parsed by QueryParser. </li>
</ul>
<a href="#a07fbd5b6d76802b523a66df87d04112d"></a><br/></td></tr>
<tr class="separator:a07fbd5b6d76802b523a66df87d04112d inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65cd9f03a8c2c6c46427eb9fb1920c3c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html#a65cd9f03a8c2c6c46427eb9fb1920c3c">Equals</a> (System.Object o)</td></tr>
<tr class="memdesc:a65cd9f03a8c2c6c46427eb9fb1920c3c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if <code>o</code> is equal to this. <a href="#a65cd9f03a8c2c6c46427eb9fb1920c3c"></a><br/></td></tr>
<tr class="separator:a65cd9f03a8c2c6c46427eb9fb1920c3c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f1a2a5b13e425af8014a6a838eeaa57 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html#a7f1a2a5b13e425af8014a6a838eeaa57">GetHashCode</a> ()</td></tr>
<tr class="memdesc:a7f1a2a5b13e425af8014a6a838eeaa57 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a hash code value for this object. <a href="#a7f1a2a5b13e425af8014a6a838eeaa57"></a><br/></td></tr>
<tr class="separator:a7f1a2a5b13e425af8014a6a838eeaa57 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac598502932be437b5493de8e0ffc012c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memItemLeft" align="right" valign="top">override System.Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query.html#ac598502932be437b5493de8e0ffc012c">Clone</a> ()</td></tr>
<tr class="memdesc:ac598502932be437b5493de8e0ffc012c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a clone of this query. <a href="#ac598502932be437b5493de8e0ffc012c"></a><br/></td></tr>
<tr class="separator:ac598502932be437b5493de8e0ffc012c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_function_1_1_value_source_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_lucene_1_1_net_1_1_search_1_1_query')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Lucene.Net.Search.Query</a></td></tr>
<tr class="memitem:a1e815cb670dec850ff74001b507fdf77 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">override System.String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#a1e815cb670dec850ff74001b507fdf77">ToString</a> ()</td></tr>
<tr class="memdesc:a1e815cb670dec850ff74001b507fdf77 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints a query to a string. <a href="#a1e815cb670dec850ff74001b507fdf77"></a><br/></td></tr>
<tr class="separator:a1e815cb670dec850ff74001b507fdf77 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a723b98d56f3442fa67eba0d4c92b943c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_weight.html">Weight</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#a723b98d56f3442fa67eba0d4c92b943c">Weight</a> (<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_searcher.html">Searcher</a> searcher)</td></tr>
<tr class="memdesc:a723b98d56f3442fa67eba0d4c92b943c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: Constructs and initializes a <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_weight.html" title="Expert: Calculate query weights and build query scorers. The purpose of Weight is to ensure searching...">Weight</a> for a top-level query. <a href="#a723b98d56f3442fa67eba0d4c92b943c"></a><br/></td></tr>
<tr class="separator:a723b98d56f3442fa67eba0d4c92b943c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75af5b3a52be8d47449c807bade97838 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Query</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#a75af5b3a52be8d47449c807bade97838">Combine</a> (<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Query</a>[] queries)</td></tr>
<tr class="memdesc:a75af5b3a52be8d47449c807bade97838 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: called when re-writing queries under <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_multi_searcher.html" title="Implements search over a set of Searchables.">MultiSearcher</a>. <a href="#a75af5b3a52be8d47449c807bade97838"></a><br/></td></tr>
<tr class="separator:a75af5b3a52be8d47449c807bade97838 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61ccd3cc51e811a537f7929e98302fd3 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_similarity.html">Similarity</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#a61ccd3cc51e811a537f7929e98302fd3">GetSimilarity</a> (<a class="el" href="class_lucene_1_1_net_1_1_search_1_1_searcher.html">Searcher</a> searcher)</td></tr>
<tr class="memdesc:a61ccd3cc51e811a537f7929e98302fd3 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: Returns the <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_similarity.html" title="Expert: Scoring API. Subclasses implement search scoring.">Similarity</a> implementation to be used for this query. Subclasses may override this method to specify their own <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_similarity.html" title="Expert: Scoring API. Subclasses implement search scoring.">Similarity</a> implementation, perhaps one that delegates through that of the <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>. By default the <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>'s <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_similarity.html" title="Expert: Scoring API. Subclasses implement search scoring.">Similarity</a> implementation is returned. <a href="#a61ccd3cc51e811a537f7929e98302fd3"></a><br/></td></tr>
<tr class="separator:a61ccd3cc51e811a537f7929e98302fd3 inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a1966528d60f0f34294a4b1458dab1c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">override int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#a4a1966528d60f0f34294a4b1458dab1c">GetHashCode</a> ()</td></tr>
<tr class="separator:a4a1966528d60f0f34294a4b1458dab1c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99c7950ea92f8a234e46f94616170d4c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">override bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#a99c7950ea92f8a234e46f94616170d4c">Equals</a> (System.Object obj)</td></tr>
<tr class="separator:a99c7950ea92f8a234e46f94616170d4c inherit pub_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_class_lucene_1_1_net_1_1_search_1_1_query')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Lucene.Net.Search.Query</a></td></tr>
<tr class="memitem:ac1ca86c30835f69c14785d98261be101 inherit pub_static_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Query</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html#ac1ca86c30835f69c14785d98261be101">MergeBooleanQueries</a> (params <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_boolean_query.html">BooleanQuery</a>[] queries)</td></tr>
<tr class="memdesc:ac1ca86c30835f69c14785d98261be101 inherit pub_static_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expert: merges the clauses of a set 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>'s into a single <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>. <a href="#ac1ca86c30835f69c14785d98261be101"></a><br/></td></tr>
<tr class="separator:ac1ca86c30835f69c14785d98261be101 inherit pub_static_methods_class_lucene_1_1_net_1_1_search_1_1_query"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header properties_class_lucene_1_1_net_1_1_search_1_1_query"><td colspan="2" onclick="javascript:toggleInherit('properties_class_lucene_1_1_net_1_1_search_1_1_query')"><img src="closed.png" alt="-"/>&#160;Properties inherited from <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_query.html">Lucene.Net.Search.Query</a></td></tr>
<tr class="memitem:a2a58b600e864bed65cc21815fffa0218 inherit properties_class_lucene_1_1_net_1_1_search_1_1_query"><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_query.html#a2a58b600e864bed65cc21815fffa0218">Boost</a><code> [get, set]</code></td></tr>
<tr class="memdesc:a2a58b600e864bed65cc21815fffa0218 inherit properties_class_lucene_1_1_net_1_1_search_1_1_query"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets or sets the boost for this query clause to <code>b</code>. <a class="el" href="namespace_lucene_1_1_net_1_1_documents.html">Documents</a> matching this clause will (in addition to the normal weightings) have their score multiplied by <code>b</code>. The boost is 1.0 by default. <a href="#a2a58b600e864bed65cc21815fffa0218"></a><br/></td></tr>
<tr class="separator:a2a58b600e864bed65cc21815fffa0218 inherit properties_class_lucene_1_1_net_1_1_search_1_1_query"><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>A query that scores each document as the value of the numeric input field. </p>
<p>The query matches all documents, and scores each document according to the numeric value of that field. </p>
<p>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>
<p>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. </p>
<p>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>
<p><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! </p>
<p>&lt;font color="#FF0000"&gt; WARNING: The status of the <b><a class="el" href="namespace_lucene_1_1_net_1_1_search_1_1_function.html">Search.Function</a></b> package is experimental. The APIs introduced here might change in the future and will not be supported anymore in such a case.&lt;/font&gt; </p>
<p>Definition at line <a class="el" href="_field_score_query_8cs_source.html#l00063">63</a> of file <a class="el" href="_field_score_query_8cs_source.html">FieldScoreQuery.cs</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a7da7cbe77e3d3a7414745fb92224bbc1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Lucene.Net.Search.Function.FieldScoreQuery.FieldScoreQuery </td>
<td>(</td>
<td class="paramtype">System.String&#160;</td>
<td class="paramname"><em>field</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_function_1_1_field_score_query_1_1_type.html">Type</a>&#160;</td>
<td class="paramname"><em>type</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a <a class="el" href="class_lucene_1_1_net_1_1_search_1_1_function_1_1_field_score_query.html" title="A query that scores each document as the value of the numeric input field. The query matches all docu...">FieldScoreQuery</a> - a query that scores each document as the value of the numeric input field. The <code>type</code> param tells how to parse the field string values into a numeric score value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">field</td><td>the numeric field to be used. </td></tr>
<tr><td class="paramname">type</td><td>the type of the field: either <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>, <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>, <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>, or <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>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_field_score_query_8cs_source.html#l00113">113</a> of file <a class="el" href="_field_score_query_8cs_source.html">FieldScoreQuery.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="_field_score_query_8cs_source.html">FieldScoreQuery.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>