• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RequestHandlerUtils类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.apache.solr.handler.RequestHandlerUtils的典型用法代码示例。如果您正苦于以下问题:Java RequestHandlerUtils类的具体用法?Java RequestHandlerUtils怎么用?Java RequestHandlerUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RequestHandlerUtils类属于org.apache.solr.handler包,在下文中一共展示了RequestHandlerUtils类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handleRequestBody

点赞 2

import org.apache.solr.handler.RequestHandlerUtils; //导入依赖的package包/类
@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
    throws Exception {
  FileFloatSource.resetCache();
  log.debug("readerCache has been reset.");

  UpdateRequestProcessor processor =
    req.getCore().getUpdateProcessingChain(null).createProcessor(req, rsp);
  try{
    RequestHandlerUtils.handleCommit(req, processor, req.getParams(), true);
  }
  finally{
    processor.finish();
  }
}
 

开发者ID:europeana,
项目名称:search,
代码行数:16,
代码来源:FileFloatSource.java

示例2: handleRequestBody

点赞 2

import org.apache.solr.handler.RequestHandlerUtils; //导入依赖的package包/类
@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
	// TODO Auto-generated method stub
	SolrParams params = req.getParams();

	String recordUrl = params.get("url");
	String searchLogDocId = params.get("searchLogDocId");
	String clickLogDocId = generateClickLogDocId(recordUrl, searchLogDocId);
	String collectionName = params.get("collectionName");
	String displayUrl = params.toString();

	SolrInputDocument doc = new SolrInputDocument();
	doc.setField(StatsConstants.INDEX_FIELD_ID, clickLogDocId);
	doc.setField(StatsConstants.INDEX_FIELD_COLLECTION_NAME, collectionName);
	doc.setField(StatsConstants.INDEX_FIELD_SEARCH_LOG_DOC_ID, searchLogDocId);
	doc.setField(StatsConstants.INDEX_FIELD_RECORD_URL, recordUrl);
	doc.setField(StatsConstants.INDEX_FIELD_DISPLAY_URL, displayUrl);
	doc.setField(StatsConstants.INDEX_FIELD_CLICK_DATE, new Date());

	UpdateRequestProcessorChain processorChain = req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_CHAIN));

	UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);
	try {
		AddUpdateCommand addCmd = new AddUpdateCommand(req);
		addCmd.commitWithin = params.getInt(UpdateParams.COMMIT_WITHIN, -1);
		addCmd.overwrite = params.getBool(UpdateParams.OVERWRITE, true);
		addCmd.solrDoc = doc;
		processor.processAdd(addCmd);
		// Perhaps commit from the parameters
		RequestHandlerUtils.handleCommit(req, processor, params, false);
		RequestHandlerUtils.handleRollback(req, processor, params, false);

	} finally {
		// finish the request
		processor.finish();
	}
}
 

开发者ID:BassJel,
项目名称:Jouve-Project,
代码行数:38,
代码来源:ComputeClickRequestHandler.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)