php-doc-en/reference/solr/solrdismaxquery/setboostfunction.xml
2018-01-25 15:34:22 +00:00

106 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="solrdismaxquery.setboostfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SolrDisMaxQuery::setBoostFunction</refname>
<refpurpose>Sets a Boost Function (bf parameter)</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>SolrDisMaxQuery</type><methodname>SolrDisMaxQuery::setBoostFunction</methodname>
<methodparam><type>string</type><parameter>function</parameter></methodparam>
</methodsynopsis>
<para>
Sets Boost Function (bf parameter).
</para>
<para>
Functions (with optional boosts) that will be included in the
user's query to influence the score. Any function supported natively
by Solr can be used, along with a boost value. e.g.:
</para>
<para>
recip(rord(myfield),1,2,3)^1.5
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>function</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<type>SolrDisMaxQuery</type>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>SolrDisMaxQuery::setBoostFunction</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dismaxQuery = new SolrDisMaxQuery('lucene');
$boostRecentDocsFunction = "recip(ms(NOW,mydatefield),3.16e-11,1,1)";
$dismaxQuery->setBoostFunction($boostRecentDocsFunction);
echo $dismaxQuery.PHP_EOL;
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
q=lucene&defType=edismax&bf=recip(ms(NOW,mydatefield),3.16e-11,1,1)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member></member>
</simplelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->