public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
 {
     PerFieldSimWeight weight = new PerFieldSimWeight();
     weight.@delegate = Get(collectionStats.Field());
     weight.DelegateWeight = [email protected](queryBoost, collectionStats, termStats);
     return weight;
 }
        public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
        {
            PerFieldSimWeight weight = new PerFieldSimWeight();

            weight.@delegate      = Get(collectionStats.Field());
            weight.DelegateWeight = [email protected](queryBoost, collectionStats, termStats);
            return(weight);
        }
Esempio n. 3
0
 public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
 {
     BasicStats[] stats = new BasicStats[termStats.Length];
     for (int i = 0; i < termStats.Length; i++)
     {
         stats[i] = NewStats(collectionStats.Field(), queryBoost);
         FillBasicStats(stats[i], collectionStats, termStats[i]);
     }
     return(stats.Length == 1 ? stats[0] : new MultiSimilarity.MultiStats(stats) as SimWeight);
 }
Esempio n. 4
0
        public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
        {
            Explanation idf = termStats.Length == 1 ? IdfExplain(collectionStats, termStats[0]) : IdfExplain(collectionStats, termStats);

            float avgdl = AvgFieldLength(collectionStats);

            // compute freq-independent part of bm25 equation across all norm values
            float[] cache = new float[256];
            for (int i = 0; i < cache.Length; i++)
            {
                cache[i] = K1_Renamed * ((1 - b) + b * DecodeNormValue((sbyte)i) / avgdl);
            }
            return(new BM25Stats(collectionStats.Field(), idf, queryBoost, avgdl, cache));
        }
Esempio n. 5
0
        public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
        {
            Explanation idf = termStats.Length == 1 ? IdfExplain(collectionStats, termStats[0]) : IdfExplain(collectionStats, termStats);

            return(new IDFStats(collectionStats.Field(), idf, queryBoost));
        }
Esempio n. 6
0
        public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
        {
            Explanation idf = termStats.Length == 1 ? IdfExplain(collectionStats, termStats[0]) : IdfExplain(collectionStats, termStats);

            float avgdl = AvgFieldLength(collectionStats);

            // compute freq-independent part of bm25 equation across all norm values
            float[] cache = new float[256];
            for (int i = 0; i < cache.Length; i++)
            {
                cache[i] = K1_Renamed * ((1 - b) + b * DecodeNormValue((sbyte)i) / avgdl);
            }
            return new BM25Stats(collectionStats.Field(), idf, queryBoost, avgdl, cache);
        }
Esempio n. 7
0
 public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
 {
     BasicStats[] stats = new BasicStats[termStats.Length];
     for (int i = 0; i < termStats.Length; i++)
     {
         stats[i] = NewStats(collectionStats.Field(), queryBoost);
         FillBasicStats(stats[i], collectionStats, termStats[i]);
     }
     return stats.Length == 1 ? stats[0] : new MultiSimilarity.MultiStats(stats) as SimWeight;
 }
Esempio n. 8
0
 public override sealed SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
 {
     Explanation idf = termStats.Length == 1 ? IdfExplain(collectionStats, termStats[0]) : IdfExplain(collectionStats, termStats);
     return new IDFStats(collectionStats.Field(), idf, queryBoost);
 }