Exemple #1
0
        public override Explanation Explain(int doc)
        {
            Explanation tfExplanation = new Explanation();

            int expDoc = Advance(doc);

            float phraseFreq = (expDoc == doc)?freq:0.0f;

            tfExplanation.SetValue(GetSimilarity().Tf(phraseFreq));
            tfExplanation.SetDescription("tf(phraseFreq=" + phraseFreq + ")");

            return(tfExplanation);
        }
Exemple #2
0
            public override Explanation Explain(int doc)
            {
                Explanation result         = new Explanation();
                Explanation nonPayloadExpl = base.Explain(doc);

                result.AddDetail(nonPayloadExpl);
                Explanation payloadBoost = new Explanation();

                result.AddDetail(payloadBoost);
                float avgPayloadScore = (payloadsSeen > 0?(payloadScore / payloadsSeen):1);

                payloadBoost.SetValue(avgPayloadScore);
                payloadBoost.SetDescription("scorePayload(...)");
                result.SetValue(nonPayloadExpl.GetValue() * avgPayloadScore);
                result.SetDescription("bnq, product of:");
                return(result);
            }
Exemple #3
0
                public override Explanation Explain(int doc)
                {
                    ComplexExplanation result         = new ComplexExplanation();
                    Explanation        nonPayloadExpl = base.Explain(doc);

                    result.AddDetail(nonPayloadExpl);
                    // QUESTION: Is there a way to avoid this skipTo call? We need to know
                    // whether to load the payload or not
                    Explanation payloadBoost = new Explanation();

                    result.AddDetail(payloadBoost);

                    float payloadScore = GetPayloadScore();

                    payloadBoost.SetValue(payloadScore);
                    // GSI: I suppose we could toString the payload, but I don't think that
                    // would be a good idea
                    payloadBoost.SetDescription("scorePayload(...)");
                    result.SetValue(nonPayloadExpl.GetValue() * payloadScore);
                    result.SetDescription("btq, product of:");
                    result.SetMatch(nonPayloadExpl.GetValue() == 0?false:true);                     // LUCENE-1303
                    return(result);
                }
Exemple #4
0
			public override Explanation Explain(int doc)
			{
				Explanation result = new Explanation();
				Explanation nonPayloadExpl = base.Explain(doc);
				result.AddDetail(nonPayloadExpl);
				Explanation payloadBoost = new Explanation();
				result.AddDetail(payloadBoost);
				float avgPayloadScore = (payloadsSeen > 0?(payloadScore / payloadsSeen):1);
				payloadBoost.SetValue(avgPayloadScore);
				payloadBoost.SetDescription("scorePayload(...)");
				result.SetValue(nonPayloadExpl.GetValue() * avgPayloadScore);
				result.SetDescription("bnq, product of:");
				return result;
			}
Exemple #5
0
		public override Explanation Explain(int doc)
		{
			Explanation tfExplanation = new Explanation();
			
			int expDoc = Advance(doc);
			
			float phraseFreq = (expDoc == doc)?freq:0.0f;
			tfExplanation.SetValue(GetSimilarity().Tf(phraseFreq));
			tfExplanation.SetDescription("tf(phraseFreq=" + phraseFreq + ")");
			
			return tfExplanation;
		}
Exemple #6
0
				public override Explanation Explain(int doc)
				{
					ComplexExplanation result = new ComplexExplanation();
					Explanation nonPayloadExpl = base.Explain(doc);
					result.AddDetail(nonPayloadExpl);
					// QUESTION: Is there a way to avoid this skipTo call? We need to know
					// whether to load the payload or not
					Explanation payloadBoost = new Explanation();
					result.AddDetail(payloadBoost);
					
					float payloadScore = GetPayloadScore();
					payloadBoost.SetValue(payloadScore);
					// GSI: I suppose we could toString the payload, but I don't think that
					// would be a good idea
					payloadBoost.SetDescription("scorePayload(...)");
					result.SetValue(nonPayloadExpl.GetValue() * payloadScore);
					result.SetDescription("btq, product of:");
					result.SetMatch(nonPayloadExpl.GetValue() == 0?false:true); // LUCENE-1303
					return result;
				}