• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DocListAndSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setRescoredResults

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
private void setRescoredResults(ResponseBuilder rb, TopDocs topDocs,
        int offset, int len) {
    DocListAndSet results = rb.getResults();
    int totalHits = results.docList.matches();
    int[] docs = new int[topDocs.scoreDocs.length];
    float[] scores = new float[topDocs.scoreDocs.length];
    for (int i = 0; i < topDocs.scoreDocs.length; i++) {
        docs[i] = topDocs.scoreDocs[i].doc;
        scores[i] = topDocs.scoreDocs[i].score;
    }
    results.docList = new DocSlice(offset, len, docs, scores, totalHits,
            topDocs.getMaxScore());
    ResultContext ctx = (ResultContext) rb.rsp.getValues().get("response");
    ctx.docs = results.docList;
}
 
开发者ID:atware,项目名称:solr-leaning2rank,代码行数:16,代码来源:RankingComponent.java


示例2: process

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
@Override
public void process(final ResponseBuilder rb) throws IOException {
    final DocListAndSet results = rb.getResults();
    if (results != null) {
        final SolrQueryRequest req = rb.req;
        final SolrParams params = req.getParams();
        final String[] docValuesFields = params.getParams(DCF);
        if (docValuesFields == null) {
            return;
        }

        final DocList docs = results.docList;
        final NamedList<List<Long>> fragments = new SimpleOrderedMap<List<Long>>();
        final AtomicReader reader = req.getSearcher().getAtomicReader();
        for (final String field : docValuesFields) {
            final NumericDocValues numericDocValues = reader
                    .getNumericDocValues(field);
            if (numericDocValues == null) {
                continue;
            }
            final List<Long> valueList = new ArrayList<Long>();
            final DocIterator iterator = docs.iterator();
            for (int i = 0; i < docs.size(); i++) {
                final int docId = iterator.nextDoc();
                final long value = numericDocValues.get(docId);
                valueList.add(value);
            }
            fragments.add(field, valueList);
        }
        if (fragments.size() != 0) {
            rb.rsp.add(DOC_VALUES, fragments);
        }
    }
}
 
开发者ID:codelibs,项目名称:fess-solr-plugin,代码行数:35,代码来源:DocValuesComponent.java


示例3: RFResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public RFResult(List<RFTerm> RFTerms, Query finalRfQuery, DocListAndSet results){
    this.RFTerms = RFTerms;
    this.finalRfQuery = finalRfQuery;
    this.results = results;
}
 
开发者ID:DiceTechJobs,项目名称:RelevancyFeedback,代码行数:6,代码来源:RFResult.java


示例4: getResults

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public DocListAndSet getResults() {
    return results;
}
 
开发者ID:DiceTechJobs,项目名称:RelevancyFeedback,代码行数:4,代码来源:RFResult.java


示例5: postProcessResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
@Override
public DocListAndSet postProcessResult(ResponseBuilder rb, DocList originalResult) {
  // no post processing needed
  return null;
}
 
开发者ID:sematext,项目名称:solr-autocomplete,代码行数:6,代码来源:ExampleResalePriceGroupingHandler.java


示例6: postProcessDistributedResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
@Override
 public DocListAndSet postProcessDistributedResult(ResponseBuilder rb, SolrDocumentList originalResult) {
// no post processing needed
   return null;
 }
 
开发者ID:sematext,项目名称:solr-autocomplete,代码行数:6,代码来源:ExampleResalePriceGroupingHandler.java


示例7: postProcessResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
@Override
public DocListAndSet postProcessResult(ResponseBuilder rb, DocList originalResult) {
  // TODO Auto-generated method stub
  return null;
}
 
开发者ID:sematext,项目名称:solr-autocomplete,代码行数:6,代码来源:LocationGroupingHandler.java


示例8: postProcessDistributedResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
@Override
public DocListAndSet postProcessDistributedResult(ResponseBuilder rb, SolrDocumentList originalResult) {
  // TODO Auto-generated method stub
  return null;
}
 
开发者ID:sematext,项目名称:solr-autocomplete,代码行数:6,代码来源:LocationGroupingHandler.java


示例9: getResults

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public DocListAndSet getResults() {
  return results;
}
 
开发者ID:europeana,项目名称:search,代码行数:4,代码来源:ResponseBuilder.java


示例10: setResults

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public void setResults(DocListAndSet results) {
  this.results = results;
}
 
开发者ID:europeana,项目名称:search,代码行数:4,代码来源:ResponseBuilder.java


