Filter queries are not actually related to ranking, but user requests
have pointed out that specific boost queries to move results to the end
of the result list are not sufficient. Such boost filters may be better
executed as actual filter and therefore such a filter can now be
statically applied to every search request. A typical use could be the
expression "http_unique_b:true AND www_unique_b:true" which uses the
recently introduced fields http_unique_b and www_unique_b which are true
only for one of the alternatives with/without http(s) and with/without
prefix 'www.' in host names.
To find out which kind of operations are possible, see the <ahref="http://wiki.apache.org/solr/FunctionQuery"target="_blank">Solr Function Query</a> documentation.
Example: to order by date, use "recip(ms(NOW,last_modified),3.16e-11,1,1)", to order by crawldepth, use "div(100,add(crawldepth_i,1))".
Example: "fuzzy_signature_unique_b:true^100000.0f" means that documents, identified as 'double' are ranked very bad and appended to the end of all results (because the unique are ranked high).
To find appropriate fields for this query, see the <ahref="IndexSchema_p.html">YaCy Solr Schema</a> and look for boolean values (with suffix '_b') or tags inside string fields (with suffix '_s' or '_sxt').
The Filter Query is attached to every query. Use this to statically add a selection criteria to reduce the set of results.
Example: "http_unique_b:true AND www_unique_b:true" will filter out all results where urls appear also with/without http(s) and/or with/without 'www.' prefix.
To find appropriate fields for this query, see the <ahref="IndexSchema_p.html">YaCy Solr Schema</a>. Warning: bad expressions here will cause that you don't have any search result!
if(bf.length()>0)post.put("boost",bf);// a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29
if(bf.length()>0)mmsp.getMap().put("boost",newString[]{bf});// a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29
@ -523,6 +523,7 @@ public final class SwitchboardConstants {
*/
publicstaticfinalStringSEARCH_RANKING_SOLR_COLLECTION_BOOSTNAME_="search.ranking.solr.collection.boostname.tmpa.";// temporary until we know best default values; add the index number (0..3) to that string
params.setParam("fq",oldfq==null||oldfq.length()==0?fq:"("+oldfq+") AND ("+fq+")");
}
if(bq.length()>0)params.setParam("bq",bq);
if(bf.length()>0)params.setParam("boost",bf);// a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29