19 using System.Collections.Generic;
20 using Lucene.Net.Index;
22 using Lucene.Net.Search;
25 namespace Lucene.Net.Search.Spans
33 protected internal float value_Renamed;
34 protected internal float idf;
35 protected internal float queryNorm;
36 protected internal float queryWeight;
38 protected internal ISet<Term> terms;
39 protected internal SpanQuery internalQuery;
45 this.internalQuery = query;
47 terms = Lucene.Net.Support.Compatibility.SetFactory.CreateHashSet<
Term>();
50 idfExp = similarity.IdfExplain(terms, searcher);
56 get {
return internalQuery; }
59 public override float Value
61 get {
return value_Renamed; }
64 public override float GetSumOfSquaredWeights()
66 queryWeight = idf*internalQuery.
Boost;
67 return queryWeight*queryWeight;
70 public override void Normalize(
float queryNorm)
72 this.queryNorm = queryNorm;
73 queryWeight *= queryNorm;
74 value_Renamed = queryWeight * idf;
79 return new SpanScorer(internalQuery.GetSpans(reader),
this, similarity, reader.
Norms(internalQuery.Field));
93 queryExpl.Description =
"queryWeight(" +
Query +
"), product of:";
97 queryExpl.AddDetail(boostExpl);
98 queryExpl.AddDetail(idfExpl);
101 queryExpl.AddDetail(queryNormExpl);
103 queryExpl.Value = boostExpl.
Value * idfExpl.
Value * queryNormExpl.
Value;
109 fieldExpl.
Description =
"fieldWeight(" + field +
":" + internalQuery.ToString(field) +
" in " + doc +
"), product of:";
116 byte[] fieldNorms = reader.
Norms(field);
118 fieldNormExpl.
Value = fieldNorm;
119 fieldNormExpl.
Description =
"fieldNorm(field=" + field +
", doc=" + doc +
")";
126 System.Boolean? tempAux = fieldExpl.
Match;
127 result.
Match = tempAux;
130 result.
Value = queryExpl.Value * fieldExpl.
Value;
132 if (queryExpl.Value == 1.0f)