示例11: getMoreLikeThese

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
NamedList<DocList> getMoreLikeThese(ResponseBuilder rb,
    SolrIndexSearcher searcher, DocList docs, int flags) throws IOException {
  SolrParams p = rb.req.getParams();
  IndexSchema schema = searcher.getSchema();
  MoreLikeThisHandler.MoreLikeThisHelper mltHelper = new MoreLikeThisHandler.MoreLikeThisHelper(
      p, searcher);
  NamedList<DocList> mlt = new SimpleOrderedMap<>();
  DocIterator iterator = docs.iterator();
  
  SimpleOrderedMap<Object> dbg = null;
  if (rb.isDebug()) {
    dbg = new SimpleOrderedMap<>();
  }
  
  while (iterator.hasNext()) {
    int id = iterator.nextDoc();
    int rows = p.getInt(MoreLikeThisParams.DOC_COUNT, 5);
    DocListAndSet sim = mltHelper.getMoreLikeThis(id, 0, rows, null, null,
        flags);
    String name = schema.printableUniqueKey(searcher.doc(id));
    mlt.add(name, sim.docList);
    
    if (dbg != null) {
      SimpleOrderedMap<Object> docDbg = new SimpleOrderedMap<>();
      docDbg.add("rawMLTQuery", mltHelper.getRawMLTQuery().toString());
      docDbg
          .add("boostedMLTQuery", mltHelper.getBoostedMLTQuery().toString());
      docDbg.add("realMLTQuery", mltHelper.getRealMLTQuery().toString());
      SimpleOrderedMap<Object> explains = new SimpleOrderedMap<>();
      DocIterator mltIte = sim.docList.iterator();
      while (mltIte.hasNext()) {
        int mltid = mltIte.nextDoc();
        String key = schema.printableUniqueKey(searcher.doc(mltid));
        explains.add(key,
            searcher.explain(mltHelper.getRealMLTQuery(), mltid));
      }
      docDbg.add("explain", explains);
      dbg.add(name, docDbg);
    }
  }
  
  // add debug information
  if (dbg != null) {
    rb.addDebugInfo("moreLikeThis", dbg);
  }
  return mlt;
}
 
开发者ID:europeana,项目名称:search,代码行数:48,代码来源:MoreLikeThisComponent.java


示例12: MLTResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public MLTResult(List<MLTTerm> mltTerms, Query finalMltQuery, DocListAndSet results){
    this.mltTerms = mltTerms;
    this.finalMltQuery = finalMltQuery;
    this.results = results;
}
 
开发者ID:DiceTechJobs,项目名称:SolrPlugins,代码行数:6,代码来源:MLTResult.java


示例13: getMoreLikeThese

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
NamedList<DocList> getMoreLikeThese(ResponseBuilder rb,
    SolrIndexSearcher searcher, DocList docs, int flags) throws IOException {
  SolrParams p = rb.req.getParams();
  IndexSchema schema = searcher.getSchema();
  MoreLikeThisHandler.MoreLikeThisHelper mltHelper = new MoreLikeThisHandler.MoreLikeThisHelper(
      p, searcher);
  NamedList<DocList> mlt = new SimpleOrderedMap<DocList>();
  DocIterator iterator = docs.iterator();
  
  SimpleOrderedMap<Object> dbg = null;
  if (rb.isDebug()) {
    dbg = new SimpleOrderedMap<Object>();
  }
  
  while (iterator.hasNext()) {
    int id = iterator.nextDoc();
    int rows = p.getInt(MoreLikeThisParams.DOC_COUNT, 5);
    DocListAndSet sim = mltHelper.getMoreLikeThis(id, 0, rows, null, null,
        flags);
    String name = schema.printableUniqueKey(searcher.doc(id));
    mlt.add(name, sim.docList);
    
    if (dbg != null) {
      SimpleOrderedMap<Object> docDbg = new SimpleOrderedMap<Object>();
      docDbg.add("rawMLTQuery", mltHelper.getRawMLTQuery().toString());
      docDbg
          .add("boostedMLTQuery", mltHelper.getBoostedMLTQuery().toString());
      docDbg.add("realMLTQuery", mltHelper.getRealMLTQuery().toString());
      SimpleOrderedMap<Object> explains = new SimpleOrderedMap<Object>();
      DocIterator mltIte = sim.docList.iterator();
      while (mltIte.hasNext()) {
        int mltid = mltIte.nextDoc();
        String key = schema.printableUniqueKey(searcher.doc(mltid));
        explains.add(key,
            searcher.explain(mltHelper.getRealMLTQuery(), mltid));
      }
      docDbg.add("explain", explains);
      dbg.add(name, docDbg);
    }
  }
  
  // add debug information
  if (dbg != null) {
    rb.addDebugInfo("moreLikeThis", dbg);
  }
  return mlt;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:48,代码来源:MoreLikeThisComponent.java


示例14: getResults

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public DocListAndSet getResults() {
	return results;
}
 
开发者ID:netboynb,项目名称:search-core,代码行数:4,代码来源:ResponseBuilder.java


示例15: setResults

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public void setResults(DocListAndSet results) {
	this.results = results;
}
 
开发者ID:netboynb,项目名称:search-core,代码行数:4,代码来源:ResponseBuilder.java


示例16: postProcessResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
/**
 * Can be used to adjust resulting set after the query for particular group was executed. If no changes are done,
 * the method should return null.
 * 
 * @param rb .
 * @param originalResult .
 * @return new DocSlice result or null if no changes
 */
public abstract DocListAndSet postProcessResult(ResponseBuilder rb, DocList originalResult);
 
开发者ID:sematext,项目名称:solr-autocomplete,代码行数:10,代码来源:GroupingHandler.java


示例17: postProcessDistributedResult

import org.apache.solr.search.DocListAndSet; //导入依赖的package包/类
public abstract DocListAndSet postProcessDistributedResult(ResponseBuilder rb, SolrDocumentList originalResult); 
开发者ID:sematext,项目名称:solr-autocomplete,代码行数:2,代码来源:GroupingHandler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CacheEntity类代码示例发布时间:2022-05-22
下一篇:
Java Identifiable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap