本文整理汇总了Java中org.apache.solr.common.params.SolrParams.getFloat方法的典型用法代码示例。如果您正苦于以下问题:Java SolrParams.getFloat方法的具体用法?Java SolrParams.getFloat怎么用?Java SolrParams.getFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.common.params.SolrParams
的用法示例。
在下文中一共展示了SolrParams.getFloat方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMainQuery
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
/** Adds the main query to the query argument. If its blank then false is returned. */
protected boolean addMainQuery(BooleanQuery query, SolrParams solrParams) throws SyntaxError {
Map<String, Float> phraseFields = SolrPluginUtils.parseFieldBoosts(solrParams.getParams(DisMaxParams.PF));
float tiebreaker = solrParams.getFloat(DisMaxParams.TIE, 0.0f);
/* a parser for dealing with user input, which will convert
* things to DisjunctionMaxQueries
*/
SolrPluginUtils.DisjunctionMaxQueryParser up = getParser(queryFields, DisMaxParams.QS, solrParams, tiebreaker);
/* for parsing sloppy phrases using DisjunctionMaxQueries */
SolrPluginUtils.DisjunctionMaxQueryParser pp = getParser(phraseFields, DisMaxParams.PS, solrParams, tiebreaker);
/* * * Main User Query * * */
parsedUserQuery = null;
String userQuery = getString();
altUserQuery = null;
if (userQuery == null || userQuery.trim().length() < 1) {
// If no query is specified, we may have an alternate
altUserQuery = getAlternateUserQuery(solrParams);
if (altUserQuery == null)
return false;
query.add(altUserQuery, BooleanClause.Occur.MUST);
} else {
// There is a valid query string
userQuery = SolrPluginUtils.partialEscape(SolrPluginUtils.stripUnbalancedQuotes(userQuery)).toString();
userQuery = SolrPluginUtils.stripIllegalOperators(userQuery).toString();
parsedUserQuery = getUserQuery(userQuery, up, solrParams);
query.add(parsedUserQuery, BooleanClause.Occur.MUST);
Query phrase = getPhraseQuery(userQuery, pp);
if (null != phrase) {
query.add(phrase, BooleanClause.Occur.SHOULD);
}
}
return true;
}
示例2: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
super.init(params);
discountOverlaps = params.getBool("discountOverlaps", true);
k1 = params.getFloat("k1", 1.2f);
b = params.getFloat("b", 0.75f);
}
示例3: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
quantRate = params.getFloat("quantRate", 0.01f);
minTokenLen = params.getInt("minTokenLen", 2);
}
示例4: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
super.init(params);
discountOverlaps = params.getBool("discountOverlaps", true);
mu = params.getFloat("mu");
}
示例5: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
super.init(params);
discountOverlaps = params.getBool("discountOverlaps", true);
lambda = params.getFloat("lambda", 0.7f);
}
示例6: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
super.init(params);
Integer ln_min = params.getInt("lengthNormMin");
Integer ln_max = params.getInt("lengthNormMax");
Float ln_steep = params.getFloat("lengthNormSteepness");
if (! allOrNoneNull(ln_min, ln_max, ln_steep)) {
throw new SolrException(SERVER_ERROR, "Overriding default lengthNorm settings requires all to be specified: lengthNormMin, lengthNormMax, lengthNormSteepness");
}
Float hyper_min = params.getFloat("hyperbolicTfMin");
Float hyper_max = params.getFloat("hyperbolicTfMax");
Double hyper_base = params.getDouble("hyperbolicTfBase");
Float hyper_offset = params.getFloat("hyperbolicTfOffset");
if (! allOrNoneNull(hyper_min, hyper_max, hyper_base, hyper_offset)) {
throw new SolrException(SERVER_ERROR, "Overriding default hyperbolicTf settings requires all to be specified: hyperbolicTfMin, hyperbolicTfMax, hyperbolicTfBase, hyperbolicTfOffset");
}
Float baseline_base = params.getFloat("baselineTfBase");
Float baseline_min = params.getFloat("baselineTfMin");
if (! allOrNoneNull(baseline_min, baseline_base)) {
throw new SolrException(SERVER_ERROR, "Overriding default baselineTf settings requires all to be specified: baselineTfBase, baselineTfMin");
}
// sanity check that they aren't trying to use two diff tf impls
if ((null != hyper_min) && (null != baseline_min)) {
throw new SolrException(SERVER_ERROR, "Can not mix hyperbolicTf settings with baselineTf settings");
}
// pick Similarity impl based on wether hyper tf settings are set
sim = (null != hyper_min) ? new HyperbolicSweetSpotSimilarity()
: new SweetSpotSimilarity();
if (null != ln_min) {
// overlaps already handled by super factory
sim.setLengthNormFactors(ln_min, ln_max, ln_steep, this.discountOverlaps);
}
if (null != hyper_min) {
sim.setHyperbolicTfFactors(hyper_min, hyper_max, hyper_base, hyper_offset);
}
if (null != baseline_min) {
sim.setBaselineTfFactors(baseline_base, baseline_min);
}
}
示例7: getAlpha
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
private Float getAlpha(SolrParams params){
return params.getFloat(ALPHA, this.dfltAlpha);
}