Package com.flaptor.indextank.index

Examples of com.flaptor.indextank.index.ScoredMatch


          if (query.getRangeFilter() == null || query.getRangeFilter().matches(match.getDocId(), match.getScore(), query.getNow(), query.getVars())) {
              rescore(match, query, scoringFunctionIndex);
              faceter.computeDocument(match.getDocId());
             
              if (top.size() < n || top.peek().compareTo(match) > 0) {
                  ScoredMatch newMatch;
                  if (top.size() == n) {
                      newMatch = top.remove();
                      newMatch.getDocId().updateFrom(match.getDocId());
                      newMatch.setScore(match.getScore());
                  } else {
                      newMatch = new ScoredMatch(match.getScore(), match.getDocId().copy(256));
                  }
                        top.add(newMatch);
              }
            totalCount++;
           
View Full Code Here


  public Iterable<ScoredMatch> decode(Iterable<RawMatch> rawMatches, final double boostedNorm) {
    try {
      final TermPositions payloads = reader.termPositions(payloadTerm);
      return Iterables.transform(rawMatches, new Function<RawMatch, ScoredMatch>() {
          private byte[] data = new byte[256];
          private ScoredMatch match = new ScoredMatch(0, new DocId(data, 0, 0));
        @Override
        public ScoredMatch apply(RawMatch rawMatch) {
          int rawId = rawMatch.getRawId();
          try {
            if (payloads.skipTo(rawId) && payloads.doc() == rawId) {
              payloads.nextPosition();
              int size = payloads.getPayloadLength();
              if (size > data.length) {
                  data = new byte[size];
              }
              payloads.getPayload(data, 0);
              match.getDocId().update(data, 0, size);
              match.setScore(rawMatch.getBoostedScore() / boostedNorm);
              return match;
            } else {
              throw new IllegalArgumentException("rawId:" + rawId + " doesn't exist. Payloads.doc():" + payloads.doc());
            }
          } catch (IOException e) {
View Full Code Here

  public Iterable<ScoredMatch> decode(Iterable<RawMatch> rawMatches, final double boostedNorm) {
    return Iterables.transform(rawMatches, new Function<RawMatch, ScoredMatch>() {
            @Override
            public ScoredMatch apply(RawMatch rawMatch) {
                //System.out.println("RESULT: "+rawMatch.getNormalizedScore());
                return new ScoredMatch(rawMatch.getBoostedScore() / boostedNorm, docids[rawMatch.getRawId()]);
            }
        });
  }
View Full Code Here

    public MockSearchResults() {
        results = Lists.newArrayList();
    }

    public void addResult(double score, String docid) {
        results.add(new ScoredMatch(score, new DocId(docid)));
    }
View Full Code Here

TOP

Related Classes of com.flaptor.indextank.index.ScoredMatch

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.