Lucene.Net.Search.Explanation.AddDetail C# (CSharp) Méthode

AddDetail() public méthode

Adds a sub-node to this explanation node.
public AddDetail ( Explanation detail ) : void
detail Explanation
Résultat void
		public virtual void  AddDetail(Explanation detail)
		{
			if (details == null)
				details = new List<Explanation>();
			details.Add(detail);
		}
		

Usage Example

        public virtual Explanation Explain(IndexReader indexReader, int docid, Explanation innerExplaination)
        {
            if (!(indexReader is BoboIndexReader)) throw new ArgumentException("IndexReader is not BoboIndexReader");
            BoboIndexReader reader = (BoboIndexReader)indexReader;

            Explanation exp = new Explanation();
            exp.Description = "FacetBasedBoost";

            float boost = 1.0f;
            foreach (var boostEntry in _boostMaps)
            {
                string facetName = boostEntry.Key;
                IFacetHandler handler = reader.GetFacetHandler(facetName);
                if (!(handler is IFacetScoreable))
                    throw new ArgumentException(facetName + " does not implement IFacetScoreable");

                IFacetScoreable facetScoreable = (IFacetScoreable)handler;
                BoboDocScorer scorer = facetScoreable.GetDocScorer(reader, _scoringFunctionFactory, boostEntry.Value);
                float facetBoost = scorer.Score(docid);

                Explanation facetExp = new Explanation();
                facetExp.Description = facetName;
                facetExp.Value = facetBoost;
                facetExp.AddDetail(scorer.Explain(docid));
                boost *= facetBoost;
                exp.AddDetail(facetExp);
            }
            exp.Value = boost;
            exp.AddDetail(innerExplaination);
            return exp;
        }
All Usage Examples Of Lucene.Net.Search.Explanation::AddDetail