经过大量搜索,我找到了一篇带有答案的博客文章。简而言之,值是硬编码的,在类的GetRefinableManagedPropertyInfos
方法中Microsoft.Office.Server.Search.RefinementUtilities.ManagedPropertyInfoProvider
。以下是一个长代码片段,但请注意将GetValuesForRefinableProperties
值100
硬编码到maxItems
变量中的方法调用。我使用反射器生成以下内容:
public IEnumerable<RefinableManagedPropertyInfo> GetRefinableManagedPropertyInfos(SiteCollectionReference siteCollectionReference, double percentageThreshold = 0.8, TermReference? termReference = new TermReference?())
{
using (new SPMonitoredScope("ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos"))
{
long num;
IEnumerable<Refinement> enumerable3;
IEnumerable<RefinerData> enumerable6;
IEnumerable<ManagedPropertyInfo> refinablePropertiesInSchema = this.GetAllRefinableProperties(siteCollectionReference).ToList<ManagedPropertyInfo>();
if (!termReference.HasValue)
{
ULS.SendTraceTag(0x153103, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.High, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Schema info only requested. Returning.", new object[] { "ManagedProperties" });
return CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
}
IEnumerable<string> source = (from r in refinablePropertiesInSchema select r.Name).ToList<string>();
if (!source.Contains<string>("ManagedProperties", StringComparer.OrdinalIgnoreCase))
{
ULS.SendTraceTag(0x153104, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.High, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Can not find managed property {0} in schema. Returning only refinable properties from schema.", new object[] { "ManagedProperties" });
return CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
}
try
{
enumerable3 = this.GetValuesForRefinableProperty(siteCollectionReference, "ManagedProperties", termReference.Value, 0x7fffffff, out num).ToList<Refinement>();
}
catch (QueryFailedException exception)
{
exception.RefinablePropertiesFromSchema = CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
throw;
}
if (num == 0L)
{
ULS.SendTraceTag(0x153105, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.High, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Query returned 0 results. Returning only refinable properties from schema.");
return CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
}
ULS.SendTraceTag(0x153106, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Found {0} refinable properties with index values.", new object[] { enumerable3.Count<Refinement>() });
long threshold = (long) Math.Round((double) (num * percentageThreshold));
IEnumerable<string> enumerable4 = (from r in enumerable3
where r.RefinementCount >= threshold
select r.RefinementName).ToList<string>();
ULS.SendTraceTag(0x153107, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Found {0} managed properties with values above threshold {1}", new object[] { enumerable4.Count<string>(), threshold });
IEnumerable<string> enumerable5 = source.Intersect<string>(enumerable4, StringComparer.OrdinalIgnoreCase).ToList<string>();
ULS.SendTraceTag(0x153108, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Want to find entropy for {0} managed properties.", new object[] { enumerable5.Count<string>() });
try
{
enumerable6 = this.GetValuesForRefinableProperties(siteCollectionReference, enumerable5, termReference.Value, 100, out num).ToList<RefinerData>();
}
catch (QueryFailedException exception2)
{
exception2.RefinablePropertiesFromSchema = CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
throw;
}
ULS.SendTraceTag(0x153109, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Total hits in entropy query = {0} Number of refiners returned = {1}", new object[] { num, enumerable6.Count<RefinerData>() });
return CreateRefinableManagedPropertyInfoList((from r in enumerable6
where r.Entropy > 0M
select r).ToDictionary<RefinerData, string, RefinerData>(suggestedRefiner => suggestedRefiner.RefinerName, r => r, StringComparer.OrdinalIgnoreCase), num, enumerable3, refinablePropertiesInSchema);
}
}
我没有通过反编译、更改值和重新编译来验证这一点,但除非 Microsoft 提供补丁,否则 100 似乎是一个硬限制。上面的反编译代码在 SharePoint 2013 中是最新的。