本文整理汇总了Java中org.apache.solr.common.params.SolrParams.getBool方法的典型用法代码示例。如果您正苦于以下问题:Java SolrParams.getBool方法的具体用法?Java SolrParams.getBool怎么用?Java SolrParams.getBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.common.params.SolrParams
的用法示例。
在下文中一共展示了SolrParams.getBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: finishStage
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void finishStage(ResponseBuilder rb) {
SolrParams params = rb.req.getParams();
boolean isShard = params.getBool(ShardParams.IS_SHARD, false);
if (isShard) {
return;
}
Boolean isFusionQuery = params.getBool(IS_FUSION_QUERY_PARAM);
if (isFusionQuery != null) {
if (isFusionQuery) {
log.info("Skipping the logging to Fusion as this a Fusion query");
return;
}
}
if (rb.stage != ResponseBuilder.STAGE_GET_FIELDS) {
return;
}
sendSearchLogsToFusion(rb, true);
}
示例2: finishStage
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void finishStage(ResponseBuilder rb) {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false) || !params.getBool(ClusteringParams.USE_SEARCH_RESULTS, false)) {
return;
}
if (rb.stage == ResponseBuilder.STAGE_GET_FIELDS) {
SearchClusteringEngine engine = getSearchClusteringEngine(rb);
if (engine != null) {
SolrDocumentList solrDocList = (SolrDocumentList)rb.rsp.getValues().get("response");
// TODO: Currently, docIds is set to null in distributed environment.
// This causes CarrotParams.PRODUCE_SUMMARY doesn't work.
// To work CarrotParams.PRODUCE_SUMMARY under distributed mode, we can choose either one of:
// (a) In each shard, ClusteringComponent produces summary and finishStage()
// merges these summaries.
// (b) Adding doHighlighting(SolrDocumentList, ...) method to SolrHighlighter and
// making SolrHighlighter uses "external text" rather than stored values to produce snippets.
Map<SolrDocument,Integer> docIds = null;
Object clusters = engine.cluster(rb.getQuery(), solrDocList, docIds, rb.req);
rb.rsp.add("clusters", clusters);
} else {
String name = getClusteringEngineName(rb);
log.warn("No engine for: " + name);
}
}
}
示例3: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(final NamedList args) {
if (args != null) {
SolrParams params = SolrParams.toSolrParams(args);
boolean enabled = params.getBool("enabled", true);
this.enabled = enabled;
overwriteDupes = params.getBool("overwriteDupes", true);
signatureField = params.get("signatureField", "signatureField");
signatureClass = params.get("signatureClass",
"org.apache.solr.update.processor.Lookup3Signature");
this.params = params;
Object fields = args.get("fields");
sigFields = fields == null ? null: StrUtils.splitSmart((String)fields, ",", true);
if (sigFields != null) {
Collections.sort(sigFields);
}
}
}
示例4: prepare
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void prepare(ResponseBuilder rb) throws IOException {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false)) {
return;
}
SolrSpellChecker spellChecker = getSpellChecker(params);
if (params.getBool(SPELLCHECK_BUILD, false)) {
spellChecker.build(rb.req.getCore(), rb.req.getSearcher());
rb.rsp.add("command", "build");
} else if (params.getBool(SPELLCHECK_RELOAD, false)) {
spellChecker.reload(rb.req.getCore(), rb.req.getSearcher());
rb.rsp.add("command", "reload");
}
}
示例5: createParser
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public QParser createParser(String qStr, SolrParams localParams, SolrParams params,
SolrQueryRequest req) {
answerTypeMap = new HashMap<String, String>();//<co id="qqpp.atm"/>
answerTypeMap.put("L", "NE_LOCATION");
answerTypeMap.put("T", "NE_TIME|NE_DATE");
answerTypeMap.put("P", "NE_PERSON");
answerTypeMap.put("M", "NE_MONEY");
answerTypeMap.put("O", "NE_ORGANIZATION");
answerTypeMap.put("L", "NE_LOCATION");
answerTypeMap.put("C", "NE_PERCENT");
answerTypeMap.put("F", "DESCRIPTION");
answerTypeMap.put("X", "OTHERS");
QParser qParser;
if (params.getBool(OWLParams.COMPONENT_NAME, false) == true //<co id="qqpp.explainif"/>
&& qStr.equals("*:*") == false) {
AnswerTypeClassifier atc =
new AnswerTypeClassifier(model, probs, atcg);//<co id="qqpp.atc"/>
Parser parser = new ChunkParser(chunker, tagger);//<co id="qqpp.parser"/>
qParser = new WiseOwlQParser(qStr, localParams, //<co id="qqpp.construct"/>
params, req, parser, atc, answerTypeMap);
} else {
//just do a regular query if OWL is turned off
qParser = req.getCore().getQueryPlugin("edismax")
.createParser(qStr, localParams, params, req);
}
return qParser;
}
示例6: prepare
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void prepare(ResponseBuilder rb) throws IOException {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false)) {
return;
}
}
示例7: SimilarityParser
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
public SimilarityParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
super(qstr, localParams, params, req);
//
// create api access via parameters
//
if(!checkParams(params)){
throw new RuntimeException("[SimilarityParser] Params missing in configuration");
}
if(params.get(config_fail) != null && params.getBool(config_fail)){
failOnConnectionError = true;
}
if(params.get(config_api_type).equals("mock")){
similarityApi = new SimilarityApiMock();
}
else {
similarityApi = new SimilarityApi(params.get(config_url), params.get(config_optionalParams));
}
if(params.get(config_query_method).equals("GT")){
modelMethod = AugmentedTermQuery.ModelMethod.Generalized;
}else{
modelMethod = AugmentedTermQuery.ModelMethod.Extended;
}
if(logger.isInfoEnabled()) {
logger.info("Class initialized with: " + similarityApi.getClass().getSimpleName());
}
}
开发者ID:sebastian-hofstaetter,项目名称:ir-generalized-translation-models,代码行数:31,代码来源:SimilarityParser.java
示例8: handleRequestBody
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
rsp.setHttpCaching(false);
final SolrParams solrParams = req.getParams();
String dicPath = solrParams.get("dicPath");
Dictionary dict = Utils.getDict(dicPath, loader);
NamedList<Object> result = new NamedList<Object>();
result.add("dicPath", dict.getDicPath().toURI());
boolean check = solrParams.getBool("check", false); //仅仅用于检测词库是否有变化
//用于尝试加载词库,有此参数, check 参数可以省略。
boolean reload = solrParams.getBool("reload", false);
check |= reload;
boolean changed = false;
boolean reloaded = false;
if(check) {
changed = dict.wordsFileIsChange();
result.add("changed", changed);
}
if(changed && reload) {
reloaded = dict.reload();
result.add("reloaded", reloaded);
}
rsp.add("result", result);
}
示例9: checkComponentShouldProcess
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public boolean checkComponentShouldProcess(ResponseBuilder rb) {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false)) {
return false;
}
if (!params.getBool(SpellCheckComponent.COMPONENT_NAME, false)) {
return false;
}
return true;
}
示例10: checkComponentShouldProcess
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public boolean checkComponentShouldProcess(ResponseBuilder rb) {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false)) {
return false;
}
return true;
}
示例11: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
super.init(params);
discountOverlaps = params.getBool("discountOverlaps", true);
basicModel = parseBasicModel(params.get("basicModel"));
afterEffect = parseAfterEffect(params.get("afterEffect"));
normalization = parseNormalization(
params.get("normalization"), params.get("c"), params.get("mu"), params.get("z"));
}
示例12: init
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void init(SolrParams params) {
super.init(params);
discountOverlaps = params.getBool("discountOverlaps", true);
distribution = parseDistribution(params.get("distribution"));
lambda = parseLambda(params.get("lambda"));
normalization = DFRSimilarityFactory.parseNormalization(
params.get("normalization"), params.get("c"), params.get("mu"), params.get("z"));
}
示例13: modifyRequest
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
@Override
public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false)) return;
int purpose = rb.grouping() ? ShardRequest.PURPOSE_GET_TOP_GROUPS : ShardRequest.PURPOSE_GET_TOP_IDS;
if ((sreq.purpose & purpose) != 0) {
// fetch at least 5 suggestions from each shard
int count = sreq.params.getInt(SPELLCHECK_COUNT, 1);
if (count < 5) count = 5;
sreq.params.set(SPELLCHECK_COUNT, count);
sreq.params.set("spellcheck", "true");
} else {
sreq.params.set("spellcheck", "false");
}
}
示例14: getAddCommand
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
private AddUpdateCommand getAddCommand(SolrQueryRequest req, SolrParams params) {
AddUpdateCommand addCmd = new AddUpdateCommand(req);
addCmd.overwrite = params.getBool(UpdateParams.OVERWRITE, true);
addCmd.commitWithin = params.getInt(UpdateParams.COMMIT_WITHIN, -1);
return addCmd;
}
示例15: MoreLikeThisHelper
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
public MoreLikeThisHelper( SolrParams params, SolrIndexSearcher searcher )
{
this.searcher = searcher;
this.reader = searcher.getIndexReader();
this.uniqueKeyField = searcher.getSchema().getUniqueKeyField();
this.needDocSet = params.getBool(FacetParams.FACET,false);
SolrParams required = params.required();
String[] fields = splitList.split( required.get(MoreLikeThisParams.SIMILARITY_FIELDS) );
if( fields.length < 1 ) {
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
"MoreLikeThis requires at least one similarity field: "+MoreLikeThisParams.SIMILARITY_FIELDS );
}
this.mlt = new MoreLikeThis( reader ); // TODO -- after LUCENE-896, we can use , searcher.getSimilarity() );
mlt.setFieldNames(fields);
mlt.setAnalyzer( searcher.getSchema().getIndexAnalyzer() );
// configurable params
mlt.setMinTermFreq( params.getInt(MoreLikeThisParams.MIN_TERM_FREQ, MoreLikeThis.DEFAULT_MIN_TERM_FREQ));
mlt.setMinDocFreq( params.getInt(MoreLikeThisParams.MIN_DOC_FREQ, MoreLikeThis.DEFAULT_MIN_DOC_FREQ));
mlt.setMaxDocFreq( params.getInt(MoreLikeThisParams.MAX_DOC_FREQ, MoreLikeThis.DEFAULT_MAX_DOC_FREQ));
mlt.setMinWordLen( params.getInt(MoreLikeThisParams.MIN_WORD_LEN, MoreLikeThis.DEFAULT_MIN_WORD_LENGTH));
mlt.setMaxWordLen( params.getInt(MoreLikeThisParams.MAX_WORD_LEN, MoreLikeThis.DEFAULT_MAX_WORD_LENGTH));
mlt.setMaxQueryTerms( params.getInt(MoreLikeThisParams.MAX_QUERY_TERMS, MoreLikeThis.DEFAULT_MAX_QUERY_TERMS));
mlt.setMaxNumTokensParsed(params.getInt(MoreLikeThisParams.MAX_NUM_TOKENS_PARSED, MoreLikeThis.DEFAULT_MAX_NUM_TOKENS_PARSED));
mlt.setBoost( params.getBool(MoreLikeThisParams.BOOST, false ) );
boostFields = SolrPluginUtils.parseFieldBoosts(params.getParams(MoreLikeThisParams.QF));
}