当前位置: 首页>>代码示例>>Java>>正文


Java SolrParams.getFloat方法代码示例

本文整理汇总了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;
}
 
开发者ID:europeana,项目名称:search,代码行数:39,代码来源:DisMaxQParser.java

示例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);
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:BM25SimilarityFactory.java

示例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);
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:TextProfileSignature.java

示例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");
}
 
开发者ID:europeana,项目名称:search,代码行数:7,代码来源:LMDirichletSimilarityFactory.java

示例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);
}
 
开发者ID:europeana,项目名称:search,代码行数:7,代码来源:LMJelinekMercerSimilarityFactory.java

示例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);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:48,代码来源:SweetSpotSimilarityFactory.java

示例7: getAlpha

import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
private Float getAlpha(SolrParams params){
    return params.getFloat(ALPHA, this.dfltAlpha);
}
 
开发者ID:DiceTechJobs,项目名称:SolrPlugins,代码行数:4,代码来源:NaiveBayesComponent.java


注:本文中的org.apache.solr.common.params.SolrParams.getFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。