Examples of PwaDateCache


Examples of org.apache.lucene.search.caches.PwaDateCache

      funct+=5;
    }               
   
    // temporal features - local timestamps
    if (functions.hasFunction(funct) || functions.hasFunction(funct+1) || functions.hasFunction(funct+2)) {
      PwaDateCache cache=new PwaDateCache(null); // already initialized
      long timestamp=cache.getTimestamp(doc);
      //long minTimestamp=cache.getMinTimestamp();
      //long maxTimestamp=cache.getMaxTimestamp();                     
     
      if (functions.hasFunction(funct)) {   
        scores.addScore(funct, ((float)queryTimestamp) / PwaIRankingFunction.DAY_MILLISEC); // Query issue time in days
      }
      funct++;     
      if (functions.hasFunction(funct)) {
        scores.addScore(funct, (new PwaAge(timestamp,queryTimestamp)).score()); // Age in days from query issue time
      }
      funct++;       
      if (functions.hasFunction(funct)) {   
        scores.addScore(funct, ((float)timestamp) / PwaIRankingFunction.DAY_MILLISEC); // Version's timestamp in days
      }
      funct++;     
    }
    else {
      funct+=3;
    }
   
    // temporal features - global timestamps
    boolean temporalGlobalUsed=false;
    for (int i=funct; !temporalGlobalUsed && i<funct+9; i++) {
      if (functions.hasFunction(i)) {
        temporalGlobalUsed=true;
      }
    }   
    if (temporalGlobalUsed) {                 
      PwaDateCache cache=new PwaDateCache(null); // already initialized
      long timestamp=cache.getTimestamp(doc);
     
      int nVersionsURL;       
      long minTimestampURL;
      long maxTimestampURL;           
      UrlRow row=null;
View Full Code Here

Examples of org.apache.lucene.search.caches.PwaDateCache

      joiner.collectFeatures(doc(),collector);   
      PwaScores scores=PwaScorerFeatures.score(doc(),queryTimestamp,collector,joiner.getPositionsManager(),searcher,functions);
      return (new PwaLinearRankingModel()).score(functions, scores); // TODO parameterize the ranking model in the future
    }
    else if (scoreType==ScoreType.DATE_SORTED || scoreType==ScoreType.DATE_SORTED_REVERSE) { // results are sorted in TopDocCollector
      PwaDateCache sortCache=new PwaDateCache(reader);
      return sortCache.getTimestamp(doc());     
    }
    else { // flat ranking
      return 1;
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.caches.PwaDateCache

   * @param minTimestamp the minimum timestamp     
   * @param maxTimestamp the maximum timestamp   
   */ 
  public PwaDateRangeFilter(PwaSearchableCommon searchable, IndexReader reader, String minTimestamp, String maxTimestamp) throws IOException {
    super(searchable);
    this.cache = new PwaDateCache(reader);
    this.minTimestamp = Long.parseLong(minTimestamp)*1000;         
    this.maxTimestamp = Long.parseLong(maxTimestamp)*1000;
  }
 
View Full Code Here

Examples of org.apache.lucene.search.caches.PwaDateCache

   * @param timestamp timestamp     
   * @param reader index reader
   */ 
  public PwaDateClosestFilter(PwaSearchableCommon searchable, IndexReader reader, String timestamp) throws IOException {
    super(searchable);
    this.cache = new PwaDateCache(reader);
    this.timestamp = Long.parseLong(timestamp);         
    this.docClosest = -1;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.