當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。