Package com.browseengine.bobo.sort

Examples of com.browseengine.bobo.sort.SortCollector$CollectorContext


    int count = req.getCount();

    if (offset<0 || count<0){
    throw new IllegalArgumentException("both offset and count must be > 0: "+offset+"/"+count);
    }
    SortCollector collector = getSortCollector(req.getSort(),req.getQuery(), offset, count, req.isFetchStoredFields(),false, req.getGroupBy());
   
    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    BrowseHit[] hits = null;
    try{
      hits = collector.topDocs();
    }
    catch (IOException e){
      logger.error(e.getMessage(), e);
      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
        hit.setExplanation(expl);
      } catch (IOException e) {
        logger.error(e.getMessage(),e);
      }
      }
    }
   
    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessible(collector.getGroupAccessible());
    result.setTotalDocs(numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
    // set the transaction ID to trace transactions
View Full Code Here


    final BrowseResult result = new BrowseResult();

    long start = System.currentTimeMillis();

    SortCollector collector = getSortCollector(req.getSort(),req.getQuery(), req.getOffset(), req.getCount(), req.isFetchStoredFields(),false,req.getGroupBy());
   
    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    BrowseHit[] hits = null;

    try
    {
      hits = collector.topDocs();
    }
    catch (IOException e)
    {
      logger.error(e.getMessage(), e);
      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
        hit.setExplanation(expl);
      } catch (IOException e) {
        logger.error(e.getMessage(),e);
      }
      }
    }
    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessible(collector.getGroupAccessible());
    result.setTotalDocs(_reader.numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
    return result;
View Full Code Here

    if (offset < 0 || count < 0) {
      throw new IllegalArgumentException("both offset and count must be > 0: " + offset + "/"
          + count);
    }
    SortCollector collector = getSortCollector(req.getSort(), req.getQuery(), offset, count,
      req.isFetchStoredFields(), req.getTermVectorsToFetch(), req.getGroupBy(),
      req.getMaxPerGroup(), req.getCollectDocIdCache());

    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    if (req.getMapReduceWrapper() != null) {
      result.setMapReduceResult(req.getMapReduceWrapper().getResult());
    }
    BrowseHit[] hits = null;
    try {
      hits = collector.topDocs();
    } catch (IOException e) {
      logger.error(e.getMessage(), e);
      result.addError(e.getMessage());
      hits = new BrowseHit[0];
    }

    Query q = req.getQuery();
    if (req.isShowExplanation()) {
      for (BrowseHit hit : hits) {
        try {
          int doc = hit.getDocid();
          Explanation expl = _indexSearcher.explain(q, doc);
          hit.setExplanation(expl);
        } catch (IOException e) {
          logger.error(e.getMessage(), e);
          result.addError(e.getMessage());
        }
      }
    }

    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessibles(collector.getGroupAccessibles());
    result.setSortCollector(collector);
    result.setTotalDocs(numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
View Full Code Here

    final BrowseResult result = new BrowseResult();

    long start = System.currentTimeMillis();

    SortCollector collector = getSortCollector(req.getSort(),req.getQuery(), req.getOffset(), req.getCount(), req.isFetchStoredFields(), req.getTermVectorsToFetch(),false,req.getGroupBy(), req.getMaxPerGroup(), req.getCollectDocIdCache());
   
    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    BrowseHit[] hits = null;

    try
    {
      hits = collector.topDocs();
    }
    catch (IOException e)
    {
      logger.error(e.getMessage(), e);
      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
        hit.setExplanation(expl);
      } catch (IOException e) {
        logger.error(e.getMessage(),e);
      }
      }
    }
    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessibles(collector.getGroupAccessibles());
    result.setSortCollector(collector);
    result.setTotalDocs(_reader.numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
View Full Code Here

    int count = req.getCount();

    if (offset<0 || count<0){
    throw new IllegalArgumentException("both offset and count must be > 0: "+offset+"/"+count);
    }
    SortCollector collector = getSortCollector(req.getSort(),req.getQuery(), offset, count, req.isFetchStoredFields(), req.getTermVectorsToFetch(),false, req.getGroupBy(), req.getMaxPerGroup(), req.getCollectDocIdCache());
   
    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    if (req.getMapReduceWrapper() != null) {
      result.setMapReduceResult(req.getMapReduceWrapper().getResult());
    }
    BrowseHit[] hits = null;
    try{
      hits = collector.topDocs();
    }
    catch (IOException e){
      logger.error(e.getMessage(), e);
      result.addError(e.getMessage());
      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
        hit.setExplanation(expl);
      } catch (IOException e) {
        logger.error(e.getMessage(),e);
        result.addError(e.getMessage());
      }
      }
    }
   
    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessibles(collector.getGroupAccessibles());
    result.setSortCollector(collector);
    result.setTotalDocs(numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
View Full Code Here

    final BrowseResult result = new BrowseResult();

    long start = System.currentTimeMillis();

    SortCollector collector = getSortCollector(req.getSort(),req.getQuery(), req.getOffset(), req.getCount(), req.isFetchStoredFields(), req.getTermVectorsToFetch(),false,req.getGroupBy(), req.getMaxPerGroup(), req.getCollectDocIdCache());
   
    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    BrowseHit[] hits = null;

    try
    {
      hits = collector.topDocs();
    }
    catch (IOException e)
    {
      logger.error(e.getMessage(), e);
      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
        hit.setExplanation(expl);
      } catch (IOException e) {
        logger.error(e.getMessage(),e);
      }
      }
    }
    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessible(collector.getGroupAccessible());
    result.setSortCollector(collector);
    result.setTotalDocs(_reader.numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
View Full Code Here

    int count = req.getCount();

    if (offset<0 || count<0){
    throw new IllegalArgumentException("both offset and count must be > 0: "+offset+"/"+count);
    }
    SortCollector collector = getSortCollector(req.getSort(),req.getQuery(), offset, count, req.isFetchStoredFields(), req.getTermVectorsToFetch(),false, req.getGroupBy(), req.getMaxPerGroup(), req.getCollectDocIdCache());
   
    Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
    browse(req, collector, facetCollectors);
    BrowseHit[] hits = null;
    try{
      hits = collector.topDocs();
    }
    catch (IOException e){
      logger.error(e.getMessage(), e);
      hits = new BrowseHit[0];
    }
   
    Query q = req.getQuery();
    if (q == null){
      q = new MatchAllDocsQuery();
    }
    if (req.isShowExplanation()){
      for (BrowseHit hit : hits){
        try {
        Explanation expl = explain(q, hit.getDocid());
        hit.setExplanation(expl);
      } catch (IOException e) {
        logger.error(e.getMessage(),e);
      }
      }
    }
   
    result.setHits(hits);
    result.setNumHits(collector.getTotalHits());
    result.setNumGroups(collector.getTotalGroups());
    result.setGroupAccessible(collector.getGroupAccessible());
    result.setSortCollector(collector);
    result.setTotalDocs(numDocs());
    result.addAll(facetCollectors);
    long end = System.currentTimeMillis();
    result.setTime(end - start);
View Full Code Here

    {
      if (resultList != null)
      {
        for (SenseiResult res : resultList)
        {
          SortCollector sortCollector = res.getSortCollector();
          if (sortCollector != null)
          {
            sortCollector.close();
          }
        }
      }
    }
  }
View Full Code Here

      totalDocs = 0;
      for (SenseiResult res : results)
      {
        if (hasSortCollector)
        {
          SortCollector sortCollector = res.getSortCollector();
          if (sortCollector == null) continue;
          int end = (res.getNumHits() % SortCollector.BLOCK_SIZE) - 1;
          Iterator<CollectorContext> contextIter = sortCollector.contextList.descendingIterator();
          CollectorContext currentContext = null;
          int contextLeft = 0;
View Full Code Here

    DocIDPriorityQueue docQueue = new DocIDPriorityQueue(MY_DOC_COMPARATOR, topHits, 0);

    for (SenseiResult res : results)
    {
      SortCollector sortCollector = res.getSortCollector();
      if (sortCollector == null)
        continue;

      int end = (res.getNumHits() % SortCollector.BLOCK_SIZE) - 1;
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.sort.SortCollector$CollectorContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.