Package org.terrier.matching

Examples of org.terrier.matching.QueryResultSet


  /** {@inheritDoc} */
  public ResultSet getResultSet(int start, int length)
  {
    if (arraysInitialised) {
      length = length < docids.length ? length : docids.length;
      QueryResultSet resultSet = new QueryResultSet(length);
      resultSet.setExactResultSize(this.getExactResultSize());
      System.arraycopy(docids, start, resultSet.getDocids(), 0, length);
      System.arraycopy(scores, start, resultSet.getScores(), 0, length);
      System.arraycopy(occurrences, start, resultSet.getOccurrences(), 0, length);
      return resultSet;
    } else
      throw new UnsupportedOperationException("");
  }
View Full Code Here


  {
    if (arraysInitialised) {
      int NewSize = positions.length;
      if (logger.isDebugEnabled())
        logger.debug("New results size is "+NewSize);
      QueryResultSet resultSet = new QueryResultSet(NewSize);
      resultSet.setExactResultSize(this.getExactResultSize());
      int newDocids[] = resultSet.getDocids();
      double newScores[] = resultSet.getScores();
      short newOccurs[] = resultSet.getOccurrences();
      int thisPosition;
      for(int i=0;i<NewSize;i++)
      {
        thisPosition = positions[i];
        if (logger.isDebugEnabled())
View Full Code Here

        ResultSet outRs = matching.match(rq.getQueryID(), mqt);
        //now crop the collectionresultset down to a query result set.
        rq.setResultSet(outRs.getResultSet(0, outRs.getResultSize()));
      } catch (IOException ioe) {
        logger.error("Problem running Matching, returning empty result set as query"+rq.getQueryID(), ioe);
        rq.setResultSet(new QueryResultSet(0));
      }
    }
    else
    {
      //logger.warn("Returning empty result set as query "+rq.getQueryID()+" is empty");
      rq.setResultSet(new QueryResultSet(0));
    }
            }
                catch(Exception e){}
        }
View Full Code Here

  public int getExactResultSize() { return exactResultSize; }
  /** {@inheritDoc}*/ @Override
  public ResultSet getResultSet(int start, int length)
  {
    length = length < docids.length ? length : docids.length;
    QueryResultSet resultSet = new QueryResultSet(length);
    System.arraycopy(docids, start, resultSet.getDocids(), 0, length);
    System.arraycopy(scores, start, resultSet.getScores(), 0, length);
    System.arraycopy(occurrences, start, resultSet.getOccurrences(), 0, length);
    return resultSet;
  }
View Full Code Here

TOP

Related Classes of org.terrier.matching.QueryResultSet

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